From: ageay Date: Mon, 2 Apr 2012 13:35:04 +0000 (+0000) Subject: MED CMakization X-Git-Tag: V6_main_FINAL~692 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=be0e16032e6f9cc72b64af30990c87a3e4659455;p=tools%2Fmedcoupling.git MED CMakization --- diff --git a/src/MEDCalculator/Swig/CMakeLists.txt b/src/MEDCalculator/Swig/CMakeLists.txt index f53e94bb4..d84a70040 100644 --- a/src/MEDCalculator/Swig/CMakeLists.txt +++ b/src/MEDCalculator/Swig/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -52,4 +53,4 @@ SWIG_LINK_LIBRARIES(MEDCalculator ${PYTHON_LIBRARIES} medcalculator) FILE(GLOB medcalculatorspython_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${medcalculatorspython_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) INSTALL(TARGETS _MEDCalculator DESTINATION ${MED_salomepythondir}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDCalculator.py DESTINATION ${MED_salomescript_PYTHON}) +INSTALL_AND_COMPILE_PYTHON_FILE(${CMAKE_CURRENT_BINARY_DIR}/MEDCalculator.py ${MED_salomescript_PYTHON}) diff --git a/src/MEDCouplingCorba_Swig/CMakeLists.txt b/src/MEDCouplingCorba_Swig/CMakeLists.txt index 5bd21bb01..7c228591f 100644 --- a/src/MEDCouplingCorba_Swig/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/CMakeLists.txt @@ -19,6 +19,7 @@ ADD_SUBDIRECTORY(Client) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -43,4 +44,5 @@ SWIG_LINK_LIBRARIES(MEDCouplingCorba ${PYTHON_LIBRARIES} medcouplingcorba) SET_TARGET_PROPERTIES(_MEDCouplingCorba PROPERTIES COMPILE_FLAGS "${OMNIORB_FLAGS}") INSTALL(TARGETS _MEDCouplingCorba DESTINATION ${MED_salomepythondir}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingCorba.py DESTINATION ${MED_salomescript_PYTHON}) +SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingCorba.py) +INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON}) diff --git a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt index ed7625db1..e9ea3ad62 100644 --- a/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/Client/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -41,4 +42,5 @@ SWIG_LINK_LIBRARIES(MEDCouplingClient ${PYTHON_LIBRARIES} medcouplingclient) SET_TARGET_PROPERTIES(_MEDCouplingClient PROPERTIES COMPILE_FLAGS "${OMNIORB_FLAGS}") INSTALL(TARGETS _MEDCouplingClient DESTINATION ${MED_salomepythondir}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingClient.py DESTINATION ${MED_salomescript_PYTHON}) +SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingClient.py) +INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON}) diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index 68d930f61..7c2d405db 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -46,7 +46,7 @@ SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES SWIG_FLAGS "-shadow SWIG_ADD_MODULE(MEDCouplingRemapper python MEDCouplingRemapper.i) SWIG_LINK_LIBRARIES(MEDCouplingRemapper ${PYTHON_LIBRARIES} medcouplingremapper) -SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py) +SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDCoupling.py ${CMAKE_CURRENT_BINARY_DIR}/MEDCouplingRemapper.py ${CMAKE_CURRENT_SOURCE_DIR}/libMEDCoupling_Swig.py) INSTALL(TARGETS _MEDCoupling _MEDCouplingRemapper DESTINATION ${MED_salomepythondir}) INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON}) diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index ab9ce5673..f964f784f 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -17,6 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) + FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -47,7 +49,8 @@ INCLUDE_DIRECTORIES( ) INSTALL(TARGETS _MEDLoader DESTINATION ${MED_salomepythondir}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py DESTINATION ${MED_salomescript_PYTHON}) +SET(PYFILES_TO_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py ${CMAKE_CURRENT_SOURCE_DIR}/libMEDLoader_Swig.py) +INSTALL_AND_COMPILE_PYTHON_FILE("${PYFILES_TO_INSTALL}" ${MED_salomescript_PYTHON}) ADD_TEST(MEDLoaderTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest.py) ADD_TEST(MEDLoaderTest2 ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDLoaderTest2.py) diff --git a/src/MEDSPLITTER_Swig/CMakeLists.txt b/src/MEDSPLITTER_Swig/CMakeLists.txt index 11e5fa9e9..1d7c5da96 100644 --- a/src/MEDSPLITTER_Swig/CMakeLists.txt +++ b/src/MEDSPLITTER_Swig/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -43,3 +44,5 @@ SWIG_LINK_LIBRARIES(libMEDSPLITTER_Swig ${PYTHON_LIBRARIES} medsplittercpp) INSTALL(TARGETS _libMEDSPLITTER_Swig DESTINATION ${MED_salomepythondir}) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libMEDSPLITTER_Swig.py MEDSPLITTER.py test_MEDSPLITTER.py DESTINATION ${MED_salomescript_PYTHON}) +INSTALL_AND_COMPILE_PYTHON_FILE(${CMAKE_CURRENT_SOURCE_DIR}/MEDSPLITTER.py ${MED_salomescript_PYTHON}) + diff --git a/src/MedClient/src/CMakeLists.txt b/src/MedClient/src/CMakeLists.txt index 35521bf12..42cf612ee 100644 --- a/src/MedClient/src/CMakeLists.txt +++ b/src/MedClient/src/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -61,7 +62,7 @@ SWIG_ADD_MODULE(libMEDClient python libMEDClient.i) SWIG_LINK_LIBRARIES(libMEDClient ${PYTHON_LIBRARIES} MEDClientcmodule) SET_TARGET_PROPERTIES(_libMEDClient PROPERTIES COMPILE_FLAGS "${OMNIORB_FLAGS} ${HDF5_FLAGS} ${MED3_FLAGS} ${XDR_FLAGS}") INSTALL(TARGETS _libMEDClient DESTINATION ${MED_salomepythondir}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libMEDClient.py DESTINATION ${MED_salomescript_PYTHON}) +INSTALL_AND_COMPILE_PYTHON_FILE(${CMAKE_CURRENT_BINARY_DIR}/libMEDClient.py ${MED_salomescript_PYTHON}) FILE(GLOB libMEDClient_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${libMEDClient_HEADERS_HXX} FIELDClient.cxx DESTINATION ${MED_salomeinclude_HEADERS}) diff --git a/src/MedClient/test/test2/CMakeLists.txt b/src/MedClient/test/test2/CMakeLists.txt index db2f6734d..fef9b76b1 100644 --- a/src/MedClient/test/test2/CMakeLists.txt +++ b/src/MedClient/test/test2/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -47,7 +48,7 @@ SWIG_ADD_MODULE(libCompo2 python libCompo2.i Compo2.cxx) SWIG_LINK_LIBRARIES(libCompo2 ${PYTHON_LIBRARIES} MEDClientcmodule) SET_TARGET_PROPERTIES(_libCompo2 PROPERTIES COMPILE_FLAGS "${OMNIORB_FLAGS} ${HDF5_FLAGS} ${MED3_FLAGS} ${XDR_FLAGS}") INSTALL(TARGETS _libCompo2 DESTINATION ${MED_salomepythondir}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libCompo2.py DESTINATION ${MED_salomescript_PYTHON}) +INSTALL_AND_COMPILE_PYTHON_FILE(${CMAKE_CURRENT_BINARY_DIR}/libCompo2.py ${MED_salomescript_PYTHON}) FILE(GLOB libCompo2_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${libCompo2_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) diff --git a/src/ParaMEDMEM_Swig/CMakeLists.txt b/src/ParaMEDMEM_Swig/CMakeLists.txt index b1d1c390b..597325503 100644 --- a/src/ParaMEDMEM_Swig/CMakeLists.txt +++ b/src/ParaMEDMEM_Swig/CMakeLists.txt @@ -17,6 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/InstallAndCompilePythonFile.cmake) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) @@ -45,7 +46,4 @@ SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_FLAGS "-shadow") INSTALL(TARGETS _ParaMEDMEM DESTINATION ${MED_salomepythondir}) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ParaMEDMEM.py DESTINATION ${MED_salomescript_PYTHON}) - -ADD_TEST(MEDCouplingBasicsTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingBasicsTest.py) -ADD_TEST(MEDCouplingRemapperTest ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/MEDCouplingRemapperTest.py) +INSTALL_AND_COMPILE_PYTHON_FILE(${CMAKE_CURRENT_BINARY_DIR}/ParaMEDMEM.py ${MED_salomescript_PYTHON})