LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
+ ADD_DEFINITIONS(${KERNEL_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${KERNEL_INCLUDE_DIRS})
ELSE(EXISTS ${KERNEL_ROOT_DIR})
MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
ENDIF(EXISTS ${KERNEL_ROOT_DIR})
# User options defined in KERNEL
# ============
-OPTION(SALOME_BUILD_DOC "Generate SALOME GEOM documentation" ${SALOME_BUILD_DOC})
-OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ${SALOME_BUILD_TESTS})
+OPTION(SALOME_BUILD_DOC "Generate SALOME GEOM documentation" ON)
+OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
# Advanced options:
-OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
+OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF
"SALOME_BUILD_GUI" OFF)
MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV)
IF(EXISTS ${GUI_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI)
+ ADD_DEFINITIONS(${GUI_DEFINITIONS})
+ INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
ELSE(EXISTS ${GUI_ROOT_DIR})
MESSAGE(STATUS "GUI_ROOT_DIR is not well defined, GEOM will be built without GUI!!!")
ENDIF(EXISTS ${GUI_ROOT_DIR})
# OpenCV
IF(SALOME_GEOM_USE_OPENCV)
- FIND_PACKAGE(SalomeOpenCV REQUIRED)
+ FIND_PACKAGE(SalomeOpenCV)
SALOME_LOG_OPTIONAL_PACKAGE(OpenCV SALOME_GEOM_USE_OPENCV)
ADD_DEFINITIONS(-DWITH_OPENCV)
ENDIF(SALOME_GEOM_USE_OPENCV)
# Detection summary:
SALOME_PACKAGE_REPORT_AND_CHECK()
-
# Directories
# (default values taken from KERNEL)
# ===========
# - in the build tree:
# Ensure the variables are always defined for the configure:
+SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
+SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
SET(CAS_ROOT_DIR "${CAS_ROOT_DIR}")
+SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}")
SET(OPENCV_ROOT_DIR "${OPENCV_ROOT_DIR}")
-SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/${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 CAS_ROOT_DIR OPENCV_ROOT_DIR)
+ KERNEL_ROOT_DIR GUI_ROOT_DIR CAS_ROOT_DIR VTK_ROOT_DIR OPENCV_ROOT_DIR)
# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?):
# Get the relative path of the include directory so
# ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake
# INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}"
# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX
-# KERNEL_ROOT_DIR SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR CAS_ROOT_DIR
-# OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR)
+# KERNEL_ROOT_DIR GUI_ROOT_DIR CAS_ROOT_DIR VTK_ROOT_DIR OPENCV_ROOT_DIR)
WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME_UC}_VERSION}
# Include directories
SET_AND_CHECK(GEOM_INCLUDE_DIRS "${GEOM_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@")
+SET(GEOM_INCLUDE_DIRS "${GEOM_INCLUDE_DIRS};@_SalomeGEOM_EXTRA_HEADERS@")
+SET(GEOM_DEFINITIONS "@KERNEL_DEFINITIONS@")
#### Now the specificities
# Options exported by the package:
-SET(SALOME_BUILD_DOC @SALOME_BUILD_DOC@)
-SET(SALOME_BUILD_TESTS @SALOME_BUILD_TESTS@)
+SET(SALOME_GEOM_BUILD_DOC @SALOME_BUILD_DOC@)
+SET(SALOME_GEOM_BUILD_TESTS @SALOME_BUILD_TESTS@)
# Advanced options
-SET(SALOME_BUILD_GUI @SALOME_BUILD_GUI@)
+SET(SALOME_GEOM_BUILD_GUI @SALOME_BUILD_GUI@)
SET(SALOME_GEOM_USE_OPENCV @SALOME_GEOM_USE_OPENCV@)
# Level 1 prerequisites:
SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@")
SET_AND_CHECK(CAS_ROOT_DIR_EXP "@PACKAGE_CAS_ROOT_DIR@")
+SET_AND_CHECK(VTK_ROOT_DIR_EXP "@PACKAGE_VTK_ROOT_DIR@")
# Optional level 1 prerequisites:
IF(SALOME_BUILD_GUI)
SET_AND_CHECK(GUI_ROOT_DIR_EXP "@PACKAGE_GUI_ROOT_DIR@")
+ LIST(APPEND GEOM_DEFINITIONS "@GUI_DEFINITIONS@")
ENDIF()
IF(SALOME_GEOM_USE_OPENCV)
SET_AND_CHECK(OPENCV_ROOT_DIR_EXP "@PACKAGE_OPENCV_ROOT_DIR@")
- ADD_DEFINITIONS(-DWITH_OPENCV)
+ LIST(APPEND GEOM_DEFINITIONS "-DWITH_OPENCV")
ENDIF()
# For all prerequisites, load the corresponding targets if the package was used
# in CONFIG mode. This ensures dependent projects link correctly
# without having to set LD_LIBRARY_PATH:
-SET(_PREREQ CAS SalomeGUI OpenCV)
-SET(_PREREQ_CONFIG_DIR "@CAS_DIR@" "@SalomeGUI_DIR@" "@OpenCV_DIR@")
+
+SET(_PREREQ OpenCV CAS VTK)
+SET(_PREREQ_CONFIG_DIR "@OpenCV_DIR@" "@CAS_DIR@" "@VTK_DIR@")
LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
# Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
MATH(EXPR _range "${_list_len}-1")
SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@")
SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@")
-# Include KERNEL targets if they were not already loaded:
-IF(NOT (TARGET SALOMEBasics))
- INCLUDE("${KERNEL_ROOT_DIR_EXP}/${SALOME_INSTALL_CMAKE}/SalomeKERNELTargets.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)
+ # 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(SALOME_BUILD_GUI)
# Exposed GEOM targets:
SET(GEOM_GEOMArchimede GEOMArchimede)