-# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
+INCLUDE(CMakeDependentOption)
+
PROJECT(SalomeGEOM C CXX)
# Ensure a proper linker behavior:
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
# Find KERNEL
# ===========
LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
INCLUDE(SalomeMacros)
FIND_PACKAGE(SalomeKERNEL REQUIRED)
+ KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
+ 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})
-IF(SALOME_LIGHT_ONLY)
- MESSAGE(FATAL_ERROR "GEOM module can't be built in Light mode (whiout CORBA)")
-ENDIF()
-
-
# Platform setup
# ==============
INCLUDE(SalomeSetupPlatform) # From KERNEL
# Local macros:
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files")
-# User options defined in KERNEL
+# User options
# ============
-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_GEOM_USE_OPENCV "Enable shape recognition from picture" ON)
-
-MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV)
+OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
+CMAKE_DEPENDENT_OPTION(SALOME_GEOM_USE_OPENCV "Enable shape recognition from picture" OFF
+ "SALOME_BUILD_GUI" OFF)
+CMAKE_DEPENDENT_OPTION(SALOME_GEOM_BUILD_CC "Enable curve creator (experimental)" OFF
+ "SALOME_BUILD_GUI" OFF)
+MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_GEOM_USE_OPENCV SALOME_GEOM_BUILD_CC)
+
+# Debug options (!!! FOR DEVELOPERS ONLY !!! TO BE REMOVED LATER !!!)
+IF(CMAKE_BUILD_TYPE MATCHES "^Debug$")
+ CMAKE_DEPENDENT_OPTION(SALOME_GEOM_DEBUG_CC "Debug curve creator" OFF
+ "SALOME_GEOM_BUILD_CC" OFF)
+ MARK_AS_ADVANCED(SALOME_GEOM_DEBUG_CC)
+
+ IF(SALOME_GEOM_DEBUG_CC)
+ ADD_DEFINITIONS(-DDEBUG_CURVE_CREATOR)
+ ENDIF(SALOME_GEOM_DEBUG_CC)
+ENDIF()
# Prerequisites
# =============
FIND_PACKAGE(SalomeBoost REQUIRED)
FIND_PACKAGE(SalomeOmniORB REQUIRED)
FIND_PACKAGE(SalomeOmniORBPy REQUIRED)
-#FIND_PACKAGE(SalomeLibXml2 REQUIRED)
+FIND_PACKAGE(SalomeLibXml2 REQUIRED)
FIND_PACKAGE(SalomeHDF5 REQUIRED COMPONENTS C)
-# Other KERNEL optionals:
-IF(SALOME_USE_MPI)
- FIND_PACKAGE(SalomeMPI) # needed for doc generation by Sphinx
-ENDIF()
+# Other KERNEL optionals:
IF(SALOME_BUILD_TESTS)
ENABLE_TESTING()
FIND_PACKAGE(SalomeCppUnit)
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(CppUnit SALOME_BUILD_TESTS)
+ SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS)
ENDIF()
IF(SALOME_BUILD_DOC)
FIND_PACKAGE(SalomeDoxygen)
FIND_PACKAGE(SalomeGraphviz)
- FIND_PACKAGE(SalomeSphinx)
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Doxygen SALOME_BUILD_DOC)
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Graphviz SALOME_BUILD_DOC)
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(Sphinx SALOME_BUILD_DOC)
+ SALOME_LOG_OPTIONAL_PACKAGE(Doxygen SALOME_BUILD_DOC)
+ SALOME_LOG_OPTIONAL_PACKAGE(Graphviz SALOME_BUILD_DOC)
ENDIF()
# Find GUI (optional)
IF(EXISTS ${GUI_ROOT_DIR})
LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
FIND_PACKAGE(SalomeGUI)
+ FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA
+ 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})
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(SalomeGUI SALOME_BUILD_GUI)
+ SALOME_LOG_OPTIONAL_PACKAGE(SalomeGUI SALOME_BUILD_GUI)
ENDIF(SALOME_BUILD_GUI)
##
## Prerequisites From GUI:
##
+
IF(SALOME_BUILD_GUI)
-
+
# Qt4
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml)
# Optional prerequisites for GUI
IF(SALOME_USE_GLVIEWER)
FIND_PACKAGE(SalomeOpenGL)
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(OpenGL SALOME_USE_GLVIEWER)
+ SALOME_LOG_OPTIONAL_PACKAGE(OpenGL SALOME_USE_GLVIEWER)
ENDIF()
- IF(SALOME_USE_VTKVIEWER)
- # Required components are listed in the FindSalomeVTK.cmake file:
- FIND_PACKAGE(SalomeVTK 6.0)
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(VTK SALOME_USE_VTKVIEWER)
- ENDIF()
-
ENDIF(SALOME_BUILD_GUI)
##
##
FIND_PACKAGE(SalomeCAS REQUIRED)
+FIND_PACKAGE(SalomeVTK 6.1 REQUIRED)
-IF(SALOME_BUILD_GUI)
- # OpenCV
+# OpenCV
+IF(SALOME_GEOM_USE_OPENCV)
FIND_PACKAGE(SalomeOpenCV)
- SALOME_UPDATE_FLAG_AND_LOG_PACKAGE(OpenCV SALOME_GEOM_USE_OPENCV)
-ELSE()
- SET(SALOME_GEOM_USE_OPENCV OFF)
-ENDIF(SALOME_BUILD_GUI)
+ SALOME_LOG_OPTIONAL_PACKAGE(OpenCV SALOME_GEOM_USE_OPENCV)
+ ADD_DEFINITIONS(-DWITH_OPENCV)
+ENDIF(SALOME_GEOM_USE_OPENCV)
# Detection summary:
-SALOME_PACKAGE_REPORT()
-
+SALOME_PACKAGE_REPORT_AND_CHECK()
# Directories
# (default values taken from KERNEL)
MARK_AS_ADVANCED(SALOME_GEOM_INSTALL_RES_DATA SALOME_GEOM_INSTALL_RES_SCRIPTS SALOME_GEOM_INSTALL_PLUGINS)
MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC)
+# Accumulate environment variables for GEOM module
+SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
+ ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}
+ ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED})
+SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
+
# Sources
# ========
ADD_SUBDIRECTORY(idl)
ADD_SUBDIRECTORY(resources)
ADD_SUBDIRECTORY(bin)
ADD_SUBDIRECTORY(src)
-ADD_SUBDIRECTORY(doc)
+IF(SALOME_BUILD_DOC)
+ ADD_SUBDIRECTORY(doc)
+ENDIF()
# Header configuration
# ====================
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
SET(_${PROJECT_NAME}_exposed_targets
GEOMArchimede BREPExport BREPImport BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl
- GEOMUtils GEOMEngine GEOM_SupervEngine IGESExport IGESImport NMTDS NMTTools GEOMSketcher
- SalomeIDLGEOM STEPExport STEPImport STLExport ShHealOper
+ GEOMUtils GEOMEngine GEOM_SupervEngine IGESExport IGESImport GEOMSketcher
+ SalomeIDLGEOM STEPExport STEPImport STLExport STLImport ShHealOper XAO AdvancedEngine OCC2VTK
+ VTKExport
)
IF(SALOME_BUILD_GUI)
LIST(APPEND _${PROJECT_NAME}_exposed_targets
AdvancedGUI BasicGUI BlocksGUI BooleanGUI BuildGUI DisplayGUI DlgRef EntityGUI GEOMBase
GEOMFiltersSelection GEOM GEOMToolsGUI GenerationGUI GroupGUI Material MeasureGUI GEOMObject
- OCC2VTK VTKExport OperationGUI PrimitiveGUI RepairGUI TransformationGUI
+ OperationGUI PrimitiveGUI RepairGUI TransformationGUI ImportExportGUI
)
ENDIF(SALOME_BUILD_GUI)
)
ENDIF(SALOME_GEOM_USE_OPENCV)
+IF(SALOME_GEOM_BUILD_CC)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets
+ CurveCreator
+ )
+ENDIF(SALOME_GEOM_BUILD_CC)
+
# Add all targets to the build-tree export set
EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
# - 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(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in
+
+# Build variables that will be expanded when configuring Salome<MODULE>Config.cmake:
+SALOME_CONFIGURE_PREPARE(OpenCV CAS VTK)
+
+CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
- INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}"
- PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX
- KERNEL_ROOT_DIR GUI_ROOT_DIR CAS_ROOT_DIR OPENCV_ROOT_DIR)
+ 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 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}
INSTALL(FILES
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
- DESTINATION "${SALOME_INSTALL_CMAKE}")
+ DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}")
# Install the export set for use with the install-tree
-INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE}"
+INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
FILE ${PROJECT_NAME}Targets.cmake)