From 105722197af7b346bf7c625e3d1cf8bf3f9bffb4 Mon Sep 17 00:00:00 2001 From: mpa Date: Tue, 22 Oct 2013 07:57:32 +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 | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fcd4febe..3a7bb5843 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,9 @@ IF(NOT SALOME_MED_STANDALONE) LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files") FIND_PACKAGE(SalomePThread REQUIRED) # for MEDCouplingCorba/Test for EDF FIND_PACKAGE(SalomeOmniORB REQUIRED) + # SALOME_LOG_OPTIONAL_PACKAGE(SalomeKERNEL (NOT SALOME_MED_STANDALONE)) + # TODO + # It's necessary to add a next posibility: send a negative argument in SALOME_LOG_OPTIONAL_PACKAGE ELSE(NOT SALOME_MED_STANDALONE) LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local_without_kernel/cmake_files") INCLUDE(SalomeMacros) @@ -98,7 +101,6 @@ IF(NOT SALOME_MED_STANDALONE) MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR or turn option SALOME_MED_STANDALONE to ON !") ENDIF(EXISTS ${KERNEL_ROOT_DIR}) LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files") - FIND_PACKAGE(SalomeOmniORB REQUIRED) LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") ELSE(NOT SALOME_MED_STANDALONE) LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") @@ -136,17 +138,22 @@ IF(NOT SALOME_MED_MICROMED) ENDIF(SALOME_MED_ENABLE_PARTITIONER) ENDIF(NOT SALOME_MED_MICROMED) +# Find GUI (optional) +# =========== IF(SALOME_BUILD_GUI) IF(NOT SALOME_MED_STANDALONE) SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI") IF(EXISTS ${GUI_ROOT_DIR}) LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files") - FIND_PACKAGE(SalomeGUI REQUIRED) + FIND_PACKAGE(SalomeGUI) + ADD_DEFINITIONS(${GUI_DEFINITIONS}) + INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS}) ELSE(EXISTS ${GUI_ROOT_DIR}) MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR or turn option SALOME_BUILD_GUI to OFF !") ENDIF(EXISTS ${GUI_ROOT_DIR}) FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui) FIND_PACKAGE(SalomeCAS REQUIRED) # maybe one day it will disappear ... + SALOME_LOG_OPTIONAL_PACKAGE(SalomeGUI SALOME_BUILD_GUI) ENDIF(NOT SALOME_MED_STANDALONE) ENDIF(SALOME_BUILD_GUI) @@ -313,10 +320,11 @@ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}") SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}") SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}") -SET(HDF5_ROOT_DIR "${HDF5_ROOT_DIR}") SET(MPI_ROOT_DIR "${MPI_ROOT_DIR}") +SET(HDF5_ROOT_DIR "${HDF5_ROOT_DIR}") SET(OMNIORB_ROOT_DIR "${OMNIORB_ROOT_DIR}") SET(PTHREAD_ROOT_DIR "${PTHREAD_ROOT_DIR}") +SET(BOOST_ROOT_DIR "${BOOST_ROOT_DIR}") SET(SWIG_ROOT_DIR "${SWIG_ROOT_DIR}") SET(PYTHON_ROOT_DIR "${PYTHON_ROOT_DIR}") SET(CPPUNIT_ROOT_DIR "${CPPUNIT_ROOT_DIR}") @@ -324,6 +332,11 @@ SET(GRAPHVIZ_ROOT_DIR "${GRAPHVIZ_ROOT_DIR}") SET(DOXYGEN_ROOT_DIR "${DOXYGEN_ROOT_DIR}") SET(SPHINX_ROOT_DIR "${SPHINX_ROOT_DIR}") +SET(METIS_ROOT_DIR "${METIS_ROOT_DIR}") +SET(PARMETIS_ROOT_DIR "${PARMETIS_ROOT_DIR}") +SET(SCOTCH_ROOT_DIR "${SCOTCH_ROOT_DIR}") +SET(XDR_ROOT_DIR "${XDR_ROOT_DIR}") + # - in the install tree: # Get the relative path of the include directory so # we can register it in the generated configuration files: @@ -332,10 +345,10 @@ CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}_LOCAL" PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX - KERNEL_ROOT_DIR GUI_ROOT_DIR MEDFILE_ROOT_DIR - HDF5_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR + KERNEL_ROOT_DIR GUI_ROOT_DIR MEDFILE_ROOT_DIR MPI_ROOT_DIR + HDF5_ROOT_DIR OMNIORB_ROOT_DIR PTHREAD_ROOT_DIR BOOST_ROOT_DIR SWIG_ROOT_DIR PYTHON_ROOT_DIR CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR - SPHINX_ROOT_DIR) + SPHINX_ROOT_DIR METIS_ROOT_DIR PARMETIS_ROOT_DIR SCOTCH_ROOT_DIR XDR_ROOT_DIR) WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${${PROJECT_NAME_UC}_VERSION} -- 2.39.2