From: rnv Date: Mon, 24 Jun 2013 08:01:44 +0000 (+0000) Subject: Preparation of the SALOME7.2.0 version for win32 platform. X-Git-Tag: V2_0_0_WIN~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=467add95721cee048d9e3579c950c20a418e0d9f;p=tools%2Flibbatch.git Preparation of the SALOME7.2.0 version for win32 platform. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a629cbd..e9b6f93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt index 326c95b..a9854c2 100644 --- a/misc/CMakeLists.txt +++ b/misc/CMakeLists.txt @@ -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)