From: Anthony Geay Date: Tue, 12 Dec 2017 08:58:50 +0000 (+0100) Subject: cmake medcoupling target -> medcouplingcpp to avoid misleading X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=89057b7643e691557da1438145a39b9850d798fa;p=tools%2Fmedcoupling.git cmake medcoupling target -> medcouplingcpp to avoid misleading --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 04364e614..bdd9bef31 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,7 +258,7 @@ INCLUDE(CMakePackageConfigHelpers) # List of targets in this project we want to make visible to the rest of the world. # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" SET(_${PROJECT_NAME}_exposed_targets - interpkernel medcoupling medcouplingremapper) + interpkernel medcouplingcpp medcouplingremapper) IF(NOT MEDCOUPLING_MICROMED) LIST(APPEND _${PROJECT_NAME}_exposed_targets medloader) diff --git a/MEDCouplingConfig.cmake.in b/MEDCouplingConfig.cmake.in index ba2800d75..ba30a00d3 100644 --- a/MEDCouplingConfig.cmake.in +++ b/MEDCouplingConfig.cmake.in @@ -30,7 +30,7 @@ # Load the dependencies for the libraries of @PROJECT_NAME@ # (contains definitions for IMPORTED targets). This is only # imported if we are not built as a subproject (in this case targets are already there) -IF(NOT TARGET medcoupling AND NOT @PROJECT_NAME@_BINARY_DIR) +IF(NOT TARGET medcouplingcpp AND NOT @PROJECT_NAME@_BINARY_DIR) INCLUDE("@PACKAGE_MEDCOUPLING_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake") ENDIF() @@ -114,7 +114,8 @@ SET(MEDCOUPLING_INSTALL_DOC "@MEDCOUPLING_INSTALL_BINS@") # Exposed MEDCoupling targets: SET(MEDCoupling_interpkernel interpkernel) -SET(MEDCoupling_medcoupling medcoupling) +SET(MEDCoupling_medcouplingcpp medcouplingcpp) +SET(MEDCoupling_medcoupling medcouplingcpp) SET(MEDCoupling_medcouplingremapper medcouplingremapper) SET(MEDCoupling_medloader medloader) SET(MEDCoupling_renumbercpp renumbercpp) diff --git a/src/INTERP_KERNELTest/CMakeLists.txt b/src/INTERP_KERNELTest/CMakeLists.txt index b63df2aca..68e8d4097 100644 --- a/src/INTERP_KERNELTest/CMakeLists.txt +++ b/src/INTERP_KERNELTest/CMakeLists.txt @@ -89,7 +89,7 @@ ADD_LIBRARY(InterpKernelTestUtils ${InterpKernelTestUtils_SOURCES}) TARGET_LINK_LIBRARIES(InterpKernelTestUtils interpkernel) ADD_LIBRARY(InterpKernelTest ${InterpKernelTest_SOURCES}) -SET(InterpKernelTest_LIBS medcoupling interpkernel ${CPPUNIT_LIBRARIES}) +SET(InterpKernelTest_LIBS medcouplingcpp interpkernel ${CPPUNIT_LIBRARIES}) IF(NOT MEDCOUPLING_MICROMED) SET(InterpKernelTest_LIBS medloader ${InterpKernelTest_LIBS}) ENDIF(NOT MEDCOUPLING_MICROMED) diff --git a/src/MEDCoupling/CMakeLists.txt b/src/MEDCoupling/CMakeLists.txt index a29b7c75f..d668ac8c2 100644 --- a/src/MEDCoupling/CMakeLists.txt +++ b/src/MEDCoupling/CMakeLists.txt @@ -80,12 +80,13 @@ SET(medcouplingremapper_SOURCES MEDCouplingRemapper.cxx ) -ADD_LIBRARY(medcoupling ${medcoupling_SOURCES}) -TARGET_LINK_LIBRARIES(medcoupling interpkernel) -INSTALL(TARGETS medcoupling EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS}) +ADD_LIBRARY(medcouplingcpp ${medcoupling_SOURCES}) +SET_TARGET_PROPERTIES(medcouplingcpp PROPERTIES OUTPUT_NAME "medcoupling") +TARGET_LINK_LIBRARIES(medcouplingcpp interpkernel) +INSTALL(TARGETS medcouplingcpp EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS}) ADD_LIBRARY(medcouplingremapper ${medcouplingremapper_SOURCES}) -TARGET_LINK_LIBRARIES(medcouplingremapper medcoupling) +TARGET_LINK_LIBRARIES(medcouplingremapper medcouplingcpp) INSTALL(TARGETS medcouplingremapper EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS}) FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") diff --git a/src/MEDCoupling/Test/CMakeLists.txt b/src/MEDCoupling/Test/CMakeLists.txt index 18b54da61..b742f5c68 100644 --- a/src/MEDCoupling/Test/CMakeLists.txt +++ b/src/MEDCoupling/Test/CMakeLists.txt @@ -57,7 +57,7 @@ SET(TestMEDCouplingExamples_SOURCES SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) ADD_EXECUTABLE(TestMEDCoupling ${TestMEDCoupling_SOURCES}) -TARGET_LINK_LIBRARIES(TestMEDCoupling medcoupling ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(TestMEDCoupling medcouplingcpp ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS}) ADD_TEST(TestMEDCoupling TestMEDCoupling) SET_TESTS_PROPERTIES(TestMEDCoupling PROPERTIES ENVIRONMENT "${tests_env}") @@ -67,7 +67,7 @@ ADD_TEST(TestMEDCouplingRemapper TestMEDCouplingRemapper) SET_TESTS_PROPERTIES(TestMEDCouplingRemapper PROPERTIES ENVIRONMENT "${tests_env}") ADD_EXECUTABLE(TestMEDCouplingExamples ${TestMEDCouplingExamples_SOURCES}) -TARGET_LINK_LIBRARIES(TestMEDCouplingExamples medcoupling ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS}) +TARGET_LINK_LIBRARIES(TestMEDCouplingExamples medcouplingcpp ${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS}) ADD_TEST(TestMEDCouplingExamples TestMEDCouplingExamples) SET_TESTS_PROPERTIES(TestMEDCouplingExamples PROPERTIES ENVIRONMENT "${tests_env}") diff --git a/src/MEDCoupling_Swig/CMakeLists.txt b/src/MEDCoupling_Swig/CMakeLists.txt index 973beab62..66c2ac011 100644 --- a/src/MEDCoupling_Swig/CMakeLists.txt +++ b/src/MEDCoupling_Swig/CMakeLists.txt @@ -32,7 +32,7 @@ ENDIF() SET(SWIG_MODULE_MEDCoupling_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") SET (MEDCoupling_SWIG_DPYS_FILES - MEDCouplingCommon.i + MEDCouplingImpl.i MEDCouplingMemArray.i MEDCouplingFieldDiscretization.i MEDCouplingFinalize.i @@ -45,7 +45,6 @@ SET (MC_pyTestFiles SET (MC_Swig_interf MEDCoupling.i - MEDCouplingCommon.i MEDCouplingImpl.i MEDCouplingRemapperImpl.i MEDCouplingRefCountObject.i @@ -89,7 +88,7 @@ IF(MEDCOUPLING_BUILD_DOC) ENDIF() SWIG_ADD_MODULE(MEDCoupling python MEDCoupling.i) -SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcoupling) +SWIG_LINK_LIBRARIES(MEDCoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medcouplingcpp) SWIG_CHECK_GENERATION(MEDCoupling) SET_SOURCE_FILES_PROPERTIES(MEDCouplingRemapper.i PROPERTIES CPLUSPLUS ON) IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3") diff --git a/src/MEDCoupling_Swig/MEDCoupling.i b/src/MEDCoupling_Swig/MEDCoupling.i index 70a798dcc..ed247753c 100644 --- a/src/MEDCoupling_Swig/MEDCoupling.i +++ b/src/MEDCoupling_Swig/MEDCoupling.i @@ -17,7 +17,9 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -%include "MEDCouplingCommon.i" +%module MEDCoupling + +%include "MEDCouplingImpl.i" %pythoncode %{ def MEDCouplingDataArrayDoubleIadd(self,*args): diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i deleted file mode 100644 index fee5affe0..000000000 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2007-2016 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, or (at your option) any later version. -// -// 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 -// -// Author : Anthony Geay (EDF R&D) - -%module MEDCoupling - -%include "MEDCouplingImpl.i" diff --git a/src/MEDLoader/CMakeLists.txt b/src/MEDLoader/CMakeLists.txt index 537ab3e8f..b54b36b51 100644 --- a/src/MEDLoader/CMakeLists.txt +++ b/src/MEDLoader/CMakeLists.txt @@ -84,7 +84,7 @@ SET(medloader_SOURCES ADD_LIBRARY(medloader ${medloader_SOURCES}) SET_TARGET_PROPERTIES(medloader PROPERTIES COMPILE_FLAGS "") -TARGET_LINK_LIBRARIES(medloader medcoupling ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES} ${MEDLOADER_XDR_LIBRARIES}) +TARGET_LINK_LIBRARIES(medloader medcouplingcpp ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES} ${MEDLOADER_XDR_LIBRARIES}) INSTALL(TARGETS medloader EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS}) FILE(GLOB medloader_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") diff --git a/src/MEDLoader/Swig/CMakeLists.txt b/src/MEDLoader/Swig/CMakeLists.txt index f3be3b0b9..90cef40e3 100644 --- a/src/MEDLoader/Swig/CMakeLists.txt +++ b/src/MEDLoader/Swig/CMakeLists.txt @@ -34,7 +34,6 @@ ENDIF() SET(SWIG_MODULE_MEDLoader_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") SET (MEDLoader_SWIG_DPYS_FILES - MEDLoaderCommon.i MEDLoaderImpl.i MEDLoaderTypemaps.i) @@ -70,14 +69,14 @@ IF(MEDCOUPLING_BUILD_DOC) ENDIF() SWIG_ADD_MODULE(MEDLoader python MEDLoader.i) -SWIG_LINK_LIBRARIES(MEDLoader ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medloader medcoupling) +SWIG_LINK_LIBRARIES(MEDLoader ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medloader medcouplingcpp ) SWIG_CHECK_GENERATION(MEDLoader) IF(WIN32) SET_TARGET_PROPERTIES(_MEDLoader PROPERTIES DEBUG_OUTPUT_NAME _MEDLoader_d) ENDIF(WIN32) INSTALL(TARGETS _MEDLoader DESTINATION ${MEDCOUPLING_INSTALL_PYTHON}) -INSTALL(FILES MEDLoader.i MEDLoaderTypemaps.i MEDLoaderCommon.i MEDLoaderImpl.i MEDLoaderFinalize.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS}) +INSTALL(FILES MEDLoader.i MEDLoaderTypemaps.i MEDLoaderImpl.i MEDLoaderFinalize.i DESTINATION ${MEDCOUPLING_INSTALL_HEADERS}) SALOME_INSTALL_SCRIPTS(${CMAKE_CURRENT_BINARY_DIR}/MEDLoader.py ${MEDCOUPLING_INSTALL_PYTHON}) diff --git a/src/MEDLoader/Swig/MEDLoader.i b/src/MEDLoader/Swig/MEDLoader.i index 439aee67a..939520e69 100644 --- a/src/MEDLoader/Swig/MEDLoader.i +++ b/src/MEDLoader/Swig/MEDLoader.i @@ -18,7 +18,9 @@ // // Author : Anthony Geay (CEA/DEN) -%include "MEDLoaderCommon.i" +%module MEDLoader + +%include "MEDLoaderImpl.i" %pythoncode %{ def MEDCouplingDataArrayDoubleIadd(self,*args): diff --git a/src/MEDLoader/Swig/MEDLoaderCommon.i b/src/MEDLoader/Swig/MEDLoaderCommon.i deleted file mode 100644 index 6a94bbebe..000000000 --- a/src/MEDLoader/Swig/MEDLoaderCommon.i +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2007-2016 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, or (at your option) any later version. -// -// 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 -// -// Author : Anthony Geay (EDF R&D) - -%module MEDLoader - -%include "MEDLoaderImpl.i" diff --git a/src/MEDPartitioner/CMakeLists.txt b/src/MEDPartitioner/CMakeLists.txt index 12eb3795e..a13065529 100644 --- a/src/MEDPartitioner/CMakeLists.txt +++ b/src/MEDPartitioner/CMakeLists.txt @@ -108,7 +108,7 @@ SET(medpartitionercpp_LDFLAGS ${STDLIB} ${LIBXML2_LIBRARIES} interpkernel - medcoupling + medcouplingcpp medloader ) IF(MEDCOUPLING_PARTITIONER_PARMETIS) diff --git a/src/ParaMEDMEM/CMakeLists.txt b/src/ParaMEDMEM/CMakeLists.txt index 4ba14124d..dbc4d8d97 100644 --- a/src/ParaMEDMEM/CMakeLists.txt +++ b/src/ParaMEDMEM/CMakeLists.txt @@ -61,7 +61,7 @@ SET(paramedmem_SOURCES ) ADD_LIBRARY(paramedmem ${paramedmem_SOURCES}) -TARGET_LINK_LIBRARIES(paramedmem medcoupling ${MPI_LIBRARIES}) +TARGET_LINK_LIBRARIES(paramedmem medcouplingcpp ${MPI_LIBRARIES}) INSTALL(TARGETS paramedmem EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS}) FILE(GLOB paramedmem_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") diff --git a/src/PyWrapping/CMakeLists.txt b/src/PyWrapping/CMakeLists.txt new file mode 100644 index 000000000..b162d2537 --- /dev/null +++ b/src/PyWrapping/CMakeLists.txt @@ -0,0 +1,55 @@ +# Copyright (C) 2017 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, or (at your option) any later version. +# +# 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 +# +# Author : Anthony Geay (EDF R&D) + +FIND_PACKAGE(SWIG REQUIRED) +INCLUDE(${SWIG_USE_FILE}) + +ADD_DEFINITIONS(${PYTHON_DEFINITIONS} ${NUMPY_DEFINITIONS} ${SCIPY_DEFINITIONS}) + +SET_SOURCE_FILES_PROPERTIES(medcoupling.i PROPERTIES CPLUSPLUS ON) +IF ("${PYTHON_VERSION_MAJOR}" STREQUAL "3") + SET_SOURCE_FILES_PROPERTIES(medcoupling.i PROPERTIES SWIG_FLAGS "-py3") +ELSE() + SET_SOURCE_FILES_PROPERTIES(medcoupling.i PROPERTIES SWIG_DEFINITIONS "-shadow") +ENDIF() +SET(SWIG_MODULE_medcoupling_EXTRA_FLAGS "${NUMPY_DEFINITIONS};${SCIPY_DEFINITIONS}") + +SET(medcoupling_SWIG_DPYS_FILES medcoupling.i) + +INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_DIRS} + ${NUMPY_INCLUDE_DIR} + ${MEDFILE_INCLUDE_DIRS} + ${HDF5_INCLUDE_DIRS} + ${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 + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/Geometric2D + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/ExprEval + ${CMAKE_CURRENT_SOURCE_DIR}/../INTERP_KERNEL/GaussPoints + ${PROJECT_BINARY_DIR}/doc + ) + +SWIG_ADD_MODULE(medcoupling python medcoupling.i) +SWIG_LINK_LIBRARIES(medcoupling ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} medloader medcouplingcpp) \ No newline at end of file