From: mpa Date: Tue, 22 Oct 2013 07:57:32 +0000 (+0000) Subject: - SALOME_BUILD_DOC, SALOME_BUILD_TESTS and SALOME_BUILD_GUI should be independent... X-Git-Tag: V7_3_0a1~79 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=218b019be2e19caafec06c3bbc3702d7710ae1f5;p=modules%2Fmed.git - SALOME_BUILD_DOC, SALOME_BUILD_TESTS and SALOME_BUILD_GUI should be independent in each module - Add definitions and include directories of dependent modules --- 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} diff --git a/SalomeMEDConfig.cmake.in b/SalomeMEDConfig.cmake.in index eadcd4ebd..3cb2834b0 100644 --- a/SalomeMEDConfig.cmake.in +++ b/SalomeMEDConfig.cmake.in @@ -53,9 +53,9 @@ SET(SALOME_MED_STANDALONE @SALOME_MED_STANDALONE@) SET(SALOME_MED_MICROMED @SALOME_MED_MICROMED@) SET(SALOME_MED_ENABLE_PYTHON @SALOME_MED_ENABLE_PYTHON@) SET(SALOME_USE_MPI @SALOME_USE_MPI@) -SET(SALOME_BUILD_DOC @SALOME_BUILD_DOC@) -SET(SALOME_BUILD_TESTS @SALOME_BUILD_TESTS@) -SET(SALOME_BUILD_GUI @SALOME_BUILD_GUI@) +SET(SALOME_MED_BUILD_DOC @SALOME_BUILD_DOC@) +SET(SALOME_MED_BUILD_TESTS @SALOME_BUILD_TESTS@) +SET(SALOME_MED_BUILD_GUI @SALOME_BUILD_GUI@) # Advanced options @@ -69,9 +69,11 @@ ENDIF(NOT SALOME_MED_MICROMED) IF(NOT SALOME_MED_STANDALONE) SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@") + LIST(APPEND MED_DEFINITIONS "@KERNEL_DEFINITIONS@") ENDIF(NOT SALOME_MED_STANDALONE) IF(SALOME_BUILD_GUI) SET_AND_CHECK(GUI_ROOT_DIR_EXP "@PACKAGE_GUI_ROOT_DIR@") + LIST(APPEND MED_DEFINITIONS "@GUI_DEFINITIONS@") ENDIF(SALOME_BUILD_GUI) # For all prerequisites, load the corresponding targets if the package was used @@ -79,13 +81,12 @@ ENDIF(SALOME_BUILD_GUI) # without having to set LD_LIBRARY_PATH. # Many of them will be automatically loaded from KERNEL or GUI: -SET(_PREREQ) -SET(_PREREQ_CONFIG_DIR) - -IF(NOT SALOME_MED_MICROMED) - LIST(APPEND _PREREQ HDF5 MEDFile ) - LIST(APPEND _PREREQ_CONFIG_DIR "@HDF5_DIR@" "@MEDFile_DIR@") -ENDIF() +SET(_PREREQ Metis ParMetis Scotch XDR CAS Qt4 CppUnit Graphviz Doxygen Sphinx MPI omniORB + PThread Boost libXml2 Python HDF5 MEDFile) +SET(_PREREQ_CONFIG_DIR "@Metis_DIR@" "@ParMetis_DIR@" "@Scotch_DIR@" "@XDR_DIR@" "@CAS_DIR@" "@Qt4_DIR@" + "@CppUnit_DIR@" "@Graphviz_DIR@" "@Doxygen_DIR@" "@Sphinx_DIR@" "@MPI_DIR@" + "@omniORB_DIR@" "@PThread_DIR@" "@Boost_DIR@" "@libXml2_DIR@" + "@Python_DIR@" "@HDF5_DIR@" "@MEDFile_DIR@") LIST(LENGTH _PREREQ_CONFIG_DIR _list_len) # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... @@ -117,16 +118,19 @@ SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@") SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@") SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@") -# Include KERNEL targets if they were not already loaded: -IF(NOT (TARGET SALOMEBasics) AND NOT SALOME_MED_STANDALONE) - INCLUDE("${KERNEL_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeKERNELTargets.cmake") -ENDIF() - -# Include GUI targets if they were not already loaded: -IF(NOT (TARGET Event) AND SALOME_BUILD_GUI) - INCLUDE("${GUI_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE_LOCAL}/SalomeGUITargets.cmake") -ENDIF() - +IF(SALOME_BUILD_GUI) + # Include GUI targets if they were not already loaded: + IF(NOT (TARGET Event)) + INCLUDE("${GUI_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE_LOCAL}/SalomeGUITargets.cmake") + ENDIF() +ELSE(SALOME_BUILD_GUI) + IF(NOT SALOME_MED_STANDALONE) + # Include KERNEL targets if they were not already loaded: + IF(NOT (TARGET SALOMEBasics) AND NOT SALOME_MED_STANDALONE) + INCLUDE("${KERNEL_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeKERNELTargets.cmake") + ENDIF() + ENDIF(NOT SALOME_MED_STANDALONE) +ENDIF(SALOME_BUILD_GUI) # Exposed MED targets: SET(MED_interpkernel interpkernel)