]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Compatibility release compilation on windows
authoradam <adam>
Fri, 27 Feb 2009 16:45:32 +0000 (16:45 +0000)
committeradam <adam>
Fri, 27 Feb 2009 16:45:32 +0000 (16:45 +0000)
salome_adm/cmake_files/FindHDF5.cmake
salome_adm/cmake_files/FindPLATFORM.cmake
salome_adm/cmake_files/FindPTHREADS.cmake
salome_adm/cmake_files/FindPYTHON.cmake
salome_adm/cmake_files/am2cmake.py

index c0f0a60c1b38d5bd249c2ab8bf5fd3185bf3df6b..27b784a830a6b014682c60ffc739764c1c57359f 100644 (file)
@@ -29,7 +29,11 @@ FIND_PATH(HDF5_INCLUDES H5public.h ${HDF5_ROOT}/include)
 SET(HDF5_INCLUDES -I${HDF5_INCLUDES})
 
 IF(WINDOWS)
-  FIND_LIBRARY(HDF5_LIBS hdf5d ${HDF5_ROOT}/lib)
+  IF(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_LIBRARY(HDF5_LIBS hdf5 ${HDF5_ROOT}/lib)
+  ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_LIBRARY(HDF5_LIBS hdf5d ${HDF5_ROOT}/lib)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
 ELSE(WINDOWS)
   FIND_LIBRARY(HDF5_LIBS hdf5 ${HDF5_ROOT}/lib)
 ENDIF(WINDOWS)
index 068623d19f7c70fc2c0162304fcde180ebecc949..28fd28803bea33df1d5b15a7d82f7833fcb4e8f3 100644 (file)
@@ -42,6 +42,21 @@ ELSE(WINDOWS)
   #  SET(RM /bin/rm)
 ENDIF(WINDOWS)
 
+IF(WINDOWS)
+  SET(CMAKE_BUILD_TYPE $ENV{CMAKE_BUILD_TYPE})
+  IF(CMAKE_BUILD_TYPE STREQUAL Release)
+    MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES)
+    SET(CMAKE_CONFIGURATION_TYPES Release CACHE STRING "compilation types" FORCE)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
+ENDIF(WINDOWS)
+
+IF(WINDOWS)
+  SET(CMAKE_INSTALL_PREFIX_ENV $ENV{CMAKE_INSTALL_PREFIX})
+  IF(CMAKE_INSTALL_PREFIX_ENV)
+    SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX_ENV} CACHE PATH "installation prefix" FORCE)
+  ENDIF(CMAKE_INSTALL_PREFIX_ENV)
+ENDIF(WINDOWS)
+
 ## SET(PLATFORM_CPPFLAGS ${PLATFORM_CPPFLAGS} -D_DEBUG_)
 
 #SET(RCP rcp)
index 0fe504c3fa2600f3d2d7f06ca4da2f6ff3bcd309..514f2ed52b1cab801d04bc7b4ab2a62249303725 100644 (file)
@@ -25,5 +25,9 @@ IF(PTHREADS_ROOT)
   IF(PTHREADS_INCLUDE_DIR)
     SET(PTHREADS_INCLUDES -I${PTHREADS_INCLUDE_DIR})
   ENDIF(PTHREADS_INCLUDE_DIR)
-  FIND_LIBRARY(PTHREADS_LIBRARY pthreadVSE2d ${PTHREADS_ROOT}/lib)
+  IF(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_LIBRARY(PTHREADS_LIBRARY pthreadVSE2 ${PTHREADS_ROOT}/lib)
+  ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_LIBRARY(PTHREADS_LIBRARY pthreadVSE2d ${PTHREADS_ROOT}/lib)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
 ENDIF(PTHREADS_ROOT)
index 4b84d7c58db65f88d500b219004fcc33fb1708a2..d97820a0a2455f459b1d864391dc0ed5ca529dea 100644 (file)
 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 IF(WINDOWS)
-  FIND_PROGRAM(PYTHON_EXECUTABLE python_d)
+  IF(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_PROGRAM(PYTHON_EXECUTABLE python)
+  ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_PROGRAM(PYTHON_EXECUTABLE python_d)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
 ELSE(WINDOWS)
   FIND_PROGRAM(PYTHON_EXECUTABLE python)
 ENDIF(WINDOWS)
@@ -38,7 +42,11 @@ FIND_PATH(PYTHON_INCLUDE_PATH Python.h PATHS ${PYTHON_ROOT}/include ${PYTHON_ROO
 
 IF(WINDOWS)
   STRING(REPLACE "." "" PYTHON_VERSION_WITHOUT_DOT ${PYTHON_VERSION})
-  FIND_LIBRARY(PYTHON_LIBRARIES python${PYTHON_VERSION_WITHOUT_DOT}_d ${PYTHON_ROOT}/libs)
+  IF(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_LIBRARY(PYTHON_LIBRARIES python${PYTHON_VERSION_WITHOUT_DOT} ${PYTHON_ROOT}/libs)
+  ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+    FIND_LIBRARY(PYTHON_LIBRARIES python${PYTHON_VERSION_WITHOUT_DOT}_d ${PYTHON_ROOT}/libs)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
 ELSE(WINDOWS)
   FIND_LIBRARY(PYTHON_LIBRARIES python${PYTHON_VERSION} ${PYTHON_ROOT}/lib)
 ENDIF(WINDOWS)
@@ -47,5 +55,8 @@ SET(PYTHON_INCLUDES -I${PYTHON_INCLUDE_PATH})
 SET(PYTHON_LIBS ${PYTHON_LIBRARIES})
 
 IF(WINDOWS)
-  SET(PYTHON_INCLUDES ${PYTHON_INCLUDES} -DHAVE_DEBUG_PYTHON)
+  IF(CMAKE_BUILD_TYPE STREQUAL Release)
+  ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
+    SET(PYTHON_INCLUDES ${PYTHON_INCLUDES} -DHAVE_DEBUG_PYTHON)
+  ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
 ENDIF(WINDOWS)
index 69108a07c4b3ba39b156e670466f2738ef54ee97..31a7fd1631091e72792a4f9aa4daf698c4cfd7c9 100644 (file)
@@ -1090,7 +1090,11 @@ class CMakeFile(object):
         SET(targets ${targets} medimportcxx)
         FOREACH(target ${targets})
         IF(name STREQUAL ${target})
+        IF(CMAKE_BUILD_TYPE STREQUAL Release)
+        SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMT")
+        ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
         SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBCMTD")
+        ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
         ENDIF(name STREQUAL ${target})
         ENDFOREACH(target ${targets})
         SET(targets)
@@ -1472,7 +1476,11 @@ class CMakeFile(object):
             ELSE(BEGIN_WITH_lib)
             IF(WINDOWS)
             INSTALL(TARGETS ${name} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome)
+            IF(CMAKE_BUILD_TYPE STREQUAL Release)
+            INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.pyd)
+            ELSE(CMAKE_BUILD_TYPE STREQUAL Release)
             INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}_d.pyd)
+            ENDIF(CMAKE_BUILD_TYPE STREQUAL Release)
             ELSE(WINDOWS)
             GET_TARGET_PROPERTY(version ${name} VERSION)
             GET_TARGET_PROPERTY(soversion ${name} SOVERSION)