]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Simplified the swig Makefiles
authorndjinga <michael.ndjinga@cea.fr>
Wed, 30 Sep 2020 13:08:29 +0000 (15:08 +0200)
committerndjinga <michael.ndjinga@cea.fr>
Wed, 30 Sep 2020 13:08:29 +0000 (15:08 +0200)
CDMATH/swig/CMakeLists.txt
CoreFlows/CMakeLists.txt
CoreFlows/Models/src/CMakeLists.txt
CoreFlows/examples/C/CMakeLists.txt
CoreFlows/swig/CMakeLists.txt

index c153857677a5f7cb4d47fd1f49c82ec9ac2ffd9b..924fe3dcdbb4482c4405b531f0652efdd5e9a8f2 100755 (executable)
@@ -15,16 +15,16 @@ if (CDMATH_WITH_PETSC)
       ${LINEARSOLVER_DIR}/inc
     )
     SET(_extra_lib_SWIG linearsolver ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
-    file(COPY cdmath_with_petsc.i DESTINATION ${CMAKE_BINARY_DIR}/swig)
-    file(RENAME ${CMAKE_BINARY_DIR}/swig/cdmath_with_petsc.i ${CMAKE_BINARY_DIR}/swig/cdmath.i)
+    file(COPY cdmath_with_petsc.i DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+    file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/cdmath_with_petsc.i ${CMAKE_CURRENT_BINARY_DIR}/cdmath.i)
 else (CDMATH_WITH_PETSC)
-    file(COPY cdmath_without_petsc.i DESTINATION ${CMAKE_BINARY_DIR}/swig)
-    file(RENAME ${CMAKE_BINARY_DIR}/swig/cdmath_without_petsc.i ${CMAKE_BINARY_DIR}/swig/cdmath.i)
+    file(COPY cdmath_without_petsc.i DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
+    file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/cdmath_without_petsc.i ${CMAKE_CURRENT_BINARY_DIR}/cdmath.i)
 endif (CDMATH_WITH_PETSC)
 
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/swig/cdmath.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/swig/cdmath.i PROPERTIES C OFF)
-SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/swig/cdmath.i PROPERTIES SWIG_DEFINITIONS "-shadow")
+SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/cdmath.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/cdmath.i PROPERTIES C OFF)
+SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/cdmath.i PROPERTIES SWIG_DEFINITIONS "-shadow")
 
 #Trying to remove warnings due to cmake policies cmp0078 and cmp0086
 IF   (${CMAKE_VERSION} VERSION_GREATER "3.13.0")
@@ -35,9 +35,9 @@ IF   (${CMAKE_VERSION} VERSION_GREATER "3.13.0")
 ENDIF(${CMAKE_VERSION} VERSION_GREATER "3.13.0")
 
 IF   (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
-  SWIG_ADD_MODULE(cdmath python ${CMAKE_BINARY_DIR}/swig/cdmath.i)
+  SWIG_ADD_MODULE(cdmath python ${CMAKE_CURRENT_BINARY_DIR}/cdmath.i)
 ELSE (${CMAKE_VERSION} VERSION_LESS "3.8.0") 
-  SWIG_ADD_LIBRARY(cdmath TYPE SHARED LANGUAGE python SOURCES ${CMAKE_BINARY_DIR}/swig/cdmath.i)
+  SWIG_ADD_LIBRARY(cdmath TYPE SHARED LANGUAGE python SOURCES ${CMAKE_CURRENT_BINARY_DIR}/cdmath.i)
 ENDIF(${CMAKE_VERSION} VERSION_LESS "3.8.0")
  
 SWIG_LINK_LIBRARIES(cdmath ${Python_LIBRARIES} base mesh ${medloader} ${medcoupling} ${_extra_lib_SWIG})
index 9f3a45c9a7a3e6526f0c486608a3ebe93963d6a8..64e8fee4dc7014704a48b0e6ba11f088ef75e54b 100755 (executable)
@@ -109,7 +109,7 @@ SET(MAIN_SOURCES                                                                                        #
 SET(_extra_lib_CoreFlows ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} )                                          #
 ADD_EXECUTABLE(CoreFlowsMainExe ${MAIN_SOURCES})                                                           #
 SET_TARGET_PROPERTIES(CoreFlowsMainExe PROPERTIES COMPILE_FLAGS "")                                        #
-TARGET_LINK_LIBRARIES(CoreFlowsMainExe CoreFlows  ${_extra_lib_CoreFlows})                                 #
+TARGET_LINK_LIBRARIES(CoreFlowsMainExe CoreFlowsLibs  ${_extra_lib_CoreFlows})                             #
 INSTALL(TARGETS CoreFlowsMainExe DESTINATION bin)                                                  #
                                                                                                            #
 configure_file(
index f07e759637a1d7f3e65dbc614a2a47075a5e0913..ce2f4206be31f359ca3dda6f517909e1d72b6a06 100755 (executable)
@@ -20,7 +20,7 @@ SET(src_models_CXX
     utilitaire_algebre.cxx
   )
 
-ADD_LIBRARY(CoreFlows SHARED ${src_models_CXX})
-target_link_libraries(CoreFlows ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
+ADD_LIBRARY(CoreFlowsLibs SHARED ${src_models_CXX})
+target_link_libraries(CoreFlowsLibs ${CDMATH_LIBRARIES} ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
 
-INSTALL(TARGETS CoreFlows DESTINATION lib)
+INSTALL(TARGETS CoreFlowsLibs DESTINATION lib)
index 4d73610dc7d39ed2d2ea3abb9ae59ed348568de4..d9a5aa4cf06594631a4db9f4be9283cac3ea2960 100755 (executable)
@@ -7,7 +7,7 @@ INCLUDE_DIRECTORIES(
 )
 
 
-SET(_extra_lib_CoreFlows CoreFlows ${PETSC_LIBRARIES} ${CDMATH_LIBRARIES})
+SET(_extra_lib_CoreFlows CoreFlowsLibs )
 
 
 if(CMAKE_COMPILER_IS_GNUCXX)
index a722c8f1eaae243a6598685769fadbb818218a34..9302ecac7abebbfaea6075cf1ce83089b85e5f23 100755 (executable)
@@ -13,9 +13,13 @@ INCLUDE_DIRECTORIES(
 
 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_ADD_MODULE(CoreFlows python CoreFlows.i)
-SWIG_LINK_LIBRARIES(CoreFlows ${Python_LIBRARIES} ${_extra_lib_SWIG} CoreFlows ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
+SWIG_LINK_LIBRARIES(CoreFlows ${Python_LIBRARIES} ${_extra_lib_SWIG} CoreFlowsLibs ${PETSC_LIBRARIES} ${SLEPC_LIBRARIES})
 
 INSTALL(TARGETS _CoreFlows DESTINATION lib/coreflows)
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CoreFlows.py DESTINATION bin/coreflows)