From 233c58b13b78d8430a69c7f9b93056b6e4bbcd51 Mon Sep 17 00:00:00 2001 From: mpa Date: Tue, 22 Oct 2013 07:35:44 +0000 Subject: [PATCH] - SALOME_BUILD_DOC, SALOME_BUILD_TESTS and SALOME_BUILD_GUI should be independent in each module - Add definitions and include directories of dependent modules --- CMakeLists.txt | 15 ++++++++++----- SalomeSMESHConfig.cmake.in | 11 +++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f77f11b50..2a5353388 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,8 +60,8 @@ 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" ${SALOME_BUILD_TESTS}) For use in the future -OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ${SALOME_BUILD_DOC}) +# OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) For use in the future +OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ON) # Advanced options: OPTION(SALOME_BUILD_GUI "Enable GUI" ON) @@ -75,10 +75,8 @@ IF(NOT WIN32) ADD_DEFINITIONS(-DENABLE_MEFISTO) ENDIF(NOT WIN32) - MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB) - # Prerequisites # ============= # Find "big" prerequisites first - they reference themselves many others @@ -124,7 +122,7 @@ IF(SALOME_BUILD_GUI) IF(EXISTS ${GUI_ROOT_DIR}) LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files") FIND_PACKAGE(SalomeGUI) - + ## ## Prerequisites From GUI: ## @@ -148,6 +146,13 @@ SET(GEOM_ROOT_DIR $ENV{GEOM_ROOT_DIR} CACHE PATH "Path to the Salome GEOM") IF(EXISTS ${GEOM_ROOT_DIR}) LIST(APPEND CMAKE_MODULE_PATH "${GEOM_ROOT_DIR}/adm_local/cmake_files") FIND_PACKAGE(SalomeGEOM REQUIRED) + ADD_DEFINITIONS(${GEOM_DEFINITIONS}) + INCLUDE_DIRECTORIES(${GEOM_INCLUDE_DIRS}) + IF(SALOME_BUILD_GUI) + IF(NOT SALOME_GEOM_BUILD_GUI) + MESSAGE(FATAL_ERROR "We absolutely need a Salome GEOM with GUI, please set SALOME_BUILD_GUI=ON in GEOM module") + ENDIF(NOT SALOME_GEOM_BUILD_GUI) + ENDIF(SALOME_BUILD_GUI) ELSE(EXISTS ${GEOM_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need a Salome GEOM, please define GEOM_ROOT_DIR") ENDIF(EXISTS ${GEOM_ROOT_DIR}) diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index 5a25c2c8f..c875e75c0 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -43,23 +43,26 @@ SET_AND_CHECK(SMESH_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") # Include directories SET_AND_CHECK(SMESH_INCLUDE_DIRS "${SMESH_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") +SET(SMESH_INCLUDE_DIRS "${SMESH_INCLUDE_DIRS};@_SalomeSMESH_EXTRA_HEADERS@") +SET(SMESH_DEFINITIONS "@GEOM_DEFINITIONS@") #### Now the specificities # Options exported by the package: -SET(SALOME_BUILD_DOC @SALOME_BUILD_DOC@) +SET(SALOME_SMESH_BUILD_DOC @SALOME_BUILD_DOC@) # Advanced options -SET(SALOME_BUILD_GUI @SALOME_BUILD_GUI@) +SET(SALOME_SMESH_BUILD_GUI @SALOME_BUILD_GUI@) SET(SALOME_SMESH_USE_CGNS @SALOME_SMESH_USE_CGNS@) SET(SALOME_SMESH_USE_TBB @SALOME_SMESH_USE_TBB@) SET(SALOME_SMESH_ENABLE_MEFISTO @SALOME_SMESH_ENABLE_MEFISTO@) +IF(NOT WIN32) + LIST(APPEND SMESH_DEFINITIONS "-DENABLE_MEFISTO") +ENDIF(NOT WIN32) # Level 1 prerequisites: SET_AND_CHECK(GEOM_ROOT_DIR_EXP "@PACKAGE_GEOM_ROOT_DIR@") SET_AND_CHECK(MEDFILE_ROOT_DIR_EXP "@PACKAGE_MEDFILE_ROOT_DIR@") -SET_AND_CHECK(CGNS_ROOT_DIR_EXP "@PACKAGE_CGNS_ROOT_DIR@") -SET_AND_CHECK(TBB_ROOT_DIR_EXP "@PACKAGE_TBB_ROOT_DIR@") # Optional level 1 prerequisites: IF(SALOME_SMESH_USE_CGNS)