From: bruneton Date: Thu, 21 Mar 2013 15:06:12 +0000 (+0000) Subject: Enhanced SWIG dependencies: should now take into account most of the relevant C+... X-Git-Tag: V6_main_FINAL~254 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=48ca18f64b2992aac862e7a73597ebed5dd7ea54;p=tools%2Fmedcoupling.git Enhanced SWIG dependencies: should now take into account most of the relevant C++ headers. --- diff --git a/src/INTERP_KERNEL/CMakeLists.txt b/src/INTERP_KERNEL/CMakeLists.txt index ae70ca322..a797faaff 100644 --- a/src/INTERP_KERNEL/CMakeLists.txt +++ b/src/INTERP_KERNEL/CMakeLists.txt @@ -79,3 +79,7 @@ INSTALL(TARGETS interpkernel DESTINATION ${MED_salomelib_LIBS}) FILE(GLOB_RECURSE interpkernel_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") FILE(GLOB_RECURSE interpkernel_HEADERS_TXX "${CMAKE_CURRENT_SOURCE_DIR}/*.txx") INSTALL(FILES ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX} DESTINATION ${MED_salomeinclude_HEADERS}) + +# Will be used for SWIG dependencies: +SET (interpkernel_HEADERS_HXX PARENT_SCOPE) +SET (interpkernel_HEADERS_TXX PARENT_SCOPE) diff --git a/src/MEDCoupling/CMakeLists.txt b/src/MEDCoupling/CMakeLists.txt index 23e624b5a..03e362515 100644 --- a/src/MEDCoupling/CMakeLists.txt +++ b/src/MEDCoupling/CMakeLists.txt @@ -71,3 +71,7 @@ INSTALL(TARGETS medcouplingremapper DESTINATION ${MED_salomelib_LIBS}) FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") FILE(GLOB medcoupling_HEADERS_TXX "${CMAKE_CURRENT_SOURCE_DIR}/*.txx") INSTALL(FILES ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} DESTINATION ${MED_salomeinclude_HEADERS}) + +# To allow usage as SWIG dependencies: +SET(medcoupling_HEADERS_HXX PARENT_SCOPE) +SET(medcoupling_HEADERS_TXX PARENT_SCOPE) diff --git a/src/MEDCouplingCorba/CMakeLists.txt b/src/MEDCouplingCorba/CMakeLists.txt index 7b0b7bb52..7d2e99b64 100644 --- a/src/MEDCouplingCorba/CMakeLists.txt +++ b/src/MEDCouplingCorba/CMakeLists.txt @@ -59,3 +59,6 @@ INSTALL(TARGETS medcouplingcorba DESTINATION ${MED_salomelib_LIBS}) FILE(GLOB medcouplingcorba_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${medcouplingcorba_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) + +# To allow usage as SWIG dependencies: +SET(medcouplingcorba_HEADERS_HXX PARENT_SCOPE) diff --git a/src/MEDCouplingCorba_Swig/CMakeLists.txt b/src/MEDCouplingCorba_Swig/CMakeLists.txt index 78a20f1e0..99ed4233d 100644 --- a/src/MEDCouplingCorba_Swig/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/CMakeLists.txt @@ -27,6 +27,9 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET(MEDCouplingCorba_SWIG_DPYS_FILES + MEDCouplingCorbaTypemaps.i) + INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} ${OMNIORB_INCLUDE_DIRS} @@ -40,6 +43,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases ) +# _ABR_ Ensure dependency mechanism on all SWIG files and headers +SET (SWIG_MODULE_MEDCouplingCorba_EXTRA_DEPS ${MEDCouplingCorba_SWIG_DPYS_FILES} + ${medcouplingcorba_HEADERS_HXX} + ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} + ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX}) + SWIG_ADD_MODULE(MEDCouplingCorba python MEDCouplingCorba.i) SWIG_LINK_LIBRARIES(MEDCouplingCorba ${PYTHON_LIBS} medcouplingcorba ${PLATFORM_LIBS}) SET_TARGET_PROPERTIES(_MEDCouplingCorba PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS} ${PLATFORM_DEFINITIONS}") diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index ff93d516c..94fa0b7b9 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -25,6 +25,11 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET (MEDCoupling_SWIG_DPYS_FILES + MEDCouplingCommon.i + MEDCouplingFinalize.i + MEDCouplingTypemaps.i) + INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} ${PTHREAD_INCLUDE_DIRS} # pthread dependancy due to python2.7 library @@ -39,22 +44,32 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints ) +# _ABR_ Ensure dependency mechanism on all SWIG files and headers +SET (SWIG_MODULE_MEDCoupling_EXTRA_DEPS ${MEDCoupling_SWIG_DPYS_FILES} + ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} + ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX}) + SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i) SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBS} ${PLATFORM_LIBS} medcoupling) -SET_TARGET_PROPERTIES(_MEDCoupling PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}") +SET_TARGET_PROPERTIES(${SWIG_MODULE_MEDCoupling_REAL_NAME} PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}") SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_DEFINITIONS "-shadow") +# _ABR_ Ensure dependency mechanism on all SWIG files and headers +SET (SWIG_MODULE_MEDCouplingRemapper_EXTRA_DEPS ${MEDCoupling_SWIG_DPYS_FILES} + ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} + ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX}) + SWIG_ADD_MODULE(MEDCouplingRemapper python MEDCouplingRemapper.i) SWIG_LINK_LIBRARIES(MEDCouplingRemapper ${PYTHON_LIBS} medcouplingremapper) -SET_TARGET_PROPERTIES(_MEDCouplingRemapper PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}") +SET_TARGET_PROPERTIES(${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME} PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}") IF(${MACHINE} STREQUAL WINDOWS) SET_TARGET_PROPERTIES(_MEDCouplingRemapper PROPERTIES DEBUG_OUTPUT_NAME _MEDCouplingRemapper_d) SET_TARGET_PROPERTIES(_MEDCoupling PROPERTIES DEBUG_OUTPUT_NAME _MEDCoupling_d) ENDIF(${MACHINE} STREQUAL WINDOWS) -INSTALL(TARGETS _MEDCoupling _MEDCouplingRemapper DESTINATION ${MED_salomelib_LIBS}) +INSTALL(TARGETS ${SWIG_MODULE_MEDCoupling_REAL_NAME} ${SWIG_MODULE_MEDCouplingRemapper_REAL_NAME} DESTINATION ${MED_salomelib_LIBS}) SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py ${CMAKE_CURRENT_SOURCE_DIR}/libMEDCoupling_Swig.py) INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON}) diff --git a/src/MEDLoader/CMakeLists.txt b/src/MEDLoader/CMakeLists.txt index aeca829c2..7aa06285f 100644 --- a/src/MEDLoader/CMakeLists.txt +++ b/src/MEDLoader/CMakeLists.txt @@ -55,3 +55,6 @@ INSTALL(TARGETS medloader DESTINATION ${MED_salomelib_LIBS}) FILE(GLOB medloader_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${medloader_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) + +# To allow usage as SWIG dependencies: +SET(medloader_HEADERS_HXX PARENT_SCOPE) diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index dece3560b..b3c0599de 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -26,6 +26,10 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET (MEDLoader_SWIG_DPYS_FILES + MEDLoaderCommon.i + MEDLoaderTypemaps.i) + INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} ${MED3_INCLUDE_DIRS} @@ -41,6 +45,11 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/GaussPoints ) +SET (SWIG_MODULE_MEDLoader_EXTRA_DEPS ${MEDLoader_SWIG_DPYS_FILES} + ${medloader_HEADERS_HXX} + ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} + ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX}) + SWIG_ADD_MODULE(MEDLoader python MEDLoader.i) SWIG_LINK_LIBRARIES(MEDLoader ${PYTHON_LIBS} ${PLATFORM_LIBS} medloader medcoupling) SET_TARGET_PROPERTIES(_MEDLoader PROPERTIES COMPILE_FLAGS "${PLATFORM_DEFINITIONS}") diff --git a/src/ParaMEDMEM/CMakeLists.txt b/src/ParaMEDMEM/CMakeLists.txt index 2b0bfb3b9..d9634cf60 100644 --- a/src/ParaMEDMEM/CMakeLists.txt +++ b/src/ParaMEDMEM/CMakeLists.txt @@ -66,3 +66,7 @@ INSTALL(TARGETS paramedmem DESTINATION ${MED_salomelib_LIBS}) FILE(GLOB paramedmem_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${paramedmem_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) + +# To allow usage as SWIG dependencies: +SET(paramedmem_HEADERS_HXX PARENT_SCOPE) + diff --git a/src/ParaMEDMEM_Swig/CMakeLists.txt b/src/ParaMEDMEM_Swig/CMakeLists.txt index c8e8f7a0f..105993995 100644 --- a/src/ParaMEDMEM_Swig/CMakeLists.txt +++ b/src/ParaMEDMEM_Swig/CMakeLists.txt @@ -24,6 +24,9 @@ INCLUDE(${SWIG_USE_FILE}) SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_DEFINITIONS "-shadow") +SET (ParaMEDMEM_SWIG_DPYS_FILES + ParaMEDMEM.typemap) + INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} ${MED3_INCLUDE_DIRS} @@ -39,6 +42,12 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases ) +SET (SWIG_MODULE_ParaMEDMEM_EXTRA_DEPS ${ParaMEDMEM_SWIG_DPYS_FILES} + ${paramedmem_HEADERS_HXX} + ${medloader_HEADERS_HXX} + ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} + ${interpkernel_HEADERS_HXX} ${interpkernel_HEADERS_TXX}) + SWIG_ADD_MODULE(ParaMEDMEM python ParaMEDMEM.i) SWIG_LINK_LIBRARIES(ParaMEDMEM ${PYTHON_LIBS} paramedmem medloader)