From 98fb4f6676815e8543da3b2832339092f79c5cc9 Mon Sep 17 00:00:00 2001 From: El Hadi Moussi Date: Mon, 5 Aug 2024 11:34:26 +0200 Subject: [PATCH] Add an empty folder for ShapeRecogn with cmake configs --- CMakeLists.txt | 20 +++++++++++++ src/CMakeLists.txt | 4 +++ src/ShapeRecogn/CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) create mode 100644 src/ShapeRecogn/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 840bac26a..c080f174a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,7 @@ OPTION(MEDCOUPLING_MICROMED "Build MED without MED file dependency." OFF) OPTION(MEDCOUPLING_ENABLE_PYTHON "Build PYTHON bindings." ON) OPTION(MEDCOUPLING_ENABLE_PARTITIONER "Build MEDPartitioner." ON) OPTION(MEDCOUPLING_ENABLE_RENUMBER "Build Renumber." ON) +OPTION(MEDCOUPLING_ENABLE_SHAPERECOGN "Build ShapeRecogn" OFF) OPTION(MEDCOUPLING_WITH_FILE_EXAMPLES "Install examples of files containing meshes and fields of different formats." ON) OPTION(MEDCOUPLING_USE_MPI "(Use MPI containers) - For MED this triggers the build of ParaMEDMEM." OFF) OPTION(MEDCOUPLING_BUILD_TESTS "Build MEDCoupling C++ tests." ON) @@ -201,6 +202,21 @@ IF(MEDCOUPLING_ENABLE_RENUMBER) SALOME_LOG_OPTIONAL_PACKAGE(Boost MEDCOUPLING_ENABLE_RENUMBER) ENDIF(MEDCOUPLING_ENABLE_RENUMBER) +IF(MEDCOUPLING_ENABLE_SHAPERECOGN) + FIND_PACKAGE(BLAS REQUIRED) + FIND_PACKAGE(LAPACK REQUIRED) + FIND_LIBRARY(LAPACKE_LIB NAMES lapacke REQUIRED) + SET(LAPACK_LIBRARIES ${LAPACKE_LIB} ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES}) + FIND_PATH(LAPACKE_INCLUDE_DIRS NAMES lapacke.h HINTS ${LAPACK_LIBRARIES}) + IF(LAPACK_FOUND) + MESSAGE(STATUS "Lapacke libraries: ${LAPACK_LIBRARIES}") + MESSAGE(STATUS "Lapacke include dirs: ${LAPACKE_INCLUDE_DIRS}") + ELSE() + MESSAGE(FATAL_ERROR "Error in Lapacke detection ! lapacke not found !") + ENDIF(LAPACK_FOUND) + SALOME_LOG_OPTIONAL_PACKAGE(Lapack MEDCOUPLING_ENABLE_SHAPERECOGN) +ENDIF(MEDCOUPLING_ENABLE_SHAPERECOGN) + IF(MEDCOUPLING_ENABLE_PYTHON) FIND_PACKAGE(SalomePythonInterp) FIND_PACKAGE(SalomePythonLibs) @@ -339,6 +355,10 @@ IF(MEDCOUPLING_USE_MPI) ENDIF() ENDIF() ENDIF() + +IF(MEDCOUPLING_ENABLE_SHAPERECOGN) + LIST(APPEND _${PROJECT_NAME}_exposed_targets shaperecogn) +ENDIF(MEDCOUPLING_ENABLE_SHAPERECOGN) # Add all targets to the build-tree export set diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b2514fb0f..98dc66ce5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -75,6 +75,10 @@ IF(MEDCOUPLING_USE_MPI) ENDIF(MEDCOUPLING_BUILD_TESTS) ENDIF(MEDCOUPLING_USE_MPI) +IF(MEDCOUPLING_ENABLE_SHAPERECOGN) + ADD_SUBDIRECTORY(ShapeRecogn) +ENDIF(MEDCOUPLING_ENABLE_SHAPERECOGN) + # Application tests configure_file(CTestTestfileInstall.cmake.in "CTestTestfileST.cmake" @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfileST.cmake DESTINATION ${MEDCOUPLING_INSTALL_TESTS} RENAME CTestTestfile.cmake) diff --git a/src/ShapeRecogn/CMakeLists.txt b/src/ShapeRecogn/CMakeLists.txt new file mode 100644 index 000000000..c5717d293 --- /dev/null +++ b/src/ShapeRecogn/CMakeLists.txt @@ -0,0 +1,54 @@ +# Copyright (C) 2012-2024 CEA, EDF +# +# 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 +# + +ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS}) + +IF (NOT DEFINED MSVC) + ADD_DEFINITIONS(-Wsign-compare -Wconversion) +ENDIF() + +# IF(MEDCOUPLING_ENABLE_PYTHON) +# ADD_SUBDIRECTORY(Swig) +# ENDIF(MEDCOUPLING_ENABLE_PYTHON) + +# IF(MEDCOUPLING_BUILD_TESTS) +# ADD_SUBDIRECTORY(Test) +# ENDIF(MEDCOUPLING_BUILD_TESTS) + +INCLUDE_DIRECTORIES( + ${MEDFILE_INCLUDE_DIRS} + ${HDF5_INCLUDE_DIRS} + ${LAPACKE_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/../MEDCoupling + ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader +) + +SET(shaperecogn_SOURCES + ) + +ADD_LIBRARY(shaperecogn ${shaperecogn_SOURCES}) +SET_TARGET_PROPERTIES(shaperecogn PROPERTIES COMPILE_FLAGS "") +TARGET_LINK_LIBRARIES(shaperecogn medcouplingcpp ${MEDFILE_C_LIBRARIES} ${HDF5_LIBRARIES} ${LAPACK_LIBRARIES}) +INSTALL(TARGETS shaperecogn EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${MEDCOUPLING_INSTALL_LIBS}) + +FILE(GLOB shaperecogn_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") +INSTALL(FILES ${shaperecogn_HEADERS_HXX} DESTINATION ${MEDCOUPLING_INSTALL_HEADERS}) + +# To allow usage as SWIG dependencies: +SET(shaperecogn_HEADERS_HXX PARENT_SCOPE) -- 2.39.2