From 1ccd2741bcff7c4ebc8774ebaa27a8a326caa07a Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Fri, 28 Mar 2014 15:00:35 +0100 Subject: [PATCH] Adapt CMakeLists to Salome CMake standards --- CMakeLists.txt | 163 +++++++++++++++++++---- SalomePARAMETRICConfig.cmake.in | 106 +++++++++++++++ doc/CMakeLists.txt | 46 +++++-- doc/conf.py.in | 4 +- idl/CMakeLists.txt | 22 ++- resources/CMakeLists.txt | 17 ++- resources/SalomeApp.xml.in | 6 +- src/salome/parametric/gui/CMakeLists.txt | 41 +++--- 8 files changed, 339 insertions(+), 66 deletions(-) create mode 100644 SalomePARAMETRICConfig.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b72a7f..06f633c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,46 +15,163 @@ # You should have received a copy of the GNU Lesser General Public License # along with SALOME PARAMETRIC module. If not, see . -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -PROJECT(PARAMETRIC) -SET(VERSION "7.3.0") -SET(SHORT_VERSION "7.3") +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) +PROJECT(SalomePARAMETRIC CXX) -SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR}) -IF(NOT KERNEL_ROOT_DIR) - MESSAGE(FATAL_ERROR "Environment variable KERNEL_ROOT_DIR not set") -ENDIF(NOT KERNEL_ROOT_DIR) +# Ensure a proper linker behavior: +CMAKE_POLICY(SET CMP0003 NEW) -SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR}) -IF(NOT GUI_ROOT_DIR) - MESSAGE(FATAL_ERROR "Environment variable GUI_ROOT_DIR not set") -ENDIF(NOT GUI_ROOT_DIR) +# Versioning +# =========== +# Project name, upper case +STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) -SET(CMAKE_MODULE_PATH ${KERNEL_ROOT_DIR}/salome_adm/cmake_files - ${GUI_ROOT_DIR}/adm_local/cmake_files) +SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 4) +SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) +SET(${PROJECT_NAME_UC}_VERSION + ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) +SET(${PROJECT_NAME_UC}_VERSION_DEV 1) -INCLUDE(SalomeMacros) +# 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) +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) # User options # ============ OPTION(SALOME_BUILD_DOC "Generate SALOME PARAMETRIC documentation" ON) -FIND_PACKAGE(SalomeKERNEL REQUIRED) -FIND_PACKAGE(SalomePython) -FIND_PACKAGE(SalomeOmniORB) -FIND_PACKAGE(SalomeOmniORBPy) -FIND_PACKAGE(SalomeSIP) -FIND_PACKAGE(SalomePyQt4) +## +## From KERNEL: +## +FIND_PACKAGE(SalomePython REQUIRED) +FIND_PACKAGE(SalomeOmniORB REQUIRED) +FIND_PACKAGE(SalomeOmniORBPy REQUIRED) + IF(SALOME_BUILD_DOC) FIND_PACKAGE(SalomeSphinx REQUIRED) ENDIF() -SET(RESDIR ${SALOME_INSTALL_RES}/parametric) -SET(DOCDIR share/doc/salome/gui/PARAMETRIC) +# Find GUI +# =========== +SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "Path to the Salome GUI") +IF(EXISTS ${GUI_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files") + FIND_PACKAGE(SalomeGUI REQUIRED) + ADD_DEFINITIONS(${GUI_DEFINITIONS}) + INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS}) +ELSE(EXISTS ${GUI_ROOT_DIR}) + MESSAGE(FATAL_ERROR "We absolutely need a Salome GUI, please define GUI_ROOT_DIR") +ENDIF(EXISTS ${GUI_ROOT_DIR}) + +## +## From GUI: +## +FIND_PACKAGE(SalomePyQt4 REQUIRED) + +# 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_APPLISKEL_SCRIPTS "${SALOME_INSTALL_APPLISKEL_SCRIPTS}" CACHE PATH + "Install path: SALOME application skeleton - scripts") +SET(SALOME_INSTALL_APPLISKEL_PYTHON "${SALOME_INSTALL_APPLISKEL_PYTHON}" CACHE PATH + "Install path: SALOME application skeleton - Python") +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_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") +# PARAMETRIC specific: +SET(SALOME_PARAMETRIC_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/parametric" CACHE PATH "Install path: SALOME PARAMETRIC specific data") +SET(SALOME_PARAMETRIC_INSTALL_DOC "${SALOME_INSTALL_DOC}/gui/PARAMETRIC" CACHE PATH "Install path: SALOME PARAMETRIC doc") + +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_LOCAL SALOME_INSTALL_RES) +MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED) +MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG_LOCAL SALOME_INSTALL_DOC) +MARK_AS_ADVANCED(SALOME_PARAMETRIC_INSTALL_RES_DATA SALOME_PARAMETRIC_INSTALL_DOC) + +# Accumulate environment variables for PARAMETRIC module +SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS}) +SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) + +# Sources +# ======== ADD_SUBDIRECTORY(idl) ADD_SUBDIRECTORY(src) IF(SALOME_BUILD_DOC) ADD_SUBDIRECTORY(doc) ENDIF(SALOME_BUILD_DOC) ADD_SUBDIRECTORY(resources) + +# 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 + SalomeIDLPARAMETRIC +) + +# 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(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") + +# Build variables that will be expanded when configuring SalomeConfig.cmake: +# SALOME_CONFIGURE_PREPARE() #For use in the future + +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) + +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}") + +# 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/SalomePARAMETRICConfig.cmake.in b/SalomePARAMETRICConfig.cmake.in new file mode 100644 index 0000000..96a921b --- /dev/null +++ b/SalomePARAMETRICConfig.cmake.in @@ -0,0 +1,106 @@ +# - Config file for the @PROJECT_NAME@ package +# It defines the following variables. +# Specific to the package @PROJECT_NAME@ itself: +# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file +# + +############################################################### +# Copyright (C) 2012-2013 EDF +# +# This file is part of SALOME PARAMETRIC module. +# +# SALOME PARAMETRIC module 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 3 of the License, or +# (at your option) any later version. +# +# SALOME PARAMETRIC module 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 SALOME PARAMETRIC module. If not, see . +############################################################### + +### 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 SalomeIDLPARAMETRIC AND NOT @PROJECT_NAME@_BINARY_DIR) + INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE_LOCAL@/@PROJECT_NAME@Targets.cmake") +ENDIF() + +# Package root dir: +SET_AND_CHECK(PARAMETRIC_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") + +# Include directories +SET_AND_CHECK(PARAMETRIC_INCLUDE_DIRS "${PARAMETRIC_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") +SET(PARAMETRIC_INCLUDE_DIRS "${PARAMETRIC_INCLUDE_DIRS};@_SalomePARAMETRIC_EXTRA_HEADERS@") + +# Package specific environment variables +@_SalomePARAMETRIC_EXTRA_ENV_FULL@ + +#### Now the specificities + +# Options exported by the package: +SET(SALOME_LIGHT_ONLY @SALOME_LIGHT_ONLY@) + +# Level 1 prerequisites: +SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_KERNEL_ROOT_DIR@") + +# 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 @_PREREQ_LIST@) +SET(_PREREQ_CONFIG_DIR @_PREREQ_DIR_LIST@) +SET(_PREREQ_COMPONENTS "@_PREREQ_COMPO_LIST@") +LIST(LENGTH _PREREQ_CONFIG_DIR _list_len) +IF(NOT _list_len EQUAL 0) + # 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) + LIST(GET _PREREQ_COMPONENTS ${_p} _pkg_compo) + MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...") + IF(NOT _pkg_compo) + FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE + PATHS "${_pkg_dir}" + NO_DEFAULT_PATH) + ELSE() + STRING(REPLACE "," ";" _compo_lst "${_pkg_compo}") + MESSAGE(STATUS "===> (components: ${_pkg_compo})") + FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE + COMPONENTS ${_compo_lst} + PATHS "${_pkg_dir}" + NO_DEFAULT_PATH) + ENDIF() + ENDFOREACH() +ENDIF() + +# Installation directories +SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@") +SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@") +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_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 PARAMETRIC targets: +SET(PARAMETRIC_SalomeIDLPARAMETRIC SalomeIDLPARAMETRIC) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f520ffb..be94056 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -15,16 +15,42 @@ # You should have received a copy of the GNU Lesser General Public License # along with SALOME PARAMETRIC module. If not, see . -MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/conf.py") -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR}/conf.py @ONLY) +SET(RSTFILES + index.rst + reference.rst + ref_solver.rst + tut_deterministic.rst + tutorial.rst + tut_values.rst + ref_csv_export.rst + ref_execution.rst + ref_values.rst + tut_execution.rst + tut_solver.rst + tut_variables.rst +) -SET(RSTFILES index.rst) -SET(OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/html) +SET(SPHINXOPTS ) +SET(SOURCEDIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET(PAPEROPT_a4 -D latex_paper_size=a4) +SET(ALLSPHINXOPTS -d doctrees ${PAPEROPT_a4} ${SPHINXOPTS} ${SOURCEDIR}) -ADD_CUSTOM_TARGET(BUILD_DOC ALL - COMMAND ${SPHINX_EXECUTABLE} -c ${CMAKE_CURRENT_BINARY_DIR} - -d ${CMAKE_CURRENT_BINARY_DIR}/doctrees - ${CMAKE_CURRENT_SOURCE_DIR} ${OUTDIR} - ) +# install user's documentation -INSTALL(DIRECTORY ${OUTDIR}/ DESTINATION ${DOCDIR}) +SALOME_CONFIGURE_FILE(conf.py.in conf.py) + +SET(HTML_ROOT_FILE html/index.html) + +ADD_CUSTOM_COMMAND(OUTPUT ${HTML_ROOT_FILE} + COMMAND ${CMAKE_COMMAND} -E make_directory html + COMMAND ${CMAKE_COMMAND} -E make_directory doctrees + COMMAND ${SPHINX_EXECUTABLE} -c ${CMAKE_BINARY_DIR}/doc -b html ${ALLSPHINXOPTS} html + DEPENDS ${RSTFILES} +) + +ADD_CUSTOM_TARGET(BUILD_HTML ALL DEPENDS ${HTML_ROOT_FILE}) + +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ + DESTINATION ${SALOME_PARAMETRIC_INSTALL_DOC} + PATTERN ".buildinfo" EXCLUDE +) diff --git a/doc/conf.py.in b/doc/conf.py.in index 9006e01..7df21b7 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -62,9 +62,9 @@ copyright = u'2012-2013, EDF' # built documents. # # The short X.Y version. -version = '@SHORT_VERSION@' +version = '@SALOMEPARAMETRIC_VERSION@' # The full version, including alpha/beta/rc tags. -release = '@VERSION@' +release = '@SALOMEPARAMETRIC_VERSION@' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 2ee16d1..464ff0b 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -15,17 +15,25 @@ # You should have received a copy of the GNU Lesser General Public License # along with SALOME PARAMETRIC module. If not, see . -INCLUDE(UseOmniORB) +INCLUDE(UseOmniORB) # Provided by KERNEL INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} - ${KERNEL_ROOT_DIR}/include/salome ${CMAKE_CURRENT_BINARY_DIR} + ${KERNEL_INCLUDE_DIRS} ) -SET(PARAMETRIC_IDL_FILES PARAMETRIC_Gen.idl) -SET(IDL_INCLUDE_DIRS ${KERNEL_ROOT_DIR}/idl/salome) +SET(SalomeIDLPARAMETRIC_IDLSOURCES + PARAMETRIC_Gen.idl +) + +SET(_idl_include_dirs + ${KERNEL_ROOT_DIR}/idl/salome +) + +SET(_idl_link_flags + ${KERNEL_SalomeIDLKernel} +) -OMNIORB_ADD_MODULE(SalomeIDLPARAMETRIC "${PARAMETRIC_IDL_FILES}" "${IDL_INCLUDE_DIRS}" - ${KERNEL_SalomeIDLKernel}) -INSTALL(TARGETS SalomeIDLPARAMETRIC DESTINATION ${SALOME_INSTALL_LIBS}) +OMNIORB_ADD_MODULE(SalomeIDLPARAMETRIC "${SalomeIDLPARAMETRIC_IDLSOURCES}" "${_idl_include_dirs}" "${_idl_link_flags}") +INSTALL(TARGETS SalomeIDLPARAMETRIC EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index dd4a647..46c3ace 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -15,9 +15,20 @@ # You should have received a copy of the GNU Lesser General Public License # along with SALOME PARAMETRIC module. If not, see . -INSTALL(DIRECTORY ./ DESTINATION ${RESDIR} FILES_MATCHING PATTERN "*.png") -INSTALL(FILES PARAMETRICCatalog.xml DESTINATION ${RESDIR}) +SET(PARAMETRIC_RESOURCES_FILES + export_to_csv_file.png + new_param_study.png + PARAMETRIC.png + param_study.png + edit_param_study.png + generate_job.png + PARAMETRICCatalog.xml + PARAMETRIC_small.png + run_param_study.png +) + +INSTALL(FILES ${PARAMETRIC_RESOURCES_FILES} DESTINATION ${SALOME_PARAMETRIC_INSTALL_RES_DATA}) MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml") CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml @ONLY) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${RESDIR}) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_PARAMETRIC_INSTALL_RES_DATA}) diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in index 2b66099..c923dee 100644 --- a/resources/SalomeApp.xml.in +++ b/resources/SalomeApp.xml.in @@ -5,14 +5,14 @@ - +
- +
- +
diff --git a/src/salome/parametric/gui/CMakeLists.txt b/src/salome/parametric/gui/CMakeLists.txt index 603de22..04fc65c 100644 --- a/src/salome/parametric/gui/CMakeLists.txt +++ b/src/salome/parametric/gui/CMakeLists.txt @@ -15,7 +15,11 @@ # You should have received a copy of the GNU Lesser General Public License # along with SALOME PARAMETRIC module. If not, see . -SET(PYTHON_FILES +INCLUDE(UsePyQt4) + +# --- Python files --- + +SET(PYFILES __init__.py definevalues.py execparams.py @@ -24,20 +28,21 @@ SET(PYTHON_FILES selectvars.py wizard.py ) -SET(PYUIC_FILES wizard_ui.py varrange_ui.py execparams_ui.py genjob_ui.py definevalues_ui.py) -SET(INSTALL_DIR ${SALOME_INSTALL_PYTHON}/salome/parametric/gui) - -FOREACH(OUTPUT ${PYUIC_FILES}) - STRING(REPLACE "_ui.py" ".ui" INPUT ${OUTPUT}) - SET(INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${INPUT}) - SET(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}) - ADD_CUSTOM_COMMAND(OUTPUT ${OUTPUT} - COMMAND ${PYQT_PYUIC_EXECUTABLE} -o ${OUTPUT} ${INPUT} - MAIN_DEPENDENCY ${INPUT} - ) - SET(PYTHON_FILES ${PYTHON_FILES} ${OUTPUT}) -ENDFOREACH(OUTPUT ${PYUIC_FILES}) - -ADD_CUSTOM_TARGET(BUILD_PY_UI_FILES ALL DEPENDS ${PYUIC_FILES}) - -INSTALL_AND_COMPILE_PYTHON_FILE("${PYTHON_FILES}" ${INSTALL_DIR}) + +# uic files / to be processed by pyuic +SET(UIFILES + wizard.ui + varrange.ui + execparams.ui + genjob.ui + definevalues.ui +) + +# --- rules --- + +# scripts / pyuic wrappings +PYQT4_WRAP_UIC(PYUICFILES ${UIFILES}) + +SET(ALLPYFILES ${PYFILES} ${PYUICFILES}) + +INSTALL_AND_COMPILE_PYTHON_FILE("${ALLPYFILES}" ${SALOME_INSTALL_PYTHON}/salome/parametric/gui) -- 2.39.2