0024884: expand the list of short compiler names in CMake meta-project
authorabv <abv@opencascade.com>
Wed, 30 Apr 2014 08:18:33 +0000 (12:18 +0400)
committerabv <abv@opencascade.com>
Wed, 30 Apr 2014 09:07:09 +0000 (13:07 +0400)
List of compiler short names expanded (added: gcc, gxx, mingw, clang, intel); generation of install folder name is corrected to include compiler name without spaces even if short name is not recognized.

Tcl search was fixed (tcl8.6 has higher priority than tcl or tcl8.5);
Search for fb2build.h of freetype 2.5.1 was corrected

THRDPARTY_PATH is included into LD_LIBRARY_PATH

CMakeLists.txt
adm/templates/env.sh.in
adm/templates/tcl.cmake

index 9a0c1da..6bbd29a 100644 (file)
@@ -62,29 +62,39 @@ if (MSVC)
   add_definitions(/fp:precise)
 endif()
 
-# set compiler short name and choose SSE2 option for appropriate MSVC compilers
-if (DEFINED MSVC70)
-  SET(COMPILER vc7)
-elseif (DEFINED MSVC80)
-  SET(COMPILER vc8)
+# choose SSE2 option for appropriate MSVC compilers
+if (MSVC80 OR MSVC90 OR MSVC10)
   if (${COMPILER_BITNESS} STREQUAL 32)
     add_definitions(/arch:SSE2)
   endif()
-elseif (DEFINED MSVC90)
-  SET(COMPILER vc9)
-  if (${COMPILER_BITNESS} STREQUAL 32)
-    add_definitions(/arch:SSE2)
-  endif()
-elseif (DEFINED MSVC10)
-  SET(COMPILER vc10)
-  if (${COMPILER_BITNESS} STREQUAL 32)
-    add_definitions(/arch:SSE2)
+endif()
+
+# set compiler short name
+if (MSVC)
+  if (MSVC70)
+    set (COMPILER vc7)
+  elseif (MSVC80)
+    set (COMPILER vc8)
+  elseif (MSVC90)
+    set (COMPILER vc9)
+  elseif (MSVC10)
+    set (COMPILER vc10)
+  elseif (MSVC11)
+    set (COMPILER vc11)
   endif()
-elseif (DEFINED MSVC11)
-  SET(COMPILER vc11)
+elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
+  set (COMPILER gcc)
+elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
+  set (COMPILER gxx)
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+  set (COMPILER clang)
+elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
+  set (COMPILER icc)
 else()
-  SET(COMPILER ${CMAKE_GENERATOR})
+  set (COMPILER ${CMAKE_GENERATOR})
+  string (REGEX REPLACE " " "" COMPILER ${COMPILER})
 endif()
+
 if (WIN32)
   SET(OS_WITH_BIT "win${COMPILER_BITNESS}")
 elseif(APPLE)
@@ -267,7 +277,11 @@ MACRO(THIRDPARTY_PRODUCT PRODUCT_NAME HEADER_NAME LIBRARY_NAME)
   IF(3RDPARTY_${PRODUCT_NAME}_DIR)
     IF("${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND")
       SET(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR "3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR-NOTFOUND" CACHE FILEPATH "Directory contains headers of the ${PRODUCT_NAME} product" FORCE)
-      FIND_PATH(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME} PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/include" NO_DEFAULT_PATH)
+      if ("${PRODUCT_NAME}" STREQUAL "FREETYPE")
+        FIND_PATH(3RDPARTY_FREETYPE_INCLUDE_DIR ${HEADER_NAME} PATHS "${3RDPARTY_FREETYPE_DIR}/include" "${3RDPARTY_FREETYPE_DIR}/include/freetype2" NO_DEFAULT_PATH)
+      else()
+        FIND_PATH(3RDPARTY_${PRODUCT_NAME}_INCLUDE_DIR ${HEADER_NAME} PATHS "${3RDPARTY_${PRODUCT_NAME}_DIR}/include" NO_DEFAULT_PATH)
+      endif()
     ENDIF()
 
     IF("${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_${PRODUCT_NAME}_LIBRARY}" STREQUAL "3RDPARTY_${PRODUCT_NAME}_LIBRARY-NOTFOUND")
