-
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindPYTHON.cmake)
- if(SALOME_USE_MPI)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindMPI.cmake)
- endif(SALOME_USE_MPI)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindOMNIORB.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindPTHREADS.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindHDF5.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindBOOST.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindLIBXML2.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindSWIG.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCppUnit.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindDOXYGEN.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSphinx.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSalomeLibBatch.cmake)
- INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindKERNEL.cmake)
- #INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindMEDFILE.cmake)
-
- SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR})
- FILE(TO_CMAKE_PATH "$ENV{GUI_ROOT_DIR}" GUI_ROOT_DIR)
- IF(GUI_ROOT_DIR)
- LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
- SET(MED_ENABLE_GUI ON)
- #INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindCAS.cmake)
- FIND_PACKAGE(SalomeCAS)
- INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindQT4.cmake)
- INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindOPENGL.cmake)
- #INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindSalomeVTK.cmake)
- INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindQWT.cmake)
- INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindSIPPYQT.cmake)
- INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindGUI.cmake)
- ENDIF(GUI_ROOT_DIR)
-ELSE(KERNEL_ROOT_DIR)
- SET(SALOME_MACROS_DIR ${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files)
-
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPLATFORM.cmake)
- if(SALOME_USE_MPI)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindMPI.cmake)
- endif(SALOME_USE_MPI)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindBOOST.cmake)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindCPPUNIT.cmake)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindHDF5.cmake)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPYTHON.cmake)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindLIBXML2.cmake)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPTHREADS.cmake)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindSWIG.cmake)
- #INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindMEDFILE.cmake)
-
-ENDIF(KERNEL_ROOT_DIR)
-INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindMEDFILE.cmake)
-INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindPARMETIS.cmake)
-INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindMETIS.cmake)
-INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSCOTCH.cmake)
-INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSPLITTER.cmake)
-INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindRENUMBER.cmake)
+ENDIF(NOT SALOME_MED_STANDALONE)
+
+LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
+
+IF(NOT SALOME_MED_MICROMED)
+ FIND_PACKAGE(SalomeHDF5 REQUIRED)
+ FIND_PACKAGE(SalomeMEDFile REQUIRED)
+ IF(SALOME_MED_ENABLE_PARTITIONER)
+ FIND_PACKAGE(SalomeLibXml2 REQUIRED)
+ IF(SALOME_MED_PARTITIONER_METIS)
+ FIND_PACKAGE(SalomeMetis REQUIRED)
+ ENDIF(SALOME_MED_PARTITIONER_METIS)
+ IF(SALOME_MED_PARTITIONER_SCOTCH)
+ FIND_PACKAGE(SalomeScotch REQUIRED)
+ ENDIF(SALOME_MED_PARTITIONER_SCOTCH)
+ ENDIF(SALOME_MED_ENABLE_PARTITIONER)
+ENDIF(NOT SALOME_MED_MICROMED)
+
+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)
+ 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 ...
+ ENDIF(NOT SALOME_MED_STANDALONE)
+ENDIF(SALOME_BUILD_GUI)
+
+LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
+
+IF(SALOME_BUILD_TESTS)
+ ENABLE_TESTING()
+ FIND_PACKAGE(SalomeCppUnit REQUIRED)
+ENDIF(SALOME_BUILD_TESTS)
+
+IF(SALOME_USE_MPI)
+ FIND_PACKAGE(SalomeMPI REQUIRED)
+ IF(SALOME_MED_PARTITIONER_PARMETIS)
+ FIND_PACKAGE(SalomeParMetis REQUIRED)
+ ENDIF(SALOME_MED_PARTITIONER_PARMETIS)
+ENDIF(SALOME_USE_MPI)
+
+IF(SALOME_MED_ENABLE_RENUMBER)
+ FIND_PACKAGE(SalomeBoost)
+ENDIF(SALOME_MED_ENABLE_RENUMBER)
+
+IF(SALOME_BUILD_DOC)
+ FIND_PACKAGE(SalomeDoxygen REQUIRED)
+ FIND_PACKAGE(SalomeGraphviz) # Remains optional even here.
+ FIND_PACKAGE(SalomeSphinx REQUIRED)
+ENDIF(SALOME_BUILD_DOC)
+
+IF(SALOME_MED_ENABLE_PYTHON)
+ FIND_PACKAGE(SalomePython REQUIRED)
+ FIND_PACKAGE(SalomeSWIG REQUIRED)
+ENDIF(SALOME_MED_ENABLE_PYTHON)
+
+# Directories
+#
+# Directories have to be given after prerequisites (to be able to use
+# Python version string for example).
+# ===========
+SET(SALOME_INSTALL_BINS bin/salome CACHE PATH "Install path: SALOME binaries")
+SET(SALOME_INSTALL_LIBS lib/salome CACHE PATH "Install path: SALOME libs")
+SET(SALOME_INSTALL_IDLS idl/salome CACHE PATH "Install path: SALOME IDL files")
+SET(SALOME_INSTALL_HEADERS include/salome CACHE PATH "Install path: SALOME headers")
+SET(SALOME_INSTALL_SCRIPT_SCRIPTS ${SALOME_INSTALL_BINS} CACHE PATH
+ "Install path: SALOME scripts")
+SET(SALOME_INSTALL_SCRIPT_DATA ${SALOME_INSTALL_BINS} CACHE PATH
+ "Install path: SALOME script data")
+SET(SALOME_INSTALL_SCRIPT_PYTHON ${SALOME_INSTALL_BINS} CACHE PATH
+ "Install path: SALOME Python scripts")
+SET(SALOME_INSTALL_APPLISKEL_SCRIPTS ${SALOME_INSTALL_BINS}/appliskel CACHE PATH
+ "Install path: SALOME application skeleton - scripts")
+SET(SALOME_INSTALL_APPLISKEL_PYTHON ${SALOME_INSTALL_BINS}/appliskel CACHE PATH
+ "Install path: SALOME application skeleton - Python")
+SET(SALOME_INSTALL_CMAKE adm_local/cmake_files CACHE PATH "Install path: SALOME CMake files")
+SET(SALOME_INSTALL_CMAKE_LOCAL adm_local/cmake_files CACHE PATH
+ "Install path: local SALOME CMake files")
+
+IF(SALOME_MED_ENABLE_PYTHON)
+ SET(_pydir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
+ SET(SALOME_INSTALL_PYTHON ${_pydir}/salome CACHE PATH "Install path: SALOME Python stuff")
+ SET(SALOME_INSTALL_PYTHON_SHARED ${SALOME_INSTALL_PYTHON}/shared_modules CACHE PATH
+ "Install path: SALOME Python shared modules")
+ENDIF(SALOME_MED_ENABLE_PYTHON)
+
+SET(SALOME_INSTALL_RES share/salome/resources CACHE PATH "Install path: SALOME resources")
+
+# Med specific:
+
+SET(SALOME_MED_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/med" CACHE PATH "Install path: SALOME MED specific data")
+SET(SALOME_MED_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/med" CACHE PATH "Install path: SALOME MED specific scripts")
+
+MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS)
+MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_SCRIPTS SALOME_INSTALL_SCRIPT_DATA SALOME_INSTALL_SCRIPT_PYTHON)
+MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTHON SALOME_INSTALL_CMAKE SALOME_INSTALL_CMAKE_LOCAL SALOME_INSTALL_RES)
+MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED SALOME_MED_INSTALL_RES_DATA SALOME_MED_INSTALL_RES_SCRIPTS)
+
+# Configuration of MED_version.h.in
+
+SET(input ${PROJECT_SOURCE_DIR}/MED_version.h.in)
+SET(output ${PROJECT_BINARY_DIR}/MED_version.h)
+MESSAGE(STATUS "Creation of ${output}")
+CONFIGURE_FILE(${input} ${output} @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MED_version.h DESTINATION ${SALOME_INSTALL_HEADERS})
+
+# Sources
+# ========