]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
To more link pywrappers to libpythonX.Y.so for Linux platform agy/for_pip_install_tianyi
authorAnthony Geay <anthony.geay@edf.fr>
Wed, 17 Jul 2019 08:47:03 +0000 (10:47 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Wed, 17 Jul 2019 08:47:03 +0000 (10:47 +0200)
src/MEDCoupling_Swig/CMakeLists.txt
src/PyWrapping/CMakeLists.txt

index ea5e8f742ac556dfef7e48e16d21b194832b44c9..8dd9feb7fe171bed64c7215d0496f98ac5b63c5a 100644 (file)
@@ -92,6 +92,7 @@ IF(WIN32)
   SET(MEDCouling_target_name MEDCouplingCompat)
   SET_PROPERTY(SOURCE MEDCoupling.i PROPERTY SWIG_MODULE_NAME MEDCouplingCompat)
   SET_PROPERTY(SOURCE MEDCoupling.i PROPERTY COMPILE_DEFINITIONS WIN32)
+  SET(SWIG_MODULE_MEDCouplingCompat_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}")
 ELSE()
   SET(MEDCouling_target_name MEDCoupling)
 ENDIF()
@@ -102,7 +103,13 @@ ELSE()
   SWIG_ADD_LIBRARY(${MEDCouling_target_name} LANGUAGE python SOURCES MEDCoupling.i)
 ENDIF()
 
-SWIG_LINK_LIBRARIES(${MEDCouling_target_name} ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp)
+IF(WIN32)
+  SWIG_LINK_LIBRARIES(${MEDCouling_target_name} ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp)
+ELSE(WIN32)
+  # ${PYTHON_LIBRARIES} not needed see https://www.python.org/dev/peps/pep-0513/#libpythonx-y-so-1
+  SWIG_LINK_LIBRARIES(${MEDCouling_target_name} ${PLATFORM_LIBS} medcouplingcpp)
+ENDIF(WIN32)
+# ${PYTHON_LIBRARIES} not needed
 SWIG_CHECK_GENERATION(${MEDCouling_target_name})
 SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON)
 IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3")
@@ -124,7 +131,12 @@ ELSE()
   SWIG_ADD_LIBRARY(MEDCouplingRemapper LANGUAGE python SOURCES MEDCouplingRemapper.i)
 ENDIF()
 
-SWIG_LINK_LIBRARIES(MEDCouplingRemapper ${PYTHON_LIBRARIES} medcouplingremapper)
+IF(WIN32)
+  SWIG_LINK_LIBRARIES(MEDCouplingRemapper ${PYTHON_LIBRARIES} medcouplingremapper)
+ELSE(WIN32)
+  # ${PYTHON_LIBRARIES} not needed see https://www.python.org/dev/peps/pep-0513/#libpythonx-y-so-1
+  SWIG_LINK_LIBRARIES(MEDCouplingRemapper medcouplingremapper)
+ENDIF(WIN32)
 
 IF(WIN32)
   SET_TARGET_PROPERTIES(_MEDCouplingRemapper PROPERTIES DEBUG_OUTPUT_NAME _MEDCouplingRemapper_d)
index da2744526364be45a34beb7132d8ce1a1ece34c3..56c928ff391617f5e87176ad458a07f956414294 100644 (file)
@@ -58,8 +58,13 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_BINARY_DIR}/doc
   )
 
-SET(medcoupling_LIB_dependancies ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingremapper)
-
+IF(WIN32)
+  SET(medcoupling_LIB_dependancies ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingremapper)
+ELSE(WIN32)
+  # ${PYTHON_LIBRARIES} not needed see https://www.python.org/dev/peps/pep-0513/#libpythonx-y-so-1
+  SET(medcoupling_LIB_dependancies ${PLATFORM_LIBS} medcouplingremapper)
+ENDIF(WIN32)
+  
 IF(NOT MEDCOUPLING_MICROMED)
   LIST(APPEND SWIG_MODULE_medcoupling_EXTRA_FLAGS -DWITH_MED_FILE)
   LIST(APPEND medcoupling_LIB_dependancies medloader)