From: ageay Date: Wed, 21 Mar 2012 17:39:24 +0000 (+0000) Subject: Cmakization of MED. X-Git-Tag: V6_main_FINAL~757 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c70e6906c1ad878ed0df2fc8219213502cf0de8f;p=tools%2Fmedcoupling.git Cmakization of MED. --- diff --git a/src/MEDCalculator/CMakeLists.txt b/src/MEDCalculator/CMakeLists.txt new file mode 100644 index 000000000..3ad68037f --- /dev/null +++ b/src/MEDCalculator/CMakeLists.txt @@ -0,0 +1,55 @@ +# Copyright (C) 2007-2011 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +ADD_SUBDIRECTORY(Swig) +ADD_SUBDIRECTORY(Test) + +INCLUDE_DIRECTORIES( + ${MED3_INCLUDES_DIR} + ${HDF5_INCLUDES_DIR} + ${OMNIORB_INCLUDES_DIR} + ${KERNEL_ROOT_DIR}/include/salome + ${CMAKE_CURRENT_BINARY_DIR}/../../idl + ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCouplingCorba + ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader + ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints + ) + +SET(medcalculator_SOURCES + MEDCalculatorBrowserMesh.cxx + MEDCalculatorBrowserField.cxx + MEDCalculatorBrowserStep.cxx + MEDCalculatorBrowserLiteStruct.cxx + MEDCalculatorDBRangeSelection.cxx + MEDCalculatorDBSliceField.cxx + MEDCalculatorDBField.cxx +) + +ADD_LIBRARY(medcalculator SHARED ${medcalculator_SOURCES}) +SET_TARGET_PROPERTIES(medcalculator PROPERTIES COMPILE_FLAGS "${HDF5_FLAGS} ${MED3_FLAGS}") +TARGET_LINK_LIBRARIES(medcalculator medloader medcouplingcorba ${KERNEL_LDFLAGS} ${SALOMELocalTrace} ${SalomeNS} ${OpUtil}) +INSTALL(TARGETS medcalculator DESTINATION ${MED_salomelib_LIBS}) + +FILE(GLOB medcalculator_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") +INSTALL(FILES ${medcalculator_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) diff --git a/src/MEDCalculator/Swig/CMakeLists.txt b/src/MEDCalculator/Swig/CMakeLists.txt new file mode 100644 index 000000000..ae7d1ce00 --- /dev/null +++ b/src/MEDCalculator/Swig/CMakeLists.txt @@ -0,0 +1,55 @@ +# Copyright (C) 2007-2011 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +FIND_PACKAGE(SWIG REQUIRED) +INCLUDE(${SWIG_USE_FILE}) + +INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_PATH} + ${MED3_INCLUDES_DIR} + ${HDF5_INCLUDES_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader + ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader/Swig + ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling_Swig + ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling + ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL + ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases + ) + +SET(medcalculatorspython_SOURCES + SPythonInterpreter.cxx + SPythonParser.cxx + ) + +ADD_LIBRARY(medcalculatorspython SHARED ${medcalculatorspython_SOURCES}) +TARGET_LINK_LIBRARIES(medcalculatorspython interpkernel ${PYTHON_LIBS}) +INSTALL(TARGETS medcalculatorspython DESTINATION ${MED_salomelib_LIBS}) + +SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(MEDCalculator.i PROPERTIES SWIG_FLAGS "-shadow") + +SWIG_ADD_MODULE(MEDCalculator python MEDCalculator.i) +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}) diff --git a/src/MEDCalculator/Test/CMakeLists.txt b/src/MEDCalculator/Test/CMakeLists.txt new file mode 100644 index 000000000..e83c94dd4 --- /dev/null +++ b/src/MEDCalculator/Test/CMakeLists.txt @@ -0,0 +1,44 @@ +# Copyright (C) 2007-2011 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_PATH} + ${CPPUNIT_INCLUDES_DIR} + ${HDF5_INCLUDES_DIR} + ${MED3_INCLUDES_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/.. + ${CMAKE_CURRENT_SOURCE_DIR}/../Swig + ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling + ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDLoader + ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL + ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases + ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNELTest # For common CppUnitTest.hxx file + ) + +SET(TestMEDCalculator_SOURCES + TestMEDCalculator.cxx + MEDCalculatorBasicsTest.cxx + ) + +ADD_EXECUTABLE(TestMEDCalculator ${TestMEDCalculator_SOURCES}) +SET_TARGET_PROPERTIES(TestMEDCalculator PROPERTIES COMPILE_FLAGS "${HDF5_FLAGS} ${MED3_FLAGS} ${CPPUNIT_FLAGS}") +TARGET_LINK_LIBRARIES(TestMEDCalculator medcalculatorspython medcalculator ${CPPUNIT_LIBS}) +#ADD_TEST(TestMEDCalculator TestMEDCalculator) + +INSTALL(TARGETS TestMEDCalculator DESTINATION ${MED_salomebin_BINS}) diff --git a/src/MEDCouplingCorba_Swig/CMakeLists.txt b/src/MEDCouplingCorba_Swig/CMakeLists.txt index effec25c9..6d8d01cb7 100644 --- a/src/MEDCouplingCorba_Swig/CMakeLists.txt +++ b/src/MEDCouplingCorba_Swig/CMakeLists.txt @@ -22,8 +22,6 @@ ADD_SUBDIRECTORY(Client) FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) -FIND_PACKAGE(PythonLibs) - SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCouplingCorba.i PROPERTIES SWIG_FLAGS "-shadow") diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index b4d7d9129..ef54df555 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -20,15 +20,12 @@ FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) -FIND_PACKAGE(PythonLibs) -INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) - SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDCoupling.i PROPERTIES SWIG_FLAGS "-shadow") INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_PATH} + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Bases diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index 5892292f6..378bf4606 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -20,15 +20,12 @@ FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) -FIND_PACKAGE(PythonLibs) -INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) - -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) - SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(MEDLoader.i PROPERTIES SWIG_FLAGS "-shadow") INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_PATH} + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling_Swig ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL diff --git a/src/MEDLoader/Test/CMakeLists.txt b/src/MEDLoader/Test/CMakeLists.txt index 5ad6a38de..fcb585183 100644 --- a/src/MEDLoader/Test/CMakeLists.txt +++ b/src/MEDLoader/Test/CMakeLists.txt @@ -25,10 +25,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../../MEDCoupling ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Bases - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/Geometric2D - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/ExprEval - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNEL/GaussPoints - ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNELTest + ${CMAKE_CURRENT_SOURCE_DIR}/../../INTERP_KERNELTest # For common CppUnitTest.hxx file ) SET(TestMEDLoader_SOURCES diff --git a/src/ParaMEDMEM_Swig/CMakeLists.txt b/src/ParaMEDMEM_Swig/CMakeLists.txt index b57fbdda7..d944b2e7e 100644 --- a/src/ParaMEDMEM_Swig/CMakeLists.txt +++ b/src/ParaMEDMEM_Swig/CMakeLists.txt @@ -20,8 +20,6 @@ FIND_PACKAGE(SWIG REQUIRED) INCLUDE(${SWIG_USE_FILE}) -FIND_PACKAGE(PythonLibs) - SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES CPLUSPLUS ON) SET_SOURCE_FILES_PROPERTIES(ParaMEDMEM.i PROPERTIES SWIG_FLAGS "-shadow")