]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Compilation SALOME by CMake(windows/linux)
authorana <ana@opencascade.com>
Wed, 19 Sep 2012 11:22:18 +0000 (11:22 +0000)
committerana <ana@opencascade.com>
Wed, 19 Sep 2012 11:22:18 +0000 (11:22 +0000)
salome_adm/cmake_files/FindPLATFORM.cmake
salome_adm/cmake_files/FindPTHREADS.cmake
salome_adm/cmake_files/UseOMNIORB.cmake

index b6a36caca27d8c313f214e38f108eaa3a41165c3..9266320ac7d263f49e2d8f0b97d9cf0ef35711af 100644 (file)
@@ -79,29 +79,46 @@ IF(CMAKE_BUILD_TYPE)
   ENDIF(WINDOWS)
 ENDIF(CMAKE_BUILD_TYPE)
 
-SET(PLATFORM_CPPFLAGS)
-SET(PLATFORM_LDFLAGS)
-SET(PLATFORM_LIBADD)
+SET(PLATFORM_CPPFLAGS) # to be removed
+SET(PLATFORM_LDFLAGS) # to be removed
+SET(PLATFORM_LIBADD) # to be removed
+
+SET(PLATFORM_LIBS)
+SET(PLATFORM_DEFINITIONS)
+
 IF(WINDOWS)
-  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0)
-  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_CRT_SECURE_NO_WARNINGS)  # To disable windows warnings for strcpy, fopen, ...
-  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SCL_SECURE_NO_WARNINGS)  # To disable windows warnings std::copy, std::transform, ...
-  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT)
-  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile
-  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM
-  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_WIN32_WINNT=0x0500) # Windows 2000 or later API is required
-  SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Ws2_32.lib)
-  SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Userenv.lib) # At least for GEOM suit
+  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} /W0) # to be removed
+  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_CRT_SECURE_NO_WARNINGS)  # To disable windows warnings for strcpy, fopen, ... # to be removed
+  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_SCL_SECURE_NO_WARNINGS)  # To disable windows warnings std::copy, std::transform, ... # to be removed
+  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DWNT) # to be removed
+  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DPPRO_NT) # For medfile # to be removed
+  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_USE_MATH_DEFINES) # At least for MEDMEM # to be removed
+  SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_WIN32_WINNT=0x0500) # Windows 2000 or later API is required # to be removed
+  SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Ws2_32.lib) # to be removed
+  SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} Userenv.lib) # At least for GEOM suit # to be removed
+
+  SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} /W0")
+  SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_CRT_SECURE_NO_WARNINGS")  # To disable windows warnings for strcpy, fopen, ...
+  SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_SCL_SECURE_NO_WARNINGS")  # To disable windows warnings std::copy, std::transform, ...
+  SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DWNT")
+  SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DPPRO_NT") # For medfile 
+  SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_USE_MATH_DEFINES") # At least for MEDMEM
+  SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -D_WIN32_WINNT=0x0500") # Windows 2000 or later API is required
+  SET(PLATFORM_LIBS ${PLATFORM_LIBS} Ws2_32.lib)
+  SET(PLATFORM_LIBS ${PLATFORM_LIBS} Userenv.lib) # At least for GEOM suit
+
 ELSE(WINDOWS)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wparentheses)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wreturn-type)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wmissing-declarations)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wunused)
   # SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -Wall)
-  SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl)
+  SET(PLATFORM_LIBADD ${PLATFORM_LIBADD} -ldl) # to be removed
+  SET(PLATFORM_LIBS ${PLATFORM_LIBS} -ldl)
 ENDIF(WINDOWS)
 
-SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4)
+SET(PLATFORM_CPPFLAGS "${PLATFORM_CPPFLAGS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4") # to be removed
+SET(PLATFORM_DEFINITIONS "${PLATFORM_DEFINITIONS} -DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_LONG=${CMAKE_SIZEOF_VOID_P} -DSIZEOF_INT=4")
 
 SET(COMPILATION_WITH_CMAKE ON)
 
