Salome HOME
CMake:
[modules/smesh.git] / CMakeLists.txt
index e5f40f5..46691a6 100755 (executable)
@@ -58,15 +58,14 @@ SET(BUILD_SHARED_LIBS TRUE)
 LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") 
 
 # User options
-# (some options have already been defined in KERNEL) 
 # ============
-# OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) For use in the future
+OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
 OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ON)
   
 # Advanced options:
 OPTION(SALOME_BUILD_GUI            "Enable GUI" ON)
-OPTION(SALOME_SMESH_USE_CGNS       "Enable shape recognition from picture" OFF)
-OPTION(SALOME_SMESH_USE_TBB        "Enable shape recognition from picture" OFF)
+OPTION(SALOME_SMESH_USE_CGNS       "Enable import/export to CGNS format" OFF)
+OPTION(SALOME_SMESH_USE_TBB        "Enable parallel computation" OFF)
 
 #On Linux use Fortran to compile MEFISTO2D
 IF(NOT WIN32)
@@ -108,7 +107,11 @@ FIND_PACKAGE(SalomeHDF5 REQUIRED COMPONENTS C)
 IF(SALOME_USE_MPI)
   FIND_PACKAGE(SalomeMPI) # needed for doc generation by Sphinx
 ENDIF()
-
+IF(SALOME_BUILD_TESTS)
+  ENABLE_TESTING()
+  FIND_PACKAGE(SalomeCppUnit)
+  SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
+ENDIF()
 IF(SALOME_BUILD_DOC)
   FIND_PACKAGE(SalomeDoxygen)
   FIND_PACKAGE(SalomeSphinx)
@@ -169,11 +172,13 @@ FIND_PACKAGE(SalomeCAS REQUIRED)
 IF(SALOME_SMESH_USE_CGNS)
   FIND_PACKAGE(SalomeCGNS)
   SALOME_LOG_OPTIONAL_PACKAGE(CGNS SALOME_SMESH_USE_CGNS)
+  ADD_DEFINITIONS(-DWITH_CGNS)
 ENDIF(SALOME_SMESH_USE_CGNS)
 
 IF(SALOME_SMESH_USE_TBB)
   FIND_PACKAGE(SalomeTBB)
   SALOME_LOG_OPTIONAL_PACKAGE(TBB SALOME_SMESH_USE_TBB)
+  ADD_DEFINITIONS(-DWITH_TBB)
 ENDIF(SALOME_SMESH_USE_TBB)
 
 FIND_PACKAGE(SalomeMEDFile REQUIRED)
@@ -309,6 +314,10 @@ SET(CGNS_ROOT_DIR "${CGNS_ROOT_DIR}")
 SET(TBB_ROOT_DIR  "${TBB_ROOT_DIR}")
  
 SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
+
+# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
+SALOME_CONFIGURE_PREPARE(CGNS TBB MEDFile)
+
 CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
     ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
     INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"