-# Copyright (C) 2010-2013 CEA/DEN, EDF R&D
+# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# 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(SalomePARAVIS C CXX)
IF(WIN32)
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 5)
SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
# ============
OPTION(SALOME_BUILD_DOC "Generate SALOME GUI documentation" ON)
OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
-OPTION(SALOME_PARAVIS_MINIMAL_CORBA "Build PARAVIS with a minimal CORBA interface" OFF)
+OPTION(SALOME_PARAVIS_ALL_TEST "Add all tests for Salome PARAVIS module" OFF)
OPTION(SALOME_PARAVIS_BUILD_PLUGINS "Build PARAVIS plugins (MEDReader, etc ...)" ON)
+CMAKE_DEPENDENT_OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF
+ "NOT SALOME_KERNEL_LIGHT_ONLY" ON)
+CMAKE_DEPENDENT_OPTION(SALOME_PARAVIS_MINIMAL_CORBA "Build PARAVIS with a minimal CORBA interface" ON
+ "NOT SALOME_LIGHT_ONLY" ON)
IF(SALOME_BUILD_TESTS)
ENABLE_TESTING()
# GUI itself has to be loaded AFTER ParaView: the ParaView config doesn't mix
# well with the VTK one (and GUI loads VTK):
FIND_PACKAGE(SalomeGUI REQUIRED)
+FULL_GUI(TRUE) # check whether GUI builded in full mode and with CORBA
ADD_DEFINITIONS(${GUI_DEFINITIONS})
INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
##
## From GUI: part 2
##
-FIND_PACKAGE(SalomeCAS REQUIRED)
+FIND_PACKAGE(SalomeCAS REQUIRED) # [ABN] I wish I could avoid that ...
##
## From MED
ELSE()
MESSAGE(FATAL_ERROR "We absolutely need the Salome MED module to build plugins, please define MED_ROOT_DIR")
ENDIF()
+ IF(SALOME_MED_STANDALONE OR SALOME_MED_MICROMED)
+ MESSAGE(FATAL_ERROR "We absolutely need a Salome MED with KERNEL and with MED file dependancy,
+ please set SALOME_MED_STANDALONE=OFF and SALOME_MED_MICROMED=OFF in MED module
+ or SALOME_PARAVIS_BUILD_PLUGINS=OFF in PARAVIS module")
+ ENDIF()
FIND_PACKAGE(SalomeMEDFile)
SALOME_LOG_OPTIONAL_PACKAGE(MEDFile SALOME_PARAVIS_BUILD_PLUGINS)
ENDIF()
## Generation of the list of VTK classes (to be wrapped into IDLs)
## =====================================
IF(NOT SALOME_LIGHT_ONLY AND NOT SALOME_PARAVIS_MINIMAL_CORBA)
+ ADD_DEFINITIONS(-DPARAVIS_WITH_FULL_CORBA)
# TODO: the below requires ParaView in the PYTHONPATH ... not so nice:
MESSAGE(STATUS "Generating list of wrapped VTK classes ...")
LIST(GET PARAVIEW_INCLUDE_DIRS 0 PARAVIEW_INCLUDE_DIR0)
SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}
${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON})
SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS})
+SALOME_ACCUMULATE_ENVIRONMENT(PV_PLUGIN_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/lib/paraview)
# Sources
# ========
IF(SALOME_BUILD_DOC)
ADD_SUBDIRECTORY(doc)
ENDIF()
-IF(SALOME_BUILD_TESTS)
+IF(SALOME_BUILD_TESTS AND NOT SALOME_LIGHT_ONLY)
ADD_SUBDIRECTORY(test)
ENDIF()
ADD_SUBDIRECTORY(bin)
+ADD_SUBDIRECTORY(examples)
# Header configuration
# ====================
# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
-SET(_${PROJECT_NAME}_exposed_targets
- SalomeIDLPARAVIS PARAVIS PARAVISEngine
-)
+IF(NOT SALOME_LIGHT_ONLY)
+ SET(_${PROJECT_NAME}_exposed_targets SalomeIDLPVServer PARAVIS)
-# Add all targets to the build-tree export set
-EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
- FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
+ # Add all targets to the build-tree export set
+ EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
+ FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
+ENDIF()
# Create the configuration files:
# - in the build tree:
-# Ensure the variables are always defined for the configure:
-SET(SIP_ROOT_DIR "${SIP_ROOT_DIR}")
-SET(QT4_ROOT_DIR "${QT4_ROOT_DIR}")
-SET(PYQT4_ROOT_DIR "${PYQT4_ROOT_DIR}")
-SET(CAS_ROOT_DIR "${CAS_ROOT_DIR}")
-SET(OPENGL_ROOT_DIR "${OPENGL_ROOT_DIR}")
-SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}")
-SET(QWT_ROOT_DIR "${QWT_ROOT_DIR}")
+# Ensure the variables are always defined for the configure:
+SET(KERNEL_ROOT_DIR "${KERNEL_ROOT_DIR}")
+SET(GUI_ROOT_DIR "${GUI_ROOT_DIR}")
+SET(MED_ROOT_DIR "${MED_ROOT_DIR}")
+SET(MEDFILE_ROOT_DIR "${MEDFILE_ROOT_DIR}")
SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include")
${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 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 MED_ROOT_DIR MEDFILE_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_LOCAL}"
# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL 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 MED_ROOT_DIR MEDFILE_ROOT_DIR)
WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
VERSION ${${PROJECT_NAME_UC}_VERSION}
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.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_LOCAL}"
- FILE ${PROJECT_NAME}Targets.cmake)
+IF(NOT SALOME_LIGHT_ONLY)
+ # Install the export set for use with the install-tree
+ INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}"
+ FILE ${PROJECT_NAME}Targets.cmake)
+ENDIF()