From: rnv Date: Wed, 29 Aug 2018 11:38:28 +0000 (+0300) Subject: SALOME 9.1.0 Windows version X-Git-Tag: V2_4_1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Frnv%2Fwindows_9.1.0;p=tools%2Flibbatch.git SALOME 9.1.0 Windows version --- diff --git a/CMakeModules/FindLibbatchPython.cmake b/CMakeModules/FindLibbatchPython.cmake index 8efdef4..7a719c8 100644 --- a/CMakeModules/FindLibbatchPython.cmake +++ b/CMakeModules/FindLibbatchPython.cmake @@ -88,6 +88,7 @@ IF (PYTHONINTERP_FOUND) IF(WIN32) LIST(APPEND CMAKE_LIBRARY_PATH "${_python_dir}/libs" ABSOLUTE) LIST(APPEND CMAKE_INCLUDE_PATH "${_python_dir}/include" ABSOLUTE) + SET(PYTHON_INCLUDE_DIR "${_python_dir}/include") ENDIF() # Override the EXACT and VERSION settings of the LibbatchPython module # to force the next call to SALOME_FIND_PACKAGE() to find the exact matching diff --git a/CMakeModules/FindLibbatchSWIG.cmake b/CMakeModules/FindLibbatchSWIG.cmake index 99529fc..2f0032f 100644 --- a/CMakeModules/FindLibbatchSWIG.cmake +++ b/CMakeModules/FindLibbatchSWIG.cmake @@ -23,5 +23,9 @@ # # !! Please read the generic detection procedure in libbatchMacros.cmake !! # -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2) +IF(WIN32) + SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 1) +ELSE() + SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2) +ENDIF() MARK_AS_ADVANCED(SWIG_EXECUTABLE SWIG_VERSION) diff --git a/CMakeModules/FindPThread.cmake b/CMakeModules/FindPThread.cmake index db09833..c27436b 100644 --- a/CMakeModules/FindPThread.cmake +++ b/CMakeModules/FindPThread.cmake @@ -46,12 +46,7 @@ ENDIF () IF(WIN32) SET(PTHREADS_INCLUDE_TO_FIND pthread.h) FIND_PATH(PTHREAD_INCLUDE_DIR ${PTHREADS_INCLUDE_TO_FIND}) - # Default build type is assumed to be Release: - IF(NOT CMAKE_BUILD_TYPE STREQUAL Debug) - FIND_LIBRARY(PTHREAD_LIBRARY pthreadVC2) - ELSE() - FIND_LIBRARY(PTHREAD_LIBRARY pthreadVC2d) - ENDIF() + FIND_LIBRARY(PTHREAD_LIBRARY pthreadVC2 pthreadVC2d) ELSE(WIN32) FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h) FIND_LIBRARY(PTHREAD_LIBRARY NAMES pthread) diff --git a/src/Python/CMakeLists.txt b/src/Python/CMakeLists.txt index 97ead09..81aecff 100644 --- a/src/Python/CMakeLists.txt +++ b/src/Python/CMakeLists.txt @@ -26,9 +26,12 @@ INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(SWIG_SRC_FILE libBatch_Swig.i) -SET(SWIG_LB_DPYS + +SET(SWIG_EXTAR_DEPS libBatch_Swig_exception.i libBatch_Swig_typemap.i + ) +SET(SWIG_LB_DPYS ../Core/Defines.hxx ../Core/Constants.hxx ../Core/Job.hxx @@ -39,17 +42,22 @@ SET(SWIG_LB_DPYS ../Core/BatchManagerCatalog.hxx ../Core/FactBatchManager.hxx ) - -SET_SOURCE_FILES_PROPERTIES(${SWIG_SRC_FILE} PROPERTIES CPLUSPLUS ON +IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") + SET_SOURCE_FILES_PROPERTIES(${SWIG_SRC_FILE} PROPERTIES CPLUSPLUS ON SWIG_FLAGS "-py3") -# SWIG source file and module name differ - the following needs to be -# set to avoid unnecessary rebuilds: -SET_SOURCE_FILES_PROPERTIES(${SWIG_SRC_FILE} PROPERTIES SWIG_MODULE_NAME libbatch) + # SWIG source file and module name differ - the following needs to be + # set to avoid unnecessary rebuilds: + SET_SOURCE_FILES_PROPERTIES(${SWIG_SRC_FILE} PROPERTIES SWIG_MODULE_NAME libbatch) -SET(SWIG_MODULE_libbatch_EXTRA_DEPS ${SWIG_LB_DPYS}) -SWIG_ADD_MODULE(libbatch python ${SWIG_SRC_FILE}) + SET(SWIG_MODULE_libbatch_EXTRA_DEPS ${SWIG_EXTAR_DEPS} ${SWIG_LB_DPYS}) + SWIG_ADD_MODULE(libbatch python ${SWIG_SRC_FILE}) +ELSE() + SET(CMAKE_SWIG_FLAGS "-py3") + SET_PROPERTY(SOURCE ${SWIG_SRC_FILE} PROPERTY CPLUSPLUS ON) + SET(SWIG_MODULE_libbatch_EXTRA_DEPS ${SWIG_EXTAR_DEPS}) + SWIG_ADD_LIBRARY(libbatch LANGUAGE python SOURCES ${SWIG_LB_DPYS} ${SWIG_SRC_FILE}) +ENDIF() SWIG_LINK_LIBRARIES(libbatch batch ${PYTHON_LIBRARIES}) - INSTALL(TARGETS ${SWIG_MODULE_libbatch_REAL_NAME} DESTINATION ${LIBBATCH_PYTHONPATH}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbatch.py DESTINATION ${LIBBATCH_PYTHONPATH})