index f9ba97e555f37b729815c9d7f6233756d6eba559..ce8231e4a93ac5aeb1c229adab8a8742521f6eec 100644 (file)
@@ -79,7 +79,8 @@ IF(PTHREADS_STATUS)
   FIND_PATH(PTHREADS_INCLUDE_DIR ${PTHREADS_INCLUDE_TO_FIND} PATHS ${PTHREADS_INCLUDE_PATHS} ${PTHREADS_FIND_PATHS_OPTION})
   IF(PTHREADS_INCLUDE_DIR)
     IF(PTHREADS_ROOT_USER)
-      SET(PTHREAD_CFLAGS -I${PTHREADS_INCLUDE_DIR})
+      SET(PTHREAD_CFLAGS -I${PTHREADS_INCLUDE_DIR}) # to remove
+      SET(PTHREAD_INCLUDE_DIRS ${PTHREADS_INCLUDE_DIR})
     ENDIF(PTHREADS_ROOT_USER)
     MESSAGE(STATUS "${PTHREADS_INCLUDE_TO_FIND} found in ${PTHREADS_INCLUDE_DIR}")
   ELSE(PTHREADS_INCLUDE_DIR)
index 9cfcbb35b2c51cfc79ea8d96de759862d0e087c4..d6f8e6f9ce9ee2b33a0fbd23556c63264ea51c28 100644 (file)
@@ -36,19 +36,25 @@ ENDMACRO(OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL)")
 # MYMODULE is a string that will be used to create a target with sources containing *.cc coming from the compilation of ${MYIDLFILES}
 # MYIDLFILES containing all idl files to be compiled.
 # MYIDLCXXFLAGS containing all directories (only directories) where to find *.idl which depend ${MYIDLFILES}.
-MACRO(OMNIORB_ADD_MODULE MYMODULE MYIDLFILES MYIDLCXXFLAGS)
+# TYPE contains type of the library 
+MACRO(OMNIORB_ADD_MODULE MYMODULE MYIDLFILES MYIDLCXXFLAGS TYPE)
   SET(MYSOURCES)
   FOREACH(input ${MYIDLFILES})
-    STRING(REGEX REPLACE ".idl" "" base ${input})
+    GET_FILENAME_COMPONENT(base ${input} NAME_WE)
+#    STRING(REGEX REPLACE ".idl" "" base ${input})
     SET(OMNIORB_IDLCXXFLAGS2 "${OMNIORB_IDLCXXFLAGS}")
     SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc)
     SET(MYSOURCES ${MYSOURCES} ${src})
     SET(outputs ${src})
     SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc)
+    SET(MYSOURCES ${MYSOURCES} ${dynsrc})
     SET(outputs ${outputs} ${dynsrc})
     SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
     SET(outputs ${outputs} ${inc})
-    SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+    GET_FILENAME_COMPONENT(path ${input} PATH)
+    IF(NOT path)
+      SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+    ENDIF(NOT path)
     SET(flags ${OMNIORB_IDLCXXFLAGS2})
     STRING(REGEX MATCH "-bcxx" ISBCXX ${flags})
     IF(NOT ISBCXX)
@@ -76,5 +82,6 @@ MACRO(OMNIORB_ADD_MODULE MYMODULE MYIDLFILES MYIDLCXXFLAGS)
     STRING(REPLACE "\\" "/" IDLPYFLAGS ${IDLPYFLAGS})
     INSTALL(CODE "OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL( \"${OMNIORB_IDL_PYTHON}\" \"${IDLPYFLAGS}\" \"${input}\" \"${CMAKE_INSTALL_PREFIX}/\${INSTALL_PYIDL_DIR}\" )")
   ENDFOREACH(input ${MYIDLFILES})
-  ADD_LIBRARY(${MYMODULE} SHARED ${MYSOURCES})
+  ADD_LIBRARY(${MYMODULE} ${TYPE} ${MYSOURCES})
+
 ENDMACRO(OMNIORB_ADD_MODULE)