]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
Preparation of the SALOME7.2.0 version for win32 platform.
authorrnv <rnv@opencascade.com>
Mon, 24 Jun 2013 08:01:44 +0000 (08:01 +0000)
committerrnv <rnv@opencascade.com>
Mon, 24 Jun 2013 08:01:44 +0000 (08:01 +0000)
CMakeLists.txt
misc/CMakeLists.txt

index a629cbd3bdd6361fb0976bab21f11b45e4a5612d..e9b6f933a6618e0514464bcb6e07e61319cea5a2 100644 (file)
@@ -45,7 +45,21 @@ IF (BUILD_PYTHON_WRAPPING)
         get_filename_component(CMAKE_INCLUDE_PATH "${PYTHON_BIN_DIR}/../include/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}" ABSOLUTE)
         get_filename_component(CMAKE_LIBRARY_PATH "${PYTHON_BIN_DIR}/../lib" ABSOLUTE)
     ENDIF (PYTHONINTERP_FOUND)
-    FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
+    # Set PythonLibs_FIND_VERSION To avoid problems when several versions are in the system
+    SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING})
+    set(PYTHON_ROOT_DIR $ENV{PYTHON_ROOT_DIR} CACHE PATH "Path to Python directory")
+    if(EXISTS ${PYTHON_ROOT_DIR})
+      if(WINDOWS)
+        if(CMAKE_BUILD_TYPE STREQUAL Debug)
+          SET(PYTHON_LIB_SUFFIX _d)
+        else(CMAKE_BUILD_TYPE STREQUAL Debug)
+          SET(PYTHON_LIB_SUFFIX)   
+        endif(CMAKE_BUILD_TYPE STREQUAL Debug)
+        set(PYTHON_INCLUDE_DIR ${PYTHON_ROOT_DIR}/include)
+        set(PYTHON_LIBRARY ${PYTHON_ROOT_DIR}/libs/python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}${PYTHON_LIB_SUFFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
+      endif(WINDOWS)
+    endif(EXISTS ${PYTHON_ROOT_DIR})
+    FIND_PACKAGE(PythonLibs)
     FIND_PACKAGE(SWIG)
 ENDIF (BUILD_PYTHON_WRAPPING)
 
index 326c95b35c1fc68d478fce9b06e31a077ca7c92e..a9854c20de5bf8ed30abbb8a9727b5586be79e47 100644 (file)
@@ -24,7 +24,9 @@ INSTALL(FILES check_libbatch.m4
         DESTINATION share/libbatch/misc)
 
 GET_TARGET_PROPERTY(LIBBATCH_ABS_PATH batch LOCATION)
-GET_FILENAME_COMPONENT(LIBBATCH_REAL_NAME ${LIBBATCH_ABS_PATH} NAME)
+GET_FILENAME_COMPONENT(LIBBATCH_REAL_NAME ${LIBBATCH_ABS_PATH} NAME_WE)
+#To avoid wrong extension on Windows
+SET(LIBBATCH_REAL_NAME ${LIBBATCH_REAL_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX})
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libbatchConfig.cmake.in
                ${CMAKE_CURRENT_BINARY_DIR}/libbatchConfig.cmake @ONLY)