]> SALOME platform Git repositories - modules/med.git/commitdiff
Salome HOME
CMake: using newly created macros SALOME_UPDATE_FLAG_AND_LOG_PACKAGE() and SALOME_PAC...
authorbruneton <bruneton>
Tue, 27 Aug 2013 09:15:01 +0000 (09:15 +0000)
committerbruneton <bruneton>
Tue, 27 Aug 2013 09:15:01 +0000 (09:15 +0000)
==> Metis and Scotch do not need to be switched off explicitly on the command line anymore

CMakeLists.txt
src/RENUMBER/CMakeLists.txt

index 62a7f176b926e982daba5ef3a1ba02b0d22bce3e..a4e56d6f3c010def88401219945d12175496db70 100644 (file)
@@ -107,12 +107,15 @@ IF(NOT SALOME_MED_MICROMED)
   FIND_PACKAGE(SalomeHDF5 REQUIRED)
   FIND_PACKAGE(SalomeMEDFile REQUIRED)
   IF(SALOME_MED_ENABLE_PARTITIONER)
-    FIND_PACKAGE(SalomeLibXml2 REQUIRED)
+    FIND_PACKAGE(SalomeLibXml2)
+    SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(LibXml2 SALOME_MED_ENABLE_PARTITIONER)
     IF(SALOME_MED_PARTITIONER_METIS)
-      FIND_PACKAGE(SalomeMetis REQUIRED)
+      FIND_PACKAGE(SalomeMetis)
+      SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Metis SALOME_MED_PARTITIONER_METIS)
     ENDIF(SALOME_MED_PARTITIONER_METIS)
     IF(SALOME_MED_PARTITIONER_SCOTCH)
-      FIND_PACKAGE(SalomeScotch REQUIRED)
+      FIND_PACKAGE(SalomeScotch)
+      SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Scotch SALOME_MED_PARTITIONER_SCOTCH)
     ENDIF(SALOME_MED_PARTITIONER_SCOTCH)
   ENDIF(SALOME_MED_ENABLE_PARTITIONER)
 ENDIF(NOT SALOME_MED_MICROMED)
@@ -136,34 +139,45 @@ LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
 ENABLE_TESTING() # let it outsite because even if SALOME_BUILD_TESTS is OFF, python tests that not need additional compilation can be run.
 
 IF(SALOME_BUILD_TESTS)
-  FIND_PACKAGE(SalomeCppUnit REQUIRED)
+  FIND_PACKAGE(SalomeCppUnit)
+  SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(CppUnit SALOME_BUILD_TESTS)
 ENDIF(SALOME_BUILD_TESTS)
 
 IF(SALOME_USE_MPI)
   FIND_PACKAGE(SalomeMPI REQUIRED)
   IF(SALOME_MED_PARTITIONER_PARMETIS)
-    FIND_PACKAGE(SalomeParMetis REQUIRED)
+    FIND_PACKAGE(SalomeParMetis)
+    SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(ParMetis SALOME_MED_PARTITIONER_PARMETIS)
   ENDIF(SALOME_MED_PARTITIONER_PARMETIS)
 ENDIF(SALOME_USE_MPI)
 
 IF(SALOME_MED_ENABLE_RENUMBER)
   FIND_PACKAGE(SalomeBoost)
+  SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Boost SALOME_MED_ENABLE_RENUMBER)
 ENDIF(SALOME_MED_ENABLE_RENUMBER)
 
 IF(SALOME_BUILD_DOC)
-  FIND_PACKAGE(SalomeDoxygen REQUIRED)
-  FIND_PACKAGE(SalomeGraphviz)          # Remains optional even here.
-  FIND_PACKAGE(SalomeSphinx REQUIRED)
+  FIND_PACKAGE(SalomeDoxygen)
+  FIND_PACKAGE(SalomeGraphviz)
+  FIND_PACKAGE(SalomeSphinx)
+  SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Doxygen SALOME_BUILD_DOC)
+  SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Graphviz SALOME_BUILD_DOC)
+  SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Sphinx SALOME_BUILD_DOC)
 ENDIF(SALOME_BUILD_DOC)
 
 IF(SALOME_MED_ENABLE_PYTHON)
-  FIND_PACKAGE(SalomePython REQUIRED)
-  FIND_PACKAGE(SalomeSWIG REQUIRED)
+  FIND_PACKAGE(SalomePython)
+  FIND_PACKAGE(SalomeSWIG)
+  SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Python SALOME_MED_ENABLE_PYTHON)
+  SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(SWIG   SALOME_MED_ENABLE_PYTHON)
   IF(NOT SALOME_MED_STANDALONE)
     FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
   ENDIF(NOT SALOME_MED_STANDALONE)
 ENDIF(SALOME_MED_ENABLE_PYTHON)
 
+# Detection report
+SALOME_PACKAGE_REPORT()
+
 # Directories
 #
 # Directories have to be given after prerequisites (to be able to use
index 3b6686dfcbc8fe768016001775931a0b959b0131..16138eb6cb71f6aaf7fb72149a9fdcfc3ef4f522 100644 (file)
@@ -23,9 +23,8 @@ IF(Boost_FOUND)
   ADD_DEFINITIONS("-DENABLE_BOOST")
 ENDIF(Boost_FOUND)
 
+# Include directories
 INCLUDE_DIRECTORIES(
-  ${Boost_INCLUDE_DIRS}
-  ${METIS_INCLUDE_DIRS}
   ${MEDFILE_INCLUDE_DIRS}
   ${HDF5_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}/../MEDLoader
@@ -55,6 +54,8 @@ SET(renumber_SOURCES
 SET(renumbercpp_LDFLAGS medloader)
 
 IF(Metis_FOUND)
+  INCLUDE_DIRECTORIES(${METIS_INCLUDE_DIRS})
+  
   SET(renumbercpp_SOURCES ${renumbercpp_SOURCES} RENUMBER_METISRenumbering.cxx)
   SET(renumbercpp_HEADERS_HXX ${renumbercpp_HEADERS_HXX} RENUMBER_METISRenumbering.hxx)
   SET(renumbercpp_LDFLAGS ${renumbercpp_LDFLAGS} ${METIS_LIBS})
@@ -62,6 +63,8 @@ IF(Metis_FOUND)
 ENDIF(Metis_FOUND)
 
 IF(Boost_FOUND)
+  INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+  
   SET(renumbercpp_SOURCES ${renumbercpp_SOURCES} RENUMBER_BOOSTRenumbering.cxx)
   SET(renumbercpp_HEADERS_HXX ${renumbercpp_HEADERS_HXX} RENUMBER_BOOSTRenumbering.hxx)
   SET(renumbercpp_LDFLAGS ${renumbercpp_LDFLAGS} ${BOOST_LIBRARIES})