]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Creation of SOLVERLAB python module
authormichael <michael@localhost.localdomain>
Sat, 30 Oct 2021 20:47:57 +0000 (22:47 +0200)
committermichael <michael@localhost.localdomain>
Sat, 30 Oct 2021 20:47:57 +0000 (22:47 +0200)
CoreFlows/swig/CMakeLists.txt

index 9302ecac7abebbfaea6075cf1ce83089b85e5f23..71cfdbb9e571d0a671a5a081e54b2cef7db8a453 100755 (executable)
@@ -11,16 +11,36 @@ INCLUDE_DIRECTORIES(
   ${SLEPC_INCLUDES}
 )
 
-SET(_extra_lib_SWIG ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})   
-
 IF   (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
   SWIG_ADD_MODULE(CoreFlows python CoreFlows.i)
 ELSE (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
   SWIG_ADD_LIBRARY(CoreFlows TYPE SHARED LANGUAGE python SOURCES CoreFlows.i)
 ENDIF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
 
-SWIG_LINK_LIBRARIES(CoreFlows ${Python_LIBRARIES} ${_extra_lib_SWIG} CoreFlowsLibs ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
+SWIG_LINK_LIBRARIES(CoreFlows ${Python_LIBRARIES} ${CDMATH_LIBRARIES} CoreFlowsLibs ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
 
 INSTALL(TARGETS _CoreFlows DESTINATION lib/coreflows)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CoreFlows.py DESTINATION bin/coreflows)
 INSTALL(FILES ${CoreFlows_SOURCE_DIR}/mainCoreFlows.py DESTINATION bin/)
+
+if(    SOLVERLAB_WITH_PYTHON )
+  INCLUDE_DIRECTORIES(
+    ${Python_INCLUDE_DIRS}
+    ${PROJECT_BINARY_DIR}/../CDMATH/swig                                                                                           #    
+  )
+
+  file(COPY solverlab.i DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+  SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/solverlab.i PROPERTIES CPLUSPLUS ON)
+  SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/solverlab.i PROPERTIES C OFF)
+  SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/solverlab.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+  SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/solverlab.i PROPERTIES DEPENDS _cdmath)
+  SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/solverlab.i PROPERTIES DEPENDS _CoreFlows)
+
+  SWIG_ADD_LIBRARY(solverlab TYPE SHARED LANGUAGE python SOURCES ${CMAKE_CURRENT_BINARY_DIR}/solverlab.i )
+  SWIG_LINK_LIBRARIES(solverlab ${Python_LIBRARIES} ${CDMATH_LIBRARIES} CoreFlowsLibs ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
+
+  INSTALL(TARGETS _solverlab DESTINATION lib)
+  INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/solverlab.py DESTINATION bin)
+endif( SOLVERLAB_WITH_PYTHON )
+
+