From: bruneton Date: Mon, 21 Oct 2013 09:52:54 +0000 (+0000) Subject: CMake: porting module to the new CMake procedure. X-Git-Tag: V7_3_0a1~27 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0abec28f55a64e8215742e9b02f955d161a8b865;p=modules%2Fparavis.git CMake: porting module to the new CMake procedure. Isolated as much as possible IDL wrapping logic. Introduced flag SALOME_PARAVIS_MINIMAL_CORBA to turn the wrapping off. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 906d2579..d7c67868 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,47 +16,105 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # - -PROJECT(PARAVIS C CXX) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) +PROJECT(SalomePARAVIS C CXX) IF(WINDOWS) STRING( REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags ${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ) SET( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${replacementFlags}" ) ENDIF(WINDOWS) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7 FATAL_ERROR) -IF(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -ENDIF(COMMAND cmake_policy) +# Ensure a proper linker behavior: +CMAKE_POLICY(SET CMP0003 NEW) + +# Versioning +# =========== +# Project name, upper case +STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) + +SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 2) +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) + +# Find KERNEL +# =========== +SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") +IF(EXISTS ${KERNEL_ROOT_DIR}) + 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}) + +# Platform setup +# ============== +INCLUDE(SalomeSetupPlatform) # From KERNEL +# Always build libraries as shared objects: +SET(BUILD_SHARED_LIBS TRUE) +# Local macros: +LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") + +# Detect GUI root dir (but doesn't find GUI yet! See below) +# =================== +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") +ELSE() + MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR") +ENDIF() + -SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "KERNEL_ROOT_DIR") -SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "GUI_ROOT_DIR") -SET(MODULE PARAVIS) +# User options +# (some options have already been defined in KERNEL) +# ============ +OPTION(SALOME_BUILD_DOC "Generate SALOME GUI documentation" ${SALOME_BUILD_DOC}) +OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ${SALOME_BUILD_TESTS}) +OPTION(SALOME_PARAVIS_MINIMAL_CORBA "Build PARAVIS with a minimal CORBA interface" OFF) +OPTION(SALOME_PARAVIS_BUILD_PLUGINS "Build PARAVIS plugins (MEDReader, etc ...)" ON) -SET(CMAKE_MODULE_PATH - "${KERNEL_ROOT_DIR}/salome_adm/cmake_files" - "${GUI_ROOT_DIR}/adm_local/cmake_files" - "${PROJECT_SOURCE_DIR}/adm_local/cmake_files") -INCLUDE(SalomeMacros) -INCLUDE(SalomeSetupPlatform) +# Prerequisites +# ============= +# Find "big" prerequisites first - they reference themselves many others +# -> this can help finding the smaller prerequisites and detect conficts. +# In our case KERNEL has already loaded many prereq which are also used in GUI: -FIND_PACKAGE(SalomeKERNEL REQUIRED) +## +## From KERNEL: +## -# From KERNEL: FIND_PACKAGE(SalomePython REQUIRED) -FIND_PACKAGE(SalomeOmniORB REQUIRED) -FIND_PACKAGE(SalomeOmniORBPy REQUIRED) -SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL_COMPILER}) -FIND_PACKAGE(SalomePThread REQUIRED) FIND_PACKAGE(SalomeHDF5 REQUIRED) -FIND_PACKAGE(SalomeBoost REQUIRED) -FIND_PACKAGE(SalomeLibXml2 REQUIRED) FIND_PACKAGE(SalomeSWIG REQUIRED) -FIND_PACKAGE(SalomeCppUnit REQUIRED) -FIND_PACKAGE(SalomeDoxygen REQUIRED) -# From GUI: part 1 (Qt must be checked before ParaView) +IF(NOT SALOME_LIGHT_ONLY) + FIND_PACKAGE(SalomeOmniORB REQUIRED) + FIND_PACKAGE(SalomeOmniORBPy REQUIRED) +ENDIF() + +#IF(SALOME_BUILD_TESTS) +# ENABLE_TESTING() +# FIND_PACKAGE(SalomeCppUnit) +# SALOME_LOG_OPTIONAL_PACKAGE(CppUnit SALOME_BUILD_TESTS) +#ENDIF() +IF(SALOME_BUILD_DOC) + FIND_PACKAGE(SalomeDoxygen) + FIND_PACKAGE(SalomeGraphviz) + FIND_PACKAGE(SalomeSphinx) + SALOME_LOG_OPTIONAL_PACKAGE(Doxygen SALOME_BUILD_DOC) + SALOME_LOG_OPTIONAL_PACKAGE(Graphviz SALOME_BUILD_DOC) + SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC) +ENDIF() + +## +## From GUI: part 1 (Qt must be checked before ParaView) +## FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtHelp) # This search for qhelpgenerator is required here # to avoid detecting native one due to bug in ParaViewMacros.cmake @@ -67,91 +125,149 @@ FIND_PROGRAM(QT_HELP_GENERATOR DOC "qhelpgenerator used to compile Qt help project files") MARK_AS_ADVANCED(QT_HELP_GENERATOR) -# Specific to ParaVis: -FIND_PACKAGE(SalomeParaView) +## +## Specific to ParaViS: +## +FIND_PACKAGE(SalomeParaView REQUIRED) -# GUI has to be loaded AFTER ParaView: the ParaView config doesn't mix +# 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) +ADD_DEFINITIONS(${GUI_DEFINITIONS}) +INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS}) -# From GUI: part 2 +## +## From GUI: part 2 +## FIND_PACKAGE(SalomeCAS REQUIRED) -FIND_PACKAGE(SalomeOpenGL REQUIRED) -FIND_PACKAGE(SalomeVTK REQUIRED) -FIND_PACKAGE(SalomeQwt REQUIRED) -FIND_PACKAGE(SalomeSIP REQUIRED) -FIND_PACKAGE(SalomePyQt4 REQUIRED) - -SET(VERSION_MAJOR 7) -SET(VERSION_MINOR 2) -SET(VERSION_MAINTENANCE 0) -SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}") -SET(XVERSION 0x0${VERSION_MAJOR}0${VERSION_MINOR}0${VERSION_MAINTENANCE}) -SET(VERSION_DEV 0) - -SET(BUILD_PLUGINS 1) - -#SET(VISU_ROOT_DIR $ENV{VISU_ROOT_DIR} CACHE PATH "VISU_ROOT_DIR") -#IF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) - #INCLUDE(${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) - #SET(WITH_VISU 1) -#ENDIF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) - -SET(MED_ROOT_DIR "$ENV{MED_ROOT_DIR}" CACHE PATH "Path to the MED Salome module") -LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files") -FIND_PACKAGE(SalomeMED REQUIRED) -FIND_PACKAGE(SalomeMEDFile REQUIRED) - -# 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) -EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIR0} - RESULT_VARIABLE _res) -IF(NOT _res EQUAL 0) - MESSAGE(FATAL_ERROR "Unable to run the Python script retrieving the list of VTK classes.") + +## +## From MED +## +IF(SALOME_PARAVIS_BUILD_PLUGINS) + SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "Path to the Salome MED module") + IF(EXISTS ${MED_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${MED_ROOT_DIR}/adm_local/cmake_files") + FIND_PACKAGE(SalomeMED REQUIRED) # Should load MEDFile too + ELSE() + MESSAGE(FATAL_ERROR "We absolutely need the Salome MED module to build plugins, please define MED_ROOT_DIR") + ENDIF() +ENDIF() + +## Detection summary: +SALOME_PACKAGE_REPORT_AND_CHECK() + +# Directories +# (default values taken from KERNEL) +# =========== +SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOME binaries") +SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs") +SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files") +SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers") +SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH + "Install path: SALOME scripts") +SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH + "Install path: SALOME script data") +SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH + "Install path: SALOME Python scripts") +SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff") +SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH + "Install path: SALOME Python shared modules") +SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: SALOME CMake files") +SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH + "Install path: local SALOME CMake files") +SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH + "Install path: local SALOME config files (obsolete, to be removed)") + +SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME resources") +SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation") + +# Specific to PARAVIS: +SET(SALOME_PARAVIS_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/paravis" CACHE PATH "Install path: SALOME PARAVIS specific data") + +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) +MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC SALOME_PARAVIS_INSTALL_RES_DATA) + +# Sources +# ======== +ADD_SUBDIRECTORY(src) + +IF(NOT SALOME_LIGHT_ONLY) + ADD_SUBDIRECTORY(idl) # Order matters when using the wrapping - to be added AFTER src +ENDIF() + +ADD_SUBDIRECTORY(adm_local) +ADD_SUBDIRECTORY(resources) + +IF(SALOME_BUILD_DOC) + ADD_SUBDIRECTORY(doc) ENDIF() +ADD_SUBDIRECTORY(bin) + +# Header configuration +# ==================== +SALOME_XVERSION(${PROJECT_NAME}) +SALOME_CONFIGURE_FILE(PARAVIS_version.h.in PARAVIS_version.h INSTALL ${SALOME_INSTALL_HEADERS}) + +# Configuration export +# (here only the level 1 prerequisites are exposed) +# ==================== +INCLUDE(CMakePackageConfigHelpers) + +# 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 +) + +# Add all targets to the build-tree export set +EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets} + FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake) + +# 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}") + +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 SIP_ROOT_DIR QT4_ROOT_DIR PYQT4_ROOT_DIR CAS_ROOT_DIR + OPENGL_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR) + +# - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?): +# Get the relative path of the include directory so +# we can register it in the generated configuration files: +#SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}") +#CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in +# ${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) + +WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + VERSION ${${PROJECT_NAME_UC}_VERSION} + COMPATIBILITY AnyNewerVersion) + +# Install the CMake configuration files: +INSTALL(FILES + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}") -SET(SUBDIRS - idl - adm_local - resources - src - doc - bin - ) - -SET(DISTCLEANFILES - wrapfiles.txt - ) - -INCLUDE(wrapfiles.cmake) - -SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVIS_version.h.in) -SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVIS_version.h) - -MESSAGE(STATUS "Creation of ${output}") -CONFIGURE_FILE(${input} ${output}) - -FOREACH(dir ${SUBDIRS}) - ADD_SUBDIRECTORY(${dir}) -ENDFOREACH(dir ${SUBDIRS}) - -# Reset CMAKE_CONFIGURATION_TYPES to the good value defined by CMAKE_BUILD_TYPE -IF(CMAKE_BUILD_TYPE) - IF(WINDOWS) - MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES) - SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE) - ENDIF(WINDOWS) -ENDIF(CMAKE_BUILD_TYPE) - -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PARAVIS_version.h DESTINATION include/salome) - -# Configure Testing -OPTION(BUILD_TESTING "Build ParaVis Testing" ON) -IF(BUILD_TESTING) - SET(PARAVIS_TEST_DIR ${ParaVis_BINARY_DIR}/Test/Temporary) - MAKE_DIRECTORY(${PARAVIS_TEST_DIR}) # TODO: replace with FILE(MAKE_DIRECTORY ...) - ENABLE_TESTING() - INCLUDE (CTest) - ADD_SUBDIRECTORY(test) -ENDIF(BUILD_TESTING) +# 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) diff --git a/SalomePARAVISConfig.cmake.in b/SalomePARAVISConfig.cmake.in new file mode 100644 index 00000000..0266beb6 --- /dev/null +++ b/SalomePARAVISConfig.cmake.in @@ -0,0 +1,112 @@ +# - Config file for the @PROJECT_NAME@ package +# It defines the following variables. +# Specific to the pacakge @PROJECT_NAME@ itself: +# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file +# + +############################################################### +# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# +# 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or +# email : webmaster.salome@opencascade.com +############################################################### + +### Initialisation performed by CONFIGURE_PACKAGE_CONFIG_FILE: +@PACKAGE_INIT@ + +# Load the dependencies for the libraries of @PROJECT_NAME@ +# (contains definitions for IMPORTED targets). This is only +# imported if we are not built as a subproject (in this case targets are already there) +IF(NOT TARGET Event AND NOT @PROJECT_NAME@_BINARY_DIR) + INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake") +ENDIF() + +# Package root dir: +SET_AND_CHECK(PARAVIS_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") + +# Include directories +SET_AND_CHECK(PARAVIS_INCLUDE_DIRS "${PARAVIS_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") +SET(PARAVIS_INCLUDE_DIRS "${PARAVIS_INCLUDE_DIRS};@_SalomePARAVIS_EXTRA_HEADERS@") +SET(PARAVIS_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_LIGHT_ONLY @SALOME_LIGHT_ONLY@) + +# Advanced options +SET(SALOME_USE_OCCVIEWER @SALOME_USE_OCCVIEWER@) +SET(SALOME_USE_GLVIEWER @SALOME_USE_GLVIEWER@) +SET(SALOME_USE_VTKVIEWER @SALOME_USE_VTKVIEWER@) +SET(SALOME_USE_PLOT2DVIEWER @SALOME_USE_PLOT2DVIEWER@) + +# Level 1 prerequisites: +SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@") +SET_AND_CHECK(SIP_ROOT_DIR_EXP "@PACKAGE_SIP_ROOT_DIR@") +SET_AND_CHECK(QT4_ROOT_DIR_EXP "@PACKAGE_QT4_ROOT_DIR@") +SET_AND_CHECK(PYQT4_ROOT_DIR_EXP "@PACKAGE_PYQT4_ROOT_DIR@") + +# Optional level 1 prerequisites: + +# 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 ) +SET(_PREREQ_CONFIG_DIR ) +LIST(LENGTH _PREREQ_CONFIG_DIR _list_len) +# Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... +MATH(EXPR _range "${_list_len}-1") +FOREACH(_p RANGE ${_range}) + LIST(GET _PREREQ ${_p} _pkg ) + LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir) + IF(_pkg_dir) + MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...") + FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE + PATHS "${_pkg_dir}" + NO_DEFAULT_PATH) + ENDIF() +ENDFOREACH() + +# Installation directories +SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@") +SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@") +SET(SALOME_INSTALL_IDLS "@SALOME_INSTALL_IDLS@") +SET(SALOME_INSTALL_HEADERS "@SALOME_INSTALL_HEADERS@") +SET(SALOME_INSTALL_SCRIPT_SCRIPTS "@SALOME_INSTALL_SCRIPT_SCRIPTS@") +SET(SALOME_INSTALL_SCRIPT_DATA "@SALOME_INSTALL_SCRIPT_DATA@") +SET(SALOME_INSTALL_SCRIPT_PYTHON "@SALOME_INSTALL_SCRIPT_PYTHON@") +SET(SALOME_INSTALL_APPLISKEL_SCRIPTS "@SALOME_INSTALL_APPLISKEL_SCRIPTS@") +SET(SALOME_INSTALL_APPLISKEL_PYTHON "@SALOME_INSTALL_APPLISKEL_PYTHON@") +SET(SALOME_INSTALL_CMAKE "@SALOME_INSTALL_CMAKE@") +SET(SALOME_INSTALL_CMAKE_LOCAL "@SALOME_INSTALL_CMAKE_LOCAL@") +SET(SALOME_INSTALL_PYTHON "@SALOME_INSTALL_PYTHON@") +SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@") +SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@") +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() + +# Exposed PARAVIS targets: diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt index a7af866f..b23aa695 100644 --- a/adm_local/cmake_files/CMakeLists.txt +++ b/adm_local/cmake_files/CMakeLists.txt @@ -17,4 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/FindSalomeParaView.cmake DESTINATION adm_local/cmake_files) +SET(_adm_data + FindSalomeParaView.cmake + ) + +INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL}) diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index 7f1ced89..b9d75112 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -23,4 +23,4 @@ SET(output ${CMAKE_CURRENT_BINARY_DIR}/VERSION) MESSAGE(STATUS "Creation of ${output}") CONFIGURE_FILE(${input} ${output}) -INSTALL(FILES paravis_setenv.py ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION bin/salome) +INSTALL(FILES paravis_setenv.py ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION ${SALOME_INSTALL_BINS}) diff --git a/getwrapclasses.py b/getwrapclasses.py deleted file mode 100644 index 5981372c..00000000 --- a/getwrapclasses.py +++ /dev/null @@ -1,158 +0,0 @@ -# Copyright (C) 2010-2013 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. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -import paraview, os, sys -import string -import re - -classeslistsm = [] -classeslistvtk = [] - -from vtkPVCommonPython import * -from vtkPVClientServerCoreCorePython import * -from vtkPVClientServerCoreDefaultPython import * -from vtkPVClientServerCoreRenderingPython import * -from vtkPVServerImplementationCorePython import * -from vtkPVServerImplementationDefaultPython import * -from vtkPVServerImplementationRenderingPython import * -from vtkPVServerManagerApplicationPython import * -from vtkPVServerManagerCorePython import * -from vtkPVServerManagerDefaultPython import * -from vtkPVServerManagerRenderingPython import * -try: - from vtkPVVTKExtensionsCorePython import * -except: - pass -try: - from vtkPVVTKExtensionsDefaultPython import * -except: - pass -try: - from vtkPVVTKExtensionsRenderingPython import * -except: - pass -try: - from vtkPVVTKExtensionsWebGLExporterPython import * -except: - pass - -l1 = dir() -for a in l1: - if a.startswith("vtk") and (len(a) > 3): - classeslistsm.append(a) - -from paraview.vtk import * -l2 = dir() - -for a in l2: - if (a not in l1) and a.startswith("vtk"): - classeslistvtk.append(a) - -dic=dict() - -non_wrap_list = ["vtkVariant", "vtkTimeStamp"] - -pv_classes_new=classeslistsm -while len(pv_classes_new): - pv_classes_cur=pv_classes_new - pv_classes_new=[] - for c in pv_classes_cur: - ## ignore non wrappable classes - if c in non_wrap_list: - continue - filename=sys.argv[1]+"/"+c+".h" - if os.path.isfile(filename): - c_new=[] - f=open(filename) - for line in f: - if re.match('\s*/',line) is None: - if re.match('\s*public\s*:',line): - continue - - m=re.match('\s*class\s+(vtk\w+)\s*;',line) - if m is not None: - cn=m.group(1) - if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase): - pv_classes_new.append(cn) - continue - - m=re.match('\s*struct\s+(vtk\w+)\s*;',line) - if m is not None: - cn=m.group(1) - if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase): - pv_classes_new.append(cn) - continue - - m=re.match('\s*#include\s+"(vtk\w+)\.h"',line) - if m is not None: - cn=m.group(1) - if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase): - pv_classes_new.append(cn) - continue - - cm=re.findall('public\s+(vtk\w+)',line) - if len(cm) == 0: - continue - for cn in cm: - ## do not extract Call Back classes - if cn.count('vtkClassMemberCallback'): - continue - if cn not in dic.keys() and cn not in pv_classes_new: - pv_classes_new.append(cn) - if cn not in c_new: - c_new.append(cn) - f.close() - dic[c]=[0, c_new] - - -pv_classes_sort=[] - -def collect_dic(cc): - ret=[] - for c in cc: - if c not in dic.keys(): - continue - if len(dic[c][1]) and dic[c][0] == 0: - ret+=collect_dic(dic[c][1]) - if dic[c][0] == 0: - ret.append(c) - dic[c][0]=1 - return ret - -pv_classes_sort=collect_dic(dic.keys()) - -wf_str="" -if(os.path.exists('wrapfiles.txt')): - wf_txt=open('wrapfiles.txt','r') - strs=wf_txt.readlines() - wf_txt.close() - for s in strs: - wf_str+=s -str="" - -for c in pv_classes_sort: - str+=c - for cc in dic[c][1]: - str+=' '+cc - str+='\n' - -if(str!=wf_str): - wf_txt=open('wrapfiles.txt','w') - wf_txt.write(str) - wf_txt.close() diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index f3706e0e..3789eb18 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -17,124 +17,35 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}) -SET(SOVERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}) - -ADD_DEFINITIONS(-DHAVE_SALOME_CONFIG) -INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} ${KERNEL_ROOT_DIR}/include/salome ${PROJECT_BINARY_DIR}/idl) - -INCLUDE(wrap.cmake) - - -SET(BASEIDL_FILES - PARAVIS_Gen_Types.idl +INCLUDE(UseOmniORB) # Provided by KERNEL + +INCLUDE_DIRECTORIES( + ${OMNIORB_INCLUDE_DIR} + ${PROJECT_BINARY_DIR}/idl +) + +IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) + INCLUDE(wrap.cmake) + # Hack to have a -D on the omniidl command line: + # (again, this shouldn't last for long ...) + SET(OMNIORB_IDLCXXFLAGS "${OMNIORB_IDLCXXFLAGS};-DPARAVIS_WITH_FULL_CORBA") + ADD_DEFINITIONS(-DPARAVIS_WITH_FULL_CORBA) +ENDIF() + +SET(SalomeIDLPARAVIS_IDLSOURCES PARAVIS_Gen.idl + PARAVIS_Gen_Types.idl + ${WRAP_IDL} ) -SET(BASEIDL_SK_FILES - PARAVIS_Gen_TypesSK.cc - PARAVIS_GenSK.cc - ) - -# potential problem on parallel make on the following - multiple outputs -SET(SUFFIXES - .idl - .hh - SK.cc - ) - -SET(srcs) -FOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES}) - SET(srcs ${srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) -ENDFOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES}) - -IF(WINDOWS) -ADD_LIBRARY(SalomeIDLPARAVIS STATIC ${srcs}) -ELSE(WINDOWS) -ADD_LIBRARY(SalomeIDLPARAVIS SHARED ${srcs}) -ENDIF(WINDOWS) - -SET(flags) -FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${OMNIORB_DEFINITIONS} ${KERNEL_CXXFLAGS}) - SET(flags "${flags} ${f}") -ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${OMNIORB_DEFINITIONS} ${KERNEL_CXXFLAGS}) - -SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES COMPILE_FLAGS "${flags}") -SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) - -TARGET_LINK_LIBRARIES(SalomeIDLPARAVIS ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${OMNIORB_LIBRARIES}) -INSTALL(TARGETS SalomeIDLPARAVIS DESTINATION lib/salome) - -ADD_EXECUTABLE(vtkWrapIDL - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParse.tab.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParsePreprocess.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseHierarchy.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseExtras.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseMain.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseData.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseString.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkWrap.c -# ${PROJECT_SOURCE_DIR}/src/ParaView/vtkWrapText.c - ${CMAKE_CURRENT_SOURCE_DIR}/vtkWrapIDL.c) - -set_property(SOURCE ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseMain.c PROPERTY COMPILE_DEFINITIONS - VTK_PARSE_VERSION="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") - -ADD_DEPENDENCIES(vtkWrapIDL generate_txt) - -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src/ParaView) -SET(flags) -FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES}) - SET(flags "${flags} ${f}") -ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES}) - -#VTN TODO: vtkParseData supports two types of structures for wrapping. -#We use old structures currently, but is is not influent for results of wrapping. -#It may be necessary to port vtkWrapIDL to new approach in future. -#IF(VTK_LEGACY_REMOVE) -# ADD_DEFINITIONS(-DVTK_PARSE_LEGACY_REMOVE) -#ENDIF() -SET_TARGET_PROPERTIES(vtkWrapIDL PROPERTIES COMPILE_FLAGS "${flags}") - -TARGET_LINK_LIBRARIES(vtkWrapIDL ${PLATFORM_LDFLAGS} ${PLATFORM_LIBADD}) -SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL) -IF(WINDOWS) - IF(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL.exe) - ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL.exe) - ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) -ENDIF(WINDOWS) -INSTALL(FILES ${vtkWrapIDL_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - -FOREACH(input ${BASEIDL_FILES} ${WRAP_IDL}) - STRING(REGEX REPLACE ".idl" "" base ${input}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc) - SET(outputs ${src}) - SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc) - SET(outputs ${outputs} ${dynsrc}) - SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) - SET(outputs ${outputs} ${inc}) - LIST(FIND BASEIDL_FILES ${input} BASE_INDEX) - IF(${BASE_INDEX} EQUAL -1) - SET(input ${CMAKE_CURRENT_BINARY_DIR}/${input}) - ELSE(${BASE_INDEX} EQUAL -1) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) - ENDIF(${BASE_INDEX} EQUAL -1) - ADD_CUSTOM_COMMAND( - OUTPUT ${outputs} - COMMAND ${OMNIORB_IDL_PYTHON} ${OMNIORB_IDLCXXFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome ${input} - MAIN_DEPENDENCY ${input} - ) - INSTALL(FILES ${input} DESTINATION idl/salome) +SET(_idl_include_dirs + ${CMAKE_CURRENT_SOURCE_DIR} + ${KERNEL_ROOT_DIR}/idl/salome +) - SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) - INSTALL(FILES ${IDL_HEADER} DESTINATION include/salome) - INSTALL(CODE "SET(IDL_FILE ${input})") - INSTALL(CODE "SET(DIR lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome)") - INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})") - INSTALL(CODE "SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL_PYTHON})") - INSTALL(CODE "SET(IDLPYFLAGS -bpythonIDL -p${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome)") - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/install_python_from_idl.cmake) +SET(_idl_link_flags + ${KERNEL_SalomeIDLKernel} +) -ENDFOREACH(input ${IDL_FILES}) +OMNIORB_ADD_MODULE(SalomeIDLPARAVIS "${SalomeIDLPARAVIS_IDLSOURCES}" "${_idl_include_dirs}" "${_idl_link_flags}") +INSTALL(TARGETS SalomeIDLPARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) diff --git a/idl/PARAVIS_Gen.idl b/idl/PARAVIS_Gen.idl index acaa0eb3..9708f247 100644 --- a/idl/PARAVIS_Gen.idl +++ b/idl/PARAVIS_Gen.idl @@ -82,6 +82,7 @@ module PARAVIS { */ void SaveTrace(in string theFileName); +#ifdef PARAVIS_WITH_FULL_CORBA /*! * \brief Returns list of names of extracted Paraview and VTK classes */ @@ -91,6 +92,7 @@ module PARAVIS { * \brief Returns container class for the requested Paraview class */ PARAVIS_Base CreateClass(in string theClassName); +#endif /*! * Returns parameters of current (usually built-in) connection which is active in GUI (Paraview client). diff --git a/idl/wrap.cmake b/idl/wrap.cmake index b442571a..64063d43 100755 --- a/idl/wrap.cmake +++ b/idl/wrap.cmake @@ -33,7 +33,7 @@ ADD_CUSTOM_COMMAND( ) SET(WRAP_IDL) -SET(WRAP_SK_FILES) +#SET(WRAP_SK_FILES) IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) EXECUTE_PROCESS( @@ -60,9 +60,9 @@ IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) ENDIF(WRAP_LEN GREATER 1) - SET(WRAP_IDL ${WRAP_IDL} PARAVIS_Gen_${VAL}.idl) - SET(WRAP_SK_FILES ${WRAP_SK_FILES} PARAVIS_Gen_${VAL}SK.cc) - SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL) + LIST(APPEND WRAP_IDL PARAVIS_Gen_${VAL}.idl) + #SET(WRAP_SK_FILES ${WRAP_SK_FILES} PARAVIS_Gen_${VAL}SK.cc) + SET(vtkWrapIDL_EXEFILE ${PROJECT_BINARY_DIR}/src/VTKWrapping/vtkWrapIDL) IF(WINDOWS) IF(CMAKE_BUILD_TOOL STREQUAL nmake) SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL.exe) @@ -81,3 +81,5 @@ ENDIF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) ADD_CUSTOM_TARGET(generate_txt DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt vtkWrapIDL.h hints) ADD_CUSTOM_TARGET(generate_idl ALL DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt vtkWrapIDL.h hints ${WRAP_IDL}) + + diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index 85a0133d..90c4f604 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -32,7 +32,7 @@ SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVISCatalog.xml) MESSAGE(STATUS "Creation of ${output}") CONFIGURE_FILE(${input} ${output}) -INSTALL(FILES ${output} DESTINATION share/salome/resources/paravis) +INSTALL(FILES ${output} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA}) SET(input ${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in) SET(output ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml) @@ -40,8 +40,8 @@ SET(output ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml) MESSAGE(STATUS "Creation of ${output}") CONFIGURE_FILE(${input} ${output}) -INSTALL(FILES ${output} DESTINATION share/salome/resources/paravis) +INSTALL(FILES ${output} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA}) FOREACH(f ${dist_salomeres_DATA}) - INSTALL(FILES ${f} DESTINATION share/salome/resources/paravis) + INSTALL(FILES ${f} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA}) ENDFOREACH(f ${dist_salomeres_DATA}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 843f402e..3aa7a985 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,20 +17,27 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(SUBDIRS +SET(_subdirs ENGINE PVGUI PV_SWIG Macro ) + +IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) + # Append in first position + LIST(INSERT _subdirs 0 VTKWrapping) + ADD_DEFINITIONS(-DPARAVIS_WITH_FULL_CORBA) +ENDIF() -IF(BUILD_PLUGINS) - SET(SUBDIRS - ${SUBDIRS} - Plugins - ) -ENDIF(BUILD_PLUGINS) +IF(SALOME_PARAVIS_BUILD_PLUGINS) + LIST(APPEND _subdirs Plugins) +ENDIF() -FOREACH(dir ${SUBDIRS}) +FOREACH(dir ${_subdirs}) ADD_SUBDIRECTORY(${dir}) -ENDFOREACH(dir ${SUBDIRS}) +ENDFOREACH() + +SET(WRAP_IDL_I_HH "${WRAP_IDL_I_HH}" PARENT_SCOPE) +SET(WRAP_IDL_I_CC "${WRAP_IDL_I_CC}" PARENT_SCOPE) + diff --git a/src/ENGINE/CMakeLists.txt b/src/ENGINE/CMakeLists.txt index 053a3a16..9c84f52c 100644 --- a/src/ENGINE/CMakeLists.txt +++ b/src/ENGINE/CMakeLists.txt @@ -17,25 +17,20 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}) -SET(SOVERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}) +INCLUDE_DIRECTORIES( + ${OMNIORB_INCLUDE_DIR} + ${KERNEL_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR}/idl) -ADD_DEFINITIONS(-DHAVE_SALOME_CONFIG) -INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} ${KERNEL_ROOT_DIR}/include/salome ${PROJECT_BINARY_DIR}/idl) +ADD_DEFINITIONS(${KERNEL_DEFINITIONS}) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -ADD_LIBRARY(PARAVISEngine SHARED PARAVIS_Engine_i.cc) +ADD_LIBRARY(PARAVISEngine PARAVIS_Engine_i.cc) -SET(flags) -FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${KERNEL_CXXFLAGS} ${OMNIORB_DEFINITIONS}) - SET(flags "${flags} ${f}") -ENDFOREACH(f ${var}) - -SET_TARGET_PROPERTIES(PARAVISEngine PROPERTIES COMPILE_FLAGS "${flags}") -SET_TARGET_PROPERTIES(PARAVISEngine PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) - -TARGET_LINK_LIBRARIES(PARAVISEngine ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${KERNEL_LDFLAGS} +TARGET_LINK_LIBRARIES(PARAVISEngine ${KERNEL_SalomeIDLKernel} ${KERNEL_SalomeNS} ${KERNEL_SalomeContainer} ${KERNEL_SALOMELocalTrace} - ${OMNIORB_LIBRARIES} SalomeIDLPARAVIS) -INSTALL(TARGETS PARAVISEngine DESTINATION lib/salome) + ${OMNIORB_LIBRARIES} + SalomeIDLPARAVIS) +INSTALL(TARGETS PARAVISEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -INSTALL(FILES PARAVIS_Engine_i.hh DESTINATION include/salome) +INSTALL(FILES PARAVIS_Engine_i.hh DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/ENGINE/PARAVIS_Engine_i.cc b/src/ENGINE/PARAVIS_Engine_i.cc index 6d4e99b5..3f53d0a8 100644 --- a/src/ENGINE/PARAVIS_Engine_i.cc +++ b/src/ENGINE/PARAVIS_Engine_i.cc @@ -257,6 +257,7 @@ namespace PARAVIS { return myParaVisGen->PasteInto(theStream,theObjectID,theObject); } +#ifdef PARAVIS_WITH_FULL_CORBA //=========================================================================== PARAVIS::string_array* PARAVIS_Gen_i::GetClassesList() { @@ -268,6 +269,7 @@ namespace PARAVIS { { return myParaVisGen->CreateClass(theClassName); } +#endif //=========================================================================== void PARAVIS_Gen_i::GetConnectionParameters(CORBA::Long& theId, diff --git a/src/ENGINE/PARAVIS_Engine_i.hh b/src/ENGINE/PARAVIS_Engine_i.hh index 732b236f..643d119d 100644 --- a/src/ENGINE/PARAVIS_Engine_i.hh +++ b/src/ENGINE/PARAVIS_Engine_i.hh @@ -103,9 +103,10 @@ namespace PARAVIS virtual SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream, CORBA::Long theObjectID, SALOMEDS::SObject_ptr theObject); - +#ifdef PARAVIS_WITH_FULL_CORBA virtual PARAVIS::string_array* GetClassesList(); virtual PARAVIS_Base_ptr CreateClass(const char* theClassName); +#endif virtual void GetConnectionParameters(CORBA::Long& theId, CORBA::String_out theDHost, CORBA::Long& theDPort, CORBA::String_out theRHost, CORBA::Long& theRPort, diff --git a/src/Macro/CMakeLists.txt b/src/Macro/CMakeLists.txt index 3562651f..455de015 100644 --- a/src/Macro/CMakeLists.txt +++ b/src/Macro/CMakeLists.txt @@ -17,10 +17,8 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -#FILE(GLOB copy_FILES "*py") -#INSTALL(FILES ${copy_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/salome/Macros) -INSTALL(DIRECTORY ${PROJECT_SOURCE_DIR}/src/Macro - DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/salome - FILES_MATCHING PATTERN "*.py" - PATTERN "CVS" EXCLUDE - ) +SET(_PYFILES_TO_INSTALL + modes.py + ) + +INSTALL_AND_COMPILE_PYTHON_FILE("${_PYFILES_TO_INSTALL}" ${SALOME_INSTALL_SCRIPT_PYTHON}) diff --git a/src/PVGUI/CMakeLists.txt b/src/PVGUI/CMakeLists.txt index 1e250244..bb6e15ff 100644 --- a/src/PVGUI/CMakeLists.txt +++ b/src/PVGUI/CMakeLists.txt @@ -17,241 +17,181 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}) -SET(SOVERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}) +INCLUDE(UseQt4Ext) -ADD_DEFINITIONS(-DHAVE_SALOME_CONFIG ${CAS_DEFINITIONS}) +# --- options --- INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} - ${KERNEL_ROOT_DIR}/include/salome - ${GUI_ROOT_DIR}/include/salome - ${CMAKE_CURRENT_SOURCE_DIR}/../ParaView + ${KERNEL_INCLUDE_DIRS} + ${GUI_INCLUDE_DIRS} ${PROJECT_BINARY_DIR}/idl ${PROJECT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} ${CAS_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${QT_INCLUDES} + ${CMAKE_CURRENT_SOURCE_DIR} ) -INCLUDE(${QT_USE_FILE}) - -#IF(WITH_VISU) -# SET(VISU_PARAVIS_LIBS -# ${SalomeIDLVISU} -# ) -# -# ADD_DEFINITIONS(-DWITH_VISU) -#ENDIF(WITH_VISU) +# additional preprocessor / compiler flags +ADD_DEFINITIONS(${CAS_DEFINITIONS}) +ADD_DEFINITIONS(${KERNEL_DEFINITIONS}) +ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}) -#Executable -SET(bin_PROGRAMS - vtkWrapIDL_HH - vtkWrapIDL_CC +# libraries to link to +SET(_PARAVIEW_APP_COMPO_LIB + pqApplicationComponents ) -SET(vtkWrapIDL_HH_CPPFLAGS - -DIDL_I_HH - ) +SET(_link_LIBRARIES + ${OMNIORB_LIBRARIES} + ${QT_LIBS} + ${CAS_KERNEL} + ${PYTHON_LIBS} + ${KERNEL_LDFLAGS} ${KERNEL_SalomeDS} ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeIDLKernel} + ${KERNEL_SalomeNS} ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeContainer} ${KERNEL_TOOLSDS} + ${GUI_LDFLAGS} ${GUI_SalomeApp} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit} ${GUI_Event} ${GUI_PyInterp} + ${GUI_SalomeObject} ${GUI_vtkTools} + ${MED_SalomeIDLMED} + ${_PARAVIEW_APP_COMPO_LIB} + SalomeIDLPARAVIS +) -SET(vtkWrapIDL_CC_CPPFLAGS - -DIDL_I_CC - ) -#VTN TODO: vtkParseData supports two types of structures for wrapping. -#We use old structures currently, but is is not influent for results of wrapping. -#It may be necessary to port vtkWrapIDL to new approach in future. -#IF(VTK_LEGACY_REMOVE) -# ADD_DEFINITIONS(-DVTK_PARSE_LEGACY_REMOVE) -#ENDIF() +# --- headers --- -INCLUDE(wrap.cmake) +# header files / to be processed by moc +SET(_moc_HEADERS + PVGUI_Module.h + PVGUI_ViewManager.h + PVGUI_ViewModel.h + PVGUI_ViewWindow.h + PVGUI_ParaViewSettingsPane.h +) + +# header files / no moc processing +SET(_other_HEADERS + PVGUI_OutputWindowAdapter.h + PVGUI_Tools.h + PVGUI_MatplotlibMathTextUtilities.h + PV_I.h + PARAVIS_Gen_i.hh + PV_Events.h + PV_Tools.h +) + +# header files / to install +SET(PVGUI_HEADERS ${_moc_HEADERS} ${_other_HEADERS}) -INCLUDE(${ParaView_CMAKE_DIR}/vtkWrapClientServer.cmake) +# --- resources --- + +# resource files / to be processed by lrelease +SET(_ts_RESOURCES + resources/PARAVIS_images.ts + resources/PARAVIS_msg_en.ts + resources/PARAVIS_msg_fr.ts +) + +# resource files / static +SET(_other_RESOURCES + # sampleservers.pvsc ??? +) + +IF(SALOME_BUILD_DOC) + # --- ParaView documentation is built as a resource --- + # Check ParaView documentation file existence + # if it exists add it to the resources (compile into binary form) + # otherwise print warning message + SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch) + IF (EXISTS ${PV_DOC_FILE}) + SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in) + SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc) + MESSAGE(STATUS "Creation of ${RC_GENERATED}") + CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED}) + SET(_rcc_RESOURCES ${RC_GENERATED}) + ADD_DEFINITIONS(-DHAS_PV_DOC) + ELSE () + MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.") + ENDIF () +ENDIF() + +# --- sources --- + +# sources / rcc wrappings +QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES}) + +# sources / moc wrappings +QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS}) + +# sources / EDF specific stuff +INCLUDE(vtkWrapClientServer) VTK_WRAP_ClientServer(vtkEDFCutterCS vtkEDFCutter_SRCS ${GUI_ROOT_DIR}/include/salome/vtkEDFCutter.h) -# Library sources -SET(dist_libPARAVIS_la_SOURCES - PVGUI_Module.h +# sources / static +SET(_other_SOURCES PVGUI_Module.cxx PVGUI_Module_actions.cxx PVGUI_Module_widgets.cxx - PVGUI_ViewManager.h PVGUI_ViewManager.cxx - PVGUI_ViewModel.h PVGUI_ViewModel.cxx - PVGUI_ViewWindow.h PVGUI_ViewWindow.cxx - PVGUI_OutputWindowAdapter.h PVGUI_OutputWindowAdapter.cxx - PVGUI_Tools.h PVGUI_Tools.cxx - PVGUI_ParaViewSettingsPane.h PVGUI_ParaViewSettingsPane.cxx - PVGUI_MatplotlibMathTextUtilities.h PVGUI_MatplotlibMathTextUtilities.cxx - PV_I.h - PARAVIS_Gen_i.hh - PV_Events.h - PV_Tools.h PARAVIS_Gen_i.cc PV_Tools.cxx - ${WRAP_IDL_I_HH} - ${WRAP_IDL_I_CC} - PARAVIS_CreateClass.cxx - ${vtkEDFCutter_SRCS} ) -# Check ParaView documentation file existence -# if it exists add it to the resources (compile into binary form) -# otherwise print warning message -SET(PV_DOC_FILE ${VTK_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch) -IF (EXISTS ${PV_DOC_FILE}) - SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in) - SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc) - MESSAGE(STATUS "Creation of ${RC_GENERATED}") - CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED}) - QT4_ADD_RESOURCES(RCS_SOURCES ${RC_GENERATED}) - SET(dist_libPARAVIS_la_SOURCES ${dist_libPARAVIS_la_SOURCES} ${RCS_SOURCES}) - ADD_DEFINITIONS(-DHAS_PV_DOC) -ELSE (EXISTS ${PV_DOC_FILE}) - MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.") -ENDIF (EXISTS ${PV_DOC_FILE}) - -# MOC pre-processing -SET(MOC_FILES - PVGUI_Module_moc.cxx - PVGUI_ViewManager_moc.cxx - PVGUI_ViewModel_moc.cxx - PVGUI_ViewWindow_moc.cxx - PVGUI_ParaViewSettingsPane_moc.cxx +IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) + SET(_VTK_wrap_SOURCES + PARAVIS_CreateClass.cxx + $ ) - -# additionnal compilation flags -# Note that ParaView uses HDF5 -SET(libPARAVIS_la_CPPFLAGS - -ftemplate-depth-32 - ${QT_ASSISTANT_INCLUDES} - ${PYTHON_INCLUDES} - ${CAS_CPPFLAGS} - ${CAS_CXXFLAGS} - ${KERNEL_CXXFLAGS} - ${OMNIORB_DEFINITIONS} - ${BOOST_CPPFLAGS} - ${GUI_CXXFLAGS} - ${MED_CXXFLAGS} - ${VISU_CXXFLAGS} - ${VISU_PARAVIS_DEFINES} +ENDIF() + +# sources / to compile +SET(PVGUI_SOURCES + ${_other_SOURCES} + ${_moc_SOURCES} + ${_rcc_SOURCES} + ${vtkEDFCutter_SRCS} + ${_VTK_wrap_SOURCES} ) -# remove deprecation warnings from Paraview -IF(WINDOWS) -ELSE(WINDOWS) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") -ENDIF(WINDOWS) +# --- rules --- -# resources files -SET(nodist_salomeres_DATA - PARAVIS_images.qm - PARAVIS_msg_en.qm - PARAVIS_msg_fr.qm +IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) + ADD_CUSTOM_COMMAND( + OUTPUT PARAVIS_CreateClass.cxx + COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/VTKWrapping/create_class.py ${CMAKE_BINARY_DIR} + DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt + ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen.hh + ${PROJECT_BINARY_DIR}/idl/PARAVIS_Gen_Types.hh + SalomeIDLPARAVIS + generate_implements ) -SET(srcs) -FOREACH(src ${dist_libPARAVIS_la_SOURCES}) - SET(srcs ${srcs} ${src}) -ENDFOREACH(src ${dist_libPARAVIS_la_SOURCES}) - -FOREACH(f ${MOC_FILES}) - SET(srcs ${srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) -ENDFOREACH(f ${MOC_FILES}) - -ADD_LIBRARY(PARAVIS SHARED ${srcs}) - -SET(flags) -FOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${libPARAVIS_la_CPPFLAGS}) - SET(flags "${flags} ${f}") -ENDFOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${libPARAVIS_la_CPPFLAGS}) + # All wrapping tools have to be build before generating the above module - NEEDED? + ###ADD_DEPENDENCIES(SalomeIDLPARAVIS vtkWrapIDL_HH vtkWrapIDL_CC vtkWrapIDL) -SET_TARGET_PROPERTIES(PARAVIS PROPERTIES COMPILE_FLAGS "${flags}") -SET_TARGET_PROPERTIES(PARAVIS PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) - -#FIND_PACKAGE(VTK 6.0 COMPONENTS vtkPVClientServerCoreCore vtkPVServerImplementationCore NO_MODULE) -#SET(VTK_LIBS vtkPVClientServerCoreCore vtkPVServerImplementationCore) -SET(VTK_LIBS) -FIND_PACKAGE(ParaView COMPONENTS pqApplicationComponents NO_MODULE) -SET(PARAVIEW_LIBS pqApplicationComponents) + # Intermediate target used in PVGUI directory (we can not cross reference + # a generated source file across directories, hence this trick): + INCLUDE_DIRECTORIES( + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_BINARY_DIR}/src/VTKWrapping + ) +ENDIF() -TARGET_LINK_LIBRARIES(PARAVIS - ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} - ${OMNIORB_LIBRARIES} - ${QT_LIBS} - ${CAS_KERNEL} - ${VTK_LIBS} - ${PYTHON_LIBS} - ${KERNEL_LDFLAGS} ${KERNEL_SalomeDS} ${KERNEL_SALOMELocalTrace} ${KERNEL_SalomeIDLKernel} - ${KERNEL_SalomeNS} ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeContainer} ${KERNEL_TOOLSDS} - ${GUI_LDFLAGS} ${GUI_SalomeApp} ${GUI_LightApp} ${GUI_CAM} ${GUI_qtx} ${GUI_suit} ${GUI_Event} ${GUI_PyInterp} - ${GUI_SalomeObject} ${GUI_vtkTools} - ${MED_LDFLAGS} ${MED_SalomeIDLMED} - ${VISU_LDFLAGS} - ${VISU_PARAVIS_LIBS} - ${PARAVIEW_LIBS} - SalomeIDLPARAVIS -) -INSTALL(TARGETS PARAVIS DESTINATION lib/salome) +ADD_LIBRARY(PARAVIS ${PVGUI_SOURCES}) +IF(NOT SALOME_PARAVIS_MINIMAL_CORBA) + # Make sure the generation of the VTK wrapping get executed first: + ADD_DEPENDENCIES(PARAVIS PARAVIS_CreateClass.cxx) +ENDIF() -FOREACH(name ${bin_PROGRAMS}) - ADD_EXECUTABLE(${name} - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParse.tab.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParsePreprocess.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseHierarchy.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseExtras.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseMain.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseData.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseString.c - ${PROJECT_SOURCE_DIR}/src/ParaView/vtkWrap.c -# ${PROJECT_SOURCE_DIR}/src/ParaView/vtkWrapText.c - ${PROJECT_SOURCE_DIR}/idl/vtkWrapIDL.c) - ADD_DEPENDENCIES(${name} generate_txt) - - set_property(SOURCE ${PROJECT_SOURCE_DIR}/src/ParaView/vtkParseMain.c PROPERTY COMPILE_DEFINITIONS - VTK_PARSE_VERSION="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") +TARGET_LINK_LIBRARIES(PARAVIS ${_link_LIBRARIES}) +INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) - SET(flags) - FOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) - SET(flags "${flags} ${f}") - ENDFOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) - - SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") - TARGET_LINK_LIBRARIES(${name} ${PLATFORM_LIBADD}) - - SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}) - IF(WINDOWS) - IF(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}.exe) - ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${name}.exe) - ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) - ENDIF(WINDOWS) - INSTALL(FILES ${${name}_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) -ENDFOREACH(name ${bin_PROGRAMS}) -FOREACH(output ${MOC_FILES}) - STRING(REGEX REPLACE _moc.cxx .h input ${output}) - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output}) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND ${QT_MOC_EXECUTABLE} ${MOC_FLAGS} ${input} -o ${output} - MAIN_DEPENDENCY ${input} - ) -ENDFOREACH(output ${MOC_FILES}) - -FOREACH(f ${nodist_salomeres_DATA}) - STRING(REGEX REPLACE .qm .ts input ${f}) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - INSTALL(FILES ${output} DESTINATION share/salome/resources/paravis) -ENDFOREACH(f ${nodist_salomeres_DATA}) +# --- header and resources installation --- +INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}") +INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA}) diff --git a/src/PVGUI/PARAVIS_Gen_i.cc b/src/PVGUI/PARAVIS_Gen_i.cc index f0d49019..e0c03499 100644 --- a/src/PVGUI/PARAVIS_Gen_i.cc +++ b/src/PVGUI/PARAVIS_Gen_i.cc @@ -48,7 +48,10 @@ #include "QDir" #include "QTextStream" -#include "vtkWrapIDL.h" +#ifdef PARAVIS_WITH_FULL_CORBA + // List of VTK classes wrapped into IDL: +# include "vtkWrapIDL.h" +#endif #include #include @@ -593,6 +596,7 @@ namespace PARAVIS return SALOMEDS::SObject::_nil(); } +#ifdef PARAVIS_WITH_FULL_CORBA //---------------------------------------------------------------------------- PARAVIS::string_array* PARAVIS_Gen_i::GetClassesList() { @@ -611,6 +615,7 @@ namespace PARAVIS PARAVIS::PARAVIS_Base_i* aClass = CreateInstance(NULL, QString(theClassName)); return aClass->_this(); } +#endif //---------------------------------------------------------------------------- void PARAVIS_Gen_i::GetConnectionParameters(CORBA::Long& theId, @@ -729,7 +734,7 @@ namespace PARAVIS // Version information char* PARAVIS_Gen_i::getVersion() { -#if PARAVIS_DEVELOPMENT +#ifdef PARAVIS_DEVELOPMENT return CORBA::string_dup( PARAVIS_VERSION_STR"dev" ); #else return CORBA::string_dup( PARAVIS_VERSION_STR ); diff --git a/src/PVGUI/PARAVIS_Gen_i.hh b/src/PVGUI/PARAVIS_Gen_i.hh index d023cb7b..3e50fdb9 100644 --- a/src/PVGUI/PARAVIS_Gen_i.hh +++ b/src/PVGUI/PARAVIS_Gen_i.hh @@ -182,11 +182,13 @@ namespace PARAVIS //! inherited methods from Engines::EngineComponent. Returns module version. virtual char* getVersion(); +#ifdef PARAVIS_WITH_FULL_CORBA //! Implementation of PARAVIS_Gen interface virtual PARAVIS::string_array* GetClassesList(); //! Implementation of PARAVIS_Gen interface virtual PARAVIS_Base_ptr CreateClass(const char* theClassName); +#endif //! Implementation of PARAVIS_Gen interface virtual void GetConnectionParameters(CORBA::Long& theId, diff --git a/src/PVGUI/create_class.py b/src/PVGUI/create_class.py deleted file mode 100755 index 4532eda0..00000000 --- a/src/PVGUI/create_class.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash -# Copyright (C) 2010-2013 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. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -import sys -import os - -ffile = "PARAVIS_CreateClass.cxx" -wfile = os.path.join(sys.argv[1], "wrapfiles.txt") - -ffile_stream = open(ffile, "w") - -ffile_stream.write('#include ' + '\n') -ffile_stream.write('#include ' + '\n') -ffile_stream.write('#include "PARAVIS_Gen_i.hh"' + '\n') -wfile_stream = open(wfile) -for line in wfile_stream: - if line.split()[0] == "vtkWebGLExporter" : - ffile_stream.write('#ifdef WIN32\n') - ffile_stream.write(' #ifdef GetObject\n') - ffile_stream.write(' #undef GetObject\n') - ffile_stream.write(' #endif\n') - ffile_stream.write('#endif\n') - pass - ffile_stream.write('#include "PARAVIS_Gen_%s_i.hh"'%(line.split()[0]) + '\n') - pass -wfile_stream.close() -ffile_stream.write('' + '\n') -ffile_stream.write('PARAVIS::PARAVIS_Base_i* CreateInstance(::vtkObjectBase* Inst, const QString& theClassName)' + '\n') -ffile_stream.write('{' + '\n') -wfile_stream = open(wfile) -lst = [] -for line in wfile_stream: - lst.append(line.split()[0]) - pass -wfile_stream.close() -lst.reverse() -for item in lst: - ffile_stream.write(' if(theClassName == "%s" || (Inst != NULL && Inst->IsA("%s")))'%(item, item) + '\n') - ffile_stream.write(' return new PARAVIS::%s_i();'%(item) + '\n') - pass -ffile_stream.write('' + '\n') -ffile_stream.write(' cerr << "The class " << theClassName.toStdString() << " is not created!" << endl;' + '\n') -ffile_stream.write(' return new PARAVIS::PARAVIS_Base_i();' + '\n') -ffile_stream.write('}' + '\n') -ffile_stream.close() diff --git a/src/PVGUI/create_class.sh b/src/PVGUI/create_class.sh deleted file mode 100755 index 8c2b8e01..00000000 --- a/src/PVGUI/create_class.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# Copyright (C) 2010-2013 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. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -file=PARAVIS_CreateClass.cxx -wfile=$1/wrapfiles.txt - -echo '#include ' > $file -echo '#include ' >> $file -echo '#include "PARAVIS_Gen_i.hh"' >> $file -awk '{print "#include \"PARAVIS_Gen_"$1"_i.hh\"";}' $wfile >> $file -echo '' >> $file -echo 'PARAVIS::PARAVIS_Base_i* CreateInstance(::vtkObjectBase* Inst, const QString& theClassName)' >> $file -echo '{' >> $file -awk 'BEGIN {lst="";} {lst=lst" "$1;} END{i=split(lst,arr);for(j=i;j>0;j--) {print " if(theClassName == \""arr[j]"\" || (Inst != NULL && Inst->IsA(\""arr[j]"\")))";print " return new PARAVIS::"arr[j]"_i();"}}' $wfile >> $file -echo '' >> $file -echo ' cerr << "The class " << theClassName.toStdString() << " is not created!" << endl;' >> $file -echo ' return new PARAVIS::PARAVIS_Base_i();' >> $file -echo '}' >> $file diff --git a/src/PVGUI/wrap.cmake b/src/PVGUI/wrap.cmake deleted file mode 100755 index ff9939f4..00000000 --- a/src/PVGUI/wrap.cmake +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright (C) 2010-2013 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. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -LIST(GET PARAVIEW_INCLUDE_DIRS 0 PARAVIEW_INCLUDE_DIR0) - -SET(WRAP_IDL_I_HH) -SET(WRAP_IDL_I_CC) - -IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) - EXECUTE_PROCESS( - COMMAND ${PYTHON_EXECUTABLE} -c "f = open('${CMAKE_BINARY_DIR}/wrapfiles.txt') ; print f.read(), ; f.close()" - OUTPUT_VARIABLE WRAP_LIST_FULL - ) - - STRING(REGEX MATCHALL "[^\n]+" WRAP_LIST_REG ${WRAP_LIST_FULL}) - FOREACH(STR ${WRAP_LIST_REG}) - - SEPARATE_ARGUMENTS(STR) - LIST(LENGTH STR WRAP_LEN) - SET(DEP_HH) - SET(DEP_CC) - - LIST(GET STR 0 VAL) - - IF(WRAP_LEN GREATER 1) - MATH(EXPR WRAP_LEN1 "${WRAP_LEN} - 1" ) - - FOREACH(IND RANGE 1 ${WRAP_LEN1}) - LIST(GET STR ${IND} DEP_VAL) - SET(DEP_HH ${DEP_HH} PARAVIS_Gen_${DEP_VAL}_i.hh) - SET(DEP_CC ${DEP_CC} PARAVIS_Gen_${DEP_VAL}_i.cc) - ENDFOREACH(IND RANGE 1 ${WRAP_LEN1}) - - ENDIF(WRAP_LEN GREATER 1) - - SET(WRAP_IDL_I_HH ${WRAP_IDL_I_HH} PARAVIS_Gen_${VAL}_i.hh) - SET(WRAP_IDL_I_CC ${WRAP_IDL_I_CC} PARAVIS_Gen_${VAL}_i.cc) - - SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH) - IF(WINDOWS) - IF(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH.exe) - ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL_HH.exe) - ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) - ENDIF(WINDOWS) - - ADD_CUSTOM_COMMAND( - OUTPUT PARAVIS_Gen_${VAL}_i.hh - COMMAND ${vtkWrapIDL_HH_EXEFILE} -o PARAVIS_Gen_${VAL}_i.hh --hints ${CMAKE_BINARY_DIR}/idl/hints ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h - DEPENDS vtkWrapIDL_HH ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_HH} - ) - - SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC) - IF(WINDOWS) - IF(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC.exe) - ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) - SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL_CC.exe) - ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) - ENDIF(WINDOWS) - - ADD_CUSTOM_COMMAND( - OUTPUT PARAVIS_Gen_${VAL}_i.cc - COMMAND ${vtkWrapIDL_CC_EXEFILE} -o PARAVIS_Gen_${VAL}_i.cc --hints ${CMAKE_BINARY_DIR}/idl/hints ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h - DEPENDS PARAVIS_Gen_${VAL}_i.hh vtkWrapIDL_CC ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_CC} - ) - - ENDFOREACH(STR ${WRAP_LIST_REG}) -ENDIF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) - -ADD_CUSTOM_COMMAND( - OUTPUT PARAVIS_CreateClass.cxx - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_class.py ${CMAKE_BINARY_DIR} - DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt ${WRAP_IDL_I_HH} -) -ADD_CUSTOM_TARGET(generate_pvgui ALL DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt PARAVIS_CreateClass.cxx ${WRAP_IDL_I_HH} ${WRAP_IDL_I_CC}) diff --git a/src/PV_SWIG/CMakeLists.txt b/src/PV_SWIG/CMakeLists.txt index e4bdaf3a..3ab6b0f9 100644 --- a/src/PV_SWIG/CMakeLists.txt +++ b/src/PV_SWIG/CMakeLists.txt @@ -17,20 +17,17 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(dist_salomescript_DATA - paravis.py - paravisSM.py - pvsimple.py - presentations.py +IF(SALOME_PARAVIS_MINIMAL_CORBA) + # Use another set of Python files + SET(_PYFILES_TO_INSTALL) + MESSAGE(WARNING "New Python scripts not impl !!!") +ELSE() + SET(_PYFILES_TO_INSTALL + paravis.py + paravisSM.py + pvsimple.py + presentations.py ) +ENDIF() -FOREACH(f ${dist_salomescript_DATA}) - INSTALL(FILES ${f} DESTINATION bin/salome) - - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST bin/salome)") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/install_and_compile_python_file.cmake) - -ENDFOREACH(f ${dist_salomescript_DATA}) +INSTALL_AND_COMPILE_PYTHON_FILE("${_PYFILES_TO_INSTALL}" ${SALOME_INSTALL_SCRIPT_PYTHON}) diff --git a/src/Plugins/CMakeLists.txt b/src/Plugins/CMakeLists.txt index 54f5279e..64238c27 100755 --- a/src/Plugins/CMakeLists.txt +++ b/src/Plugins/CMakeLists.txt @@ -17,16 +17,9 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -PROJECT(SamplePlugins) -CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5) -IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) -ENDIF(COMMAND CMAKE_POLICY) - -FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) -SUBDIRS( +SET(_subdirs #Filter #ToolBar MedReader @@ -36,4 +29,8 @@ SUBDIRS( IntegrationPoints ElevationSurface ScaleVector -) + ) + +FOREACH(_dir ${_subdirs}) + ADD_SUBDIRECTORY(${_dir}) +ENDFOREACH() diff --git a/src/VTKParser/CMakeLists.txt b/src/VTKParser/CMakeLists.txt new file mode 100644 index 00000000..ca407da1 --- /dev/null +++ b/src/VTKParser/CMakeLists.txt @@ -0,0 +1,113 @@ +# Copyright (C) 2010-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + + +## Generation of the list of VTK classes (to be wrapped into IDLs) +## ===================================== +IF(NOT SALOME_LIGHT_ONLY) + # 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) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIR0} + RESULT_VARIABLE _res) + IF(NOT _res EQUAL 0) + MESSAGE(FATAL_ERROR "Unable to run the Python script retrieving the list of VTK classes.") + ENDIF() +ENDIF() + +INCLUDE(GenerateWrapList.cmake) + +## Parser for VTK header files +## =========================== +## +## Everything under the ParaView subdirectory is a pure copy of ParaView source +## code. + +INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_SOURCE_DIR}/ParaView + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_SOURCE_DIR}/src/PVGUI + ) + +# Wrapper executable generating the headers, source files and IDL files +# corresponding to VTK wrapping: +SET(_wrap_PROGRAMS + vtkWrapIDL_HH + vtkWrapIDL_CC + vtkWrapIDL + ) + +SET(vtkWrapIDL_HH_CPPFLAGS -DIDL_I_HH) +SET(vtkWrapIDL_CC_CPPFLAGS -DIDL_I_CC) +SET(vtkWrapIDL_CPPFLAGS) + +#VTN TODO: vtkParseData supports two types of structures for wrapping. +#We use old structures currently, but is is not influent for results of wrapping. +#It may be necessary to port vtkWrapIDL to new approach in future. +#IF(VTK_LEGACY_REMOVE) +# ADD_DEFINITIONS(-DVTK_PARSE_LEGACY_REMOVE) +#ENDIF() + +FOREACH(name ${_wrap_PROGRAMS}) + ADD_EXECUTABLE(${name} + ParaView/vtkParse.tab.c + ParaView/vtkParsePreprocess.c + ParaView/vtkParseHierarchy.c + ParaView/vtkParseExtras.c + ParaView/vtkParseMain.c + ParaView/vtkParseData.c + ParaView/vtkParseString.c + ParaView/vtkWrap.c +# ParaView/vtkWrapText.c + ${PROJECT_SOURCE_DIR}/idl/vtkWrapIDL.c) + ADD_DEPENDENCIES(${name} generate_txt) + + set_property(SOURCE ParaView/vtkParseMain.c PROPERTY COMPILE_DEFINITIONS + VTK_PARSE_VERSION="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") + + SET(flags) + FOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) + SET(flags "${flags} ${f}") + ENDFOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) + + SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") + TARGET_LINK_LIBRARIES(${name} ${PLATFORM_LIBADD}) + + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${name}.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) + INSTALL(FILES ${${name}_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +ENDFOREACH(name ${_wrap_PROGRAMS}) + +# Generate headers and sources corresponding to the IDL implementations: +INCLUDE(wrap.cmake) + +## From 2.8.10, we should use: +## SET(CMAKE_POSITION_INDEPENDENT_CODE ON) +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +ADD_LIBRARY(VTK_IDL_Impl OBJECT ${WRAP_IDL_I_CC}) + +# Make the list of wrapped files visible from the top directory (will be used in PVGUI and idl): +SET(WRAP_IDL_I_HH "${WRAP_IDL_I_HH}" PARENT_SCOPE) +SET(WRAP_IDL_I_CC "${WRAP_IDL_I_CC}" PARENT_SCOPE) diff --git a/src/VTKParser/GenerateWrapList.cmake b/src/VTKParser/GenerateWrapList.cmake new file mode 100644 index 00000000..c884b5b5 --- /dev/null +++ b/src/VTKParser/GenerateWrapList.cmake @@ -0,0 +1,24 @@ +# Copyright (C) 2010-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +ADD_CUSTOM_COMMAND( + OUTPUT ${PROJECT_BINARY_DIR}/wrapfiles.txt + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/getwrapclasses.py + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_PYTHON_EXECUTABLE} +) diff --git a/src/VTKParser/create_class.py b/src/VTKParser/create_class.py new file mode 100755 index 00000000..4532eda0 --- /dev/null +++ b/src/VTKParser/create_class.py @@ -0,0 +1,62 @@ +#!/bin/bash +# Copyright (C) 2010-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import sys +import os + +ffile = "PARAVIS_CreateClass.cxx" +wfile = os.path.join(sys.argv[1], "wrapfiles.txt") + +ffile_stream = open(ffile, "w") + +ffile_stream.write('#include ' + '\n') +ffile_stream.write('#include ' + '\n') +ffile_stream.write('#include "PARAVIS_Gen_i.hh"' + '\n') +wfile_stream = open(wfile) +for line in wfile_stream: + if line.split()[0] == "vtkWebGLExporter" : + ffile_stream.write('#ifdef WIN32\n') + ffile_stream.write(' #ifdef GetObject\n') + ffile_stream.write(' #undef GetObject\n') + ffile_stream.write(' #endif\n') + ffile_stream.write('#endif\n') + pass + ffile_stream.write('#include "PARAVIS_Gen_%s_i.hh"'%(line.split()[0]) + '\n') + pass +wfile_stream.close() +ffile_stream.write('' + '\n') +ffile_stream.write('PARAVIS::PARAVIS_Base_i* CreateInstance(::vtkObjectBase* Inst, const QString& theClassName)' + '\n') +ffile_stream.write('{' + '\n') +wfile_stream = open(wfile) +lst = [] +for line in wfile_stream: + lst.append(line.split()[0]) + pass +wfile_stream.close() +lst.reverse() +for item in lst: + ffile_stream.write(' if(theClassName == "%s" || (Inst != NULL && Inst->IsA("%s")))'%(item, item) + '\n') + ffile_stream.write(' return new PARAVIS::%s_i();'%(item) + '\n') + pass +ffile_stream.write('' + '\n') +ffile_stream.write(' cerr << "The class " << theClassName.toStdString() << " is not created!" << endl;' + '\n') +ffile_stream.write(' return new PARAVIS::PARAVIS_Base_i();' + '\n') +ffile_stream.write('}' + '\n') +ffile_stream.close() diff --git a/src/VTKParser/create_class.sh b/src/VTKParser/create_class.sh new file mode 100755 index 00000000..8c2b8e01 --- /dev/null +++ b/src/VTKParser/create_class.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# Copyright (C) 2010-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +file=PARAVIS_CreateClass.cxx +wfile=$1/wrapfiles.txt + +echo '#include ' > $file +echo '#include ' >> $file +echo '#include "PARAVIS_Gen_i.hh"' >> $file +awk '{print "#include \"PARAVIS_Gen_"$1"_i.hh\"";}' $wfile >> $file +echo '' >> $file +echo 'PARAVIS::PARAVIS_Base_i* CreateInstance(::vtkObjectBase* Inst, const QString& theClassName)' >> $file +echo '{' >> $file +awk 'BEGIN {lst="";} {lst=lst" "$1;} END{i=split(lst,arr);for(j=i;j>0;j--) {print " if(theClassName == \""arr[j]"\" || (Inst != NULL && Inst->IsA(\""arr[j]"\")))";print " return new PARAVIS::"arr[j]"_i();"}}' $wfile >> $file +echo '' >> $file +echo ' cerr << "The class " << theClassName.toStdString() << " is not created!" << endl;' >> $file +echo ' return new PARAVIS::PARAVIS_Base_i();' >> $file +echo '}' >> $file diff --git a/src/VTKParser/getwrapclasses.py b/src/VTKParser/getwrapclasses.py new file mode 100644 index 00000000..5981372c --- /dev/null +++ b/src/VTKParser/getwrapclasses.py @@ -0,0 +1,158 @@ +# Copyright (C) 2010-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +import paraview, os, sys +import string +import re + +classeslistsm = [] +classeslistvtk = [] + +from vtkPVCommonPython import * +from vtkPVClientServerCoreCorePython import * +from vtkPVClientServerCoreDefaultPython import * +from vtkPVClientServerCoreRenderingPython import * +from vtkPVServerImplementationCorePython import * +from vtkPVServerImplementationDefaultPython import * +from vtkPVServerImplementationRenderingPython import * +from vtkPVServerManagerApplicationPython import * +from vtkPVServerManagerCorePython import * +from vtkPVServerManagerDefaultPython import * +from vtkPVServerManagerRenderingPython import * +try: + from vtkPVVTKExtensionsCorePython import * +except: + pass +try: + from vtkPVVTKExtensionsDefaultPython import * +except: + pass +try: + from vtkPVVTKExtensionsRenderingPython import * +except: + pass +try: + from vtkPVVTKExtensionsWebGLExporterPython import * +except: + pass + +l1 = dir() +for a in l1: + if a.startswith("vtk") and (len(a) > 3): + classeslistsm.append(a) + +from paraview.vtk import * +l2 = dir() + +for a in l2: + if (a not in l1) and a.startswith("vtk"): + classeslistvtk.append(a) + +dic=dict() + +non_wrap_list = ["vtkVariant", "vtkTimeStamp"] + +pv_classes_new=classeslistsm +while len(pv_classes_new): + pv_classes_cur=pv_classes_new + pv_classes_new=[] + for c in pv_classes_cur: + ## ignore non wrappable classes + if c in non_wrap_list: + continue + filename=sys.argv[1]+"/"+c+".h" + if os.path.isfile(filename): + c_new=[] + f=open(filename) + for line in f: + if re.match('\s*/',line) is None: + if re.match('\s*public\s*:',line): + continue + + m=re.match('\s*class\s+(vtk\w+)\s*;',line) + if m is not None: + cn=m.group(1) + if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase): + pv_classes_new.append(cn) + continue + + m=re.match('\s*struct\s+(vtk\w+)\s*;',line) + if m is not None: + cn=m.group(1) + if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase): + pv_classes_new.append(cn) + continue + + m=re.match('\s*#include\s+"(vtk\w+)\.h"',line) + if m is not None: + cn=m.group(1) + if cn not in dic.keys() and cn not in pv_classes_new and cn in classeslistvtk and issubclass(globals()[cn], vtkObjectBase): + pv_classes_new.append(cn) + continue + + cm=re.findall('public\s+(vtk\w+)',line) + if len(cm) == 0: + continue + for cn in cm: + ## do not extract Call Back classes + if cn.count('vtkClassMemberCallback'): + continue + if cn not in dic.keys() and cn not in pv_classes_new: + pv_classes_new.append(cn) + if cn not in c_new: + c_new.append(cn) + f.close() + dic[c]=[0, c_new] + + +pv_classes_sort=[] + +def collect_dic(cc): + ret=[] + for c in cc: + if c not in dic.keys(): + continue + if len(dic[c][1]) and dic[c][0] == 0: + ret+=collect_dic(dic[c][1]) + if dic[c][0] == 0: + ret.append(c) + dic[c][0]=1 + return ret + +pv_classes_sort=collect_dic(dic.keys()) + +wf_str="" +if(os.path.exists('wrapfiles.txt')): + wf_txt=open('wrapfiles.txt','r') + strs=wf_txt.readlines() + wf_txt.close() + for s in strs: + wf_str+=s +str="" + +for c in pv_classes_sort: + str+=c + for cc in dic[c][1]: + str+=' '+cc + str+='\n' + +if(str!=wf_str): + wf_txt=open('wrapfiles.txt','w') + wf_txt.write(str) + wf_txt.close() diff --git a/src/VTKParser/readme.txt b/src/VTKParser/readme.txt new file mode 100644 index 00000000..cdceac2c --- /dev/null +++ b/src/VTKParser/readme.txt @@ -0,0 +1,3 @@ +The files under the ParaView directory are pure copy from Paraview sources. +They need for extractor building. +Them has to be updated if the corresponded files in paraview will be changed \ No newline at end of file diff --git a/src/VTKParser/wrap.cmake b/src/VTKParser/wrap.cmake new file mode 100755 index 00000000..daf5d126 --- /dev/null +++ b/src/VTKParser/wrap.cmake @@ -0,0 +1,88 @@ +# Copyright (C) 2010-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +LIST(GET PARAVIEW_INCLUDE_DIRS 0 PARAVIEW_INCLUDE_DIR0) + +SET(WRAP_IDL_I_HH) +SET(WRAP_IDL_I_CC) + +IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) + EXECUTE_PROCESS( + COMMAND ${PYTHON_EXECUTABLE} -c "f = open('${CMAKE_BINARY_DIR}/wrapfiles.txt') ; print f.read(), ; f.close()" + OUTPUT_VARIABLE WRAP_LIST_FULL + ) + + STRING(REGEX MATCHALL "[^\n]+" WRAP_LIST_REG ${WRAP_LIST_FULL}) + FOREACH(_str ${WRAP_LIST_REG}) + + SEPARATE_ARGUMENTS(_str) + LIST(LENGTH _str WRAP_LEN) + SET(DEP_HH) + SET(DEP_CC) + + LIST(GET _str 0 VAL) + + IF(WRAP_LEN GREATER 1) + MATH(EXPR WRAP_LEN1 "${WRAP_LEN} - 1" ) + + FOREACH(IND RANGE 1 ${WRAP_LEN1}) + LIST(GET _str ${IND} DEP_VAL) + SET(DEP_HH ${DEP_HH} PARAVIS_Gen_${DEP_VAL}_i.hh) + SET(DEP_CC ${DEP_CC} PARAVIS_Gen_${DEP_VAL}_i.cc) + ENDFOREACH(IND RANGE 1 ${WRAP_LEN1}) + + ENDIF(WRAP_LEN GREATER 1) + + LIST(APPEND WRAP_IDL_I_HH PARAVIS_Gen_${VAL}_i.hh) + LIST(APPEND WRAP_IDL_I_CC PARAVIS_Gen_${VAL}_i.cc) + + SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL_HH.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) + + ADD_CUSTOM_COMMAND( + OUTPUT PARAVIS_Gen_${VAL}_i.hh + COMMAND ${vtkWrapIDL_HH_EXEFILE} -o PARAVIS_Gen_${VAL}_i.hh --hints ${CMAKE_BINARY_DIR}/idl/hints ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h + DEPENDS vtkWrapIDL_HH ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_HH} + ) + + SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL_CC.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) + + ADD_CUSTOM_COMMAND( + OUTPUT PARAVIS_Gen_${VAL}_i.cc + COMMAND ${vtkWrapIDL_CC_EXEFILE} -o PARAVIS_Gen_${VAL}_i.cc --hints ${CMAKE_BINARY_DIR}/idl/hints ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h + DEPENDS PARAVIS_Gen_${VAL}_i.hh vtkWrapIDL_CC ${PARAVIEW_INCLUDE_DIR0}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_CC} + ) + + ENDFOREACH(_str ${WRAP_LIST_REG}) +ENDIF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) + +ADD_CUSTOM_TARGET(generate_implements ALL DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt ${WRAP_IDL_I_HH} ${WRAP_IDL_I_CC}) diff --git a/src/VTKWrapping/CMakeLists.txt b/src/VTKWrapping/CMakeLists.txt new file mode 100644 index 00000000..ca407da1 --- /dev/null +++ b/src/VTKWrapping/CMakeLists.txt @@ -0,0 +1,113 @@ +# Copyright (C) 2010-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + + +## Generation of the list of VTK classes (to be wrapped into IDLs) +## ===================================== +IF(NOT SALOME_LIGHT_ONLY) + # 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) + EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIR0} + RESULT_VARIABLE _res) + IF(NOT _res EQUAL 0) + MESSAGE(FATAL_ERROR "Unable to run the Python script retrieving the list of VTK classes.") + ENDIF() +ENDIF() + +INCLUDE(GenerateWrapList.cmake) + +## Parser for VTK header files +## =========================== +## +## Everything under the ParaView subdirectory is a pure copy of ParaView source +## code. + +INCLUDE_DIRECTORIES( + ${CMAKE_CURRENT_SOURCE_DIR}/ParaView + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_SOURCE_DIR}/src/PVGUI + ) + +# Wrapper executable generating the headers, source files and IDL files +# corresponding to VTK wrapping: +SET(_wrap_PROGRAMS + vtkWrapIDL_HH + vtkWrapIDL_CC + vtkWrapIDL + ) + +SET(vtkWrapIDL_HH_CPPFLAGS -DIDL_I_HH) +SET(vtkWrapIDL_CC_CPPFLAGS -DIDL_I_CC) +SET(vtkWrapIDL_CPPFLAGS) + +#VTN TODO: vtkParseData supports two types of structures for wrapping. +#We use old structures currently, but is is not influent for results of wrapping. +#It may be necessary to port vtkWrapIDL to new approach in future. +#IF(VTK_LEGACY_REMOVE) +# ADD_DEFINITIONS(-DVTK_PARSE_LEGACY_REMOVE) +#ENDIF() + +FOREACH(name ${_wrap_PROGRAMS}) + ADD_EXECUTABLE(${name} + ParaView/vtkParse.tab.c + ParaView/vtkParsePreprocess.c + ParaView/vtkParseHierarchy.c + ParaView/vtkParseExtras.c + ParaView/vtkParseMain.c + ParaView/vtkParseData.c + ParaView/vtkParseString.c + ParaView/vtkWrap.c +# ParaView/vtkWrapText.c + ${PROJECT_SOURCE_DIR}/idl/vtkWrapIDL.c) + ADD_DEPENDENCIES(${name} generate_txt) + + set_property(SOURCE ParaView/vtkParseMain.c PROPERTY COMPILE_DEFINITIONS + VTK_PARSE_VERSION="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") + + SET(flags) + FOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) + SET(flags "${flags} ${f}") + ENDFOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) + + SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") + TARGET_LINK_LIBRARIES(${name} ${PLATFORM_LIBADD}) + + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${name}.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) + INSTALL(FILES ${${name}_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +ENDFOREACH(name ${_wrap_PROGRAMS}) + +# Generate headers and sources corresponding to the IDL implementations: +INCLUDE(wrap.cmake) + +## From 2.8.10, we should use: +## SET(CMAKE_POSITION_INDEPENDENT_CODE ON) +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") +ADD_LIBRARY(VTK_IDL_Impl OBJECT ${WRAP_IDL_I_CC}) + +# Make the list of wrapped files visible from the top directory (will be used in PVGUI and idl): +SET(WRAP_IDL_I_HH "${WRAP_IDL_I_HH}" PARENT_SCOPE) +SET(WRAP_IDL_I_CC "${WRAP_IDL_I_CC}" PARENT_SCOPE) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 43f8145c..4cc1f0f2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -17,5 +17,26 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SUBDIRS(VisuPrs) +ADD_SUBDIRECTORY(VisuPrs) +SET(_demo_files + demo_0_med.py + demo_1_med.py + demo_2_med.py + demo_3_med.py + demo_4_med.py + demo_5_med.py + demo_6_med.py + demo_7_med.py + demo_8_med.py + demo_9_med.py + demo_10_med.py + demo_11_med.py + demo_12_med.py + demo_13_med.py + demo_14_med.py + demo_15_med.py + ) + +INSTALL_AND_COMPILE_PYTHON_FILE("${_demo_files}" ${SALOME_INSTALL_SCRIPT_PYTHON}) + \ No newline at end of file diff --git a/test/VisuPrs/CMakeLists.txt b/test/VisuPrs/CMakeLists.txt index 228d3c06..7e48950e 100644 --- a/test/VisuPrs/CMakeLists.txt +++ b/test/VisuPrs/CMakeLists.txt @@ -17,26 +17,27 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SUBDIRS(Util - 2D_viewer - 3D_viewer - ScalarMap - DeformedShape - ScalarMap_On_DeformedShape - CutPlanes - CutLines - Vectors - Plot3D - IsoSurfaces - MeshPresentation - Animation - GaussPoints - StreamLines - SWIG_scripts - Tables - ImportMedField - united - bugs - imps - dump_study +ADD_SUBDIRECTORY( + Util + 2D_viewer + 3D_viewer + ScalarMap + DeformedShape + ScalarMap_On_DeformedShape + CutPlanes + CutLines + Vectors + Plot3D + IsoSurfaces + MeshPresentation + Animation + GaussPoints + StreamLines + SWIG_scripts + Tables + ImportMedField + united + bugs + imps + dump_study ) diff --git a/wrapfiles.cmake b/wrapfiles.cmake deleted file mode 100644 index 631f4251..00000000 --- a/wrapfiles.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (C) 2010-2013 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. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wrapfiles.txt - COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/getwrapclasses.py - DEPENDS ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_PYTHON_EXECUTABLE} -)