@@ -402,12 +416,6 @@ ENDIF()
 # FREETYPE
 THIRDPARTY_PRODUCT("FREETYPE" "ft2build.h" "freetype${3RDPARTY_BUILD_SUFFIX}")
 
-IF("${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "" OR "${3RDPARTY_FREETYPE_INCLUDE_DIR}" STREQUAL "3RDPARTY_FREETYPE_INCLUDE_DIR-NOTFOUND")
-
-ELSEIF(EXISTS "${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2/")
-  SET(3RDPARTY_INCLUDE_DIRS "${3RDPARTY_INCLUDE_DIRS};${3RDPARTY_FREETYPE_INCLUDE_DIR}/freetype2")
-ENDIF()
-
 # FREEIMAGE
 IF(USE_FREEIMAGE)
   ADD_DEFINITIONS(-DHAVE_FREEIMAGE)
index 7bdd0ce..4915aca 100644 (file)
@@ -60,13 +60,12 @@ fi
 BIN_PATH="${WOKSTATION}${ARCH}/${COMPILER}/bin${CASDEB}"
 LIBS_PATH="${WOKSTATION}${ARCH}/${COMPILER}/lib${CASDEB}"
 
-export PATH="${CASROOT}/${BIN_PATH}:${THRDPARTY_PATH}:${PATH}"
+export PATH="${CASROOT}/${BIN_PATH}:${PATH}"
 
 if [ "$LD_LIBRARY_PATH" != "" ]; then
-    export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${LD_LIBRARY_PATH}"
-  else
-    export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}"
-  fi
+  export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}:${LD_LIBRARY_PATH}"
+else
+  export LD_LIBRARY_PATH="${CASROOT}/${LIBS_PATH}:${THRDPARTY_PATH}"
 fi
 
 if [ "$WOKSTATION" == "mac" ]; then
index 3284f82..e93fd75 100644 (file)
@@ -64,7 +64,7 @@ IF("${3RDPARTY_TCL_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TC
   
   IF(NOT "${3RDPARTY_TCL_DIR}" STREQUAL "")
     FIND_LIBRARY(3RDPARTY_TCL_LIBRARY
-                 NAMES tcl tcl8${TCL_SEP}6 tcl8${TCL_SEP}5
+                 NAMES tcl8${TCL_SEP}6 tcl8${TCL_SEP}5 tcl
                  PATHS "${3RDPARTY_TCL_DIR}/lib" NO_DEFAULT_PATH)
   ELSE()
     SET(3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS /usr/lib /usr/local/lib)
@@ -81,16 +81,16 @@ IF("${3RDPARTY_TCL_LIBRARY}" STREQUAL "" OR CHANGES_ARE_NEEDED OR "${3RDPARTY_TC
     
     # check default path (with additions) for library search
     FIND_LIBRARY(3RDPARTY_TCL_LIBRARY
-                 NAMES tcl tcl8${TCL_SEP}6 tcl8${TCL_SEP}5
+                 NAMES tcl8${TCL_SEP}6 tcl8${TCL_SEP}5 tcl
                  PATHS ${3RDPARTY_TCL_POSSIBLE_LIBRARIES_DIRS})
   ENDIF()
 ENDIF()
 
 #search the version of found tcl library
 IF("${3RDPARTY_TCL_LIBRARY}" STREQUAL "" OR "${3RDPARTY_TCL_LIBRARY}" STREQUAL "3RDPARTY_TCL_LIBRARY-NOTFOUND")
-  SET (TCL_DLL_SO_NAMES ${DLL_SO_PREFIX}tcl.${DLL_SO}
+  SET (TCL_DLL_SO_NAMES ${DLL_SO_PREFIX}tcl8${TCL_SEP}6.${DLL_SO}
                         ${DLL_SO_PREFIX}tcl8${TCL_SEP}5.${DLL_SO}
-                        ${DLL_SO_PREFIX}tcl8${TCL_SEP}6.${DLL_SO} )
+                        ${DLL_SO_PREFIX}tcl.${DLL_SO})
 ELSE()
   GET_FILENAME_COMPONENT(TCL_LIBRARY_NAME "${3RDPARTY_TCL_LIBRARY}" NAME)