]> SALOME platform Git repositories - tools/libbatch.git/commitdiff
Salome HOME
SALOME 9.1.0 Windows version rnv/windows_9.1.0
authorrnv <rnv@opencascade.com>
Wed, 29 Aug 2018 11:38:28 +0000 (14:38 +0300)
committerrnv <rnv@opencascade.com>
Wed, 29 Aug 2018 11:38:28 +0000 (14:38 +0300)
CMakeModules/FindLibbatchPython.cmake
CMakeModules/FindLibbatchSWIG.cmake
CMakeModules/FindPThread.cmake
src/Python/CMakeLists.txt

index 8efdef4a92186b6c317cddc49757d7d953659c26..7a719c8d65932dcda6ffcf4a19ffcfeaa19dc5c2 100644 (file)
@@ -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
index 99529fcc380bfe70f89a7d5bbbd62e0c7571d3c2..2f0032feb4ef3304598b346fc6ca2aeb85c38555 100644 (file)
@@ -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)
index db0983304c4d80a71f178ec9b3d199b41fdf08c9..c27436b820b2ed88f5a5bc9915bd60496f932594 100644 (file)
@@ -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)
index 97ead0943f89f57a8c25c9ac49ae3a8aa43491f1..81aecffa79cfbd1302fc449b3cb9c07e53d62066 100644 (file)
@@ -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})