]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Add an empty folder for ShapeRecogn with cmake configs
authorEl Hadi Moussi <moussi@phimeca.com>
Mon, 5 Aug 2024 09:34:26 +0000 (11:34 +0200)
committerEl Hadi Moussi <moussi@phimeca.com>
Mon, 5 Aug 2024 09:34:26 +0000 (11:34 +0200)
CMakeLists.txt
src/CMakeLists.txt
src/ShapeRecogn/CMakeLists.txt [new file with mode: 0644]

index 840bac26a2b47fdd6e418b7d6f276d73ab192f5a..c080f174a5dd9163e6afe3ed4cdd8bd50c3a1796 100644 (file)
@@ -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
 
index b2514fb0fb8b15e80573f64aebb39043ce48babc..98dc66ce5db18d047371b50d4db7770595c5e6fe 100644 (file)
@@ -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 (file)
index 0000000..c5717d2
--- /dev/null
@@ -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)