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)
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")
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)
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}")
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:
${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}
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
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
# 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 ...
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)