From: aguerre Date: Thu, 7 Nov 2013 17:03:31 +0000 (+0000) Subject: Pull updates from V7_main X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b62bfc7e4c3bc86503a52bf7ace04a73e3910b6d;p=modules%2Fkernel.git Pull updates from V7_main --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 74cf28b9d..6288bb1f3 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,10 +49,6 @@ SET(BUILD_SHARED_LIBS TRUE) SET(CALCIUM_IDL_INT_F77 long) SET(CALCIUM_CORBA_INT_F77 CORBA::Long) SET(LONG_OR_INT int) -# Global definitions -ADD_DEFINITIONS(-DSIZEOF_FORTRAN_INTEGER=4 -DSIZEOF_INT=4) -## OmniORB already defines SIZEOF_LONG -# ADD_DEFINITIONS(-DSIZEOF_LONG=${SIZE_OF_LONG}) # User options # ============ @@ -64,9 +60,10 @@ OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON) # Advanced: OPTION(SALOME_LIGHT_ONLY "Build SALOME Light only (no CORBA)" OFF) OPTION(SALOME_USE_LIBBATCH "Use LibBatch in KERNEL" OFF) +OPTION(SALOME_USE_SIMAN "Add SIMAN support" OFF) OPTION(SALOME_PACO_PARALLEL "Build with PACO (implies SALOME_USE_MPI)" OFF) OPTION(SALOME_LAUNCHER_ONLY "Build only the Launcher part" OFF) -MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_PACO_PARALLEL SALOME_LAUNCHER_ONLY) +MARK_AS_ADVANCED(SALOME_LIGHT_ONLY SALOME_USE_LIBBATCH SALOME_USE_SIMAN SALOME_PACO_PARALLEL SALOME_LAUNCHER_ONLY) # Required prerequisites # Find "big" prerequisites first - they reference themselves many others @@ -90,6 +87,11 @@ FIND_PACKAGE(SalomeBoost REQUIRED) # Optional prerequisites # ====================== +IF(SALOME_USE_SIMAN) + FIND_PACKAGE(SalomeSIMANIO) + SALOME_LOG_OPTIONAL_PACKAGE(SIMANIO SALOME_USE_SIMAN) + ADD_DEFINITIONS(-DWITH_SIMANIO) +ENDIF() IF(NOT SALOME_LIGHT_ONLY) FIND_PACKAGE(SalomeOmniORB REQUIRED) FIND_PACKAGE(SalomeOmniORBPy REQUIRED) @@ -166,6 +168,12 @@ MARK_AS_ADVANCED(SALOME_INSTALL_APPLISKEL_SCRIPTS SALOME_INSTALL_APPLISKEL_PYTH MARK_AS_ADVANCED(SALOME_INSTALL_PYTHON SALOME_INSTALL_PYTHON_SHARED SALOME_KERNEL_INSTALL_RES_DATA SALOME_KERNEL_INSTALL_RES_SCRIPTS SALOME_INSTALL_DOC) MARK_AS_ADVANCED(SALOME_INSTALL_AMCONFIG SALOME_INSTALL_AMCONFIG_LOCAL) +# Accumulate environment variables for KERNEL module +SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_BINS} + ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON} + ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED}) +SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) + # Sources # ======== IF(NOT SALOME_LIGHT_ONLY) @@ -191,7 +199,7 @@ 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" -# Temporary solution for pakage src\DSC on windows +# Temporary solution for package src\DSC on windows IF(NOT WIN32) SET(DSC_TGS CalciumC SalomeCalcium SalomeDatastream SalomePalm SalomeDSCSupervBasic SalomeDSCSuperv) @@ -236,15 +244,21 @@ SET(MPI_ROOT_DIR "${MPI_ROOT_DIR}") SET(OMNIORB_ROOT_DIR "${OMNIORB_ROOT_DIR}") SET(OMNIORBPY_ROOT_DIR "${OMNIORBPY_ROOT_DIR}") SET(LIBBATCH_ROOT_DIR "${LIBBATCH_ROOT_DIR}") - +SET(SIMANIO_ROOT_DIR "${SIMANIO_ROOT_DIR}") + SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") -CONFIGURE_PACKAGE_CONFIG_FILE(salome_adm/cmake_files/${PROJECT_NAME}Config.cmake.in + +# Build variables that will be expanded when configuring SalomeConfig.cmake: +SALOME_CONFIGURE_PREPARE(CppUnit Graphviz Doxygen Sphinx MPI omniORB LibBatch + PThread Boost HDF5 libXml2 Python SIMANIO HDF5) + +CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE}" PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR SPHINX_ROOT_DIR MPI_ROOT_DIR OMNIORB_ROOT_DIR OMNIORBPY_ROOT_DIR LIBBATCH_ROOT_DIR - PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR + SIMANIO_ROOT_DIR PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR PYTHON_ROOT_DIR SWIG_ROOT_DIR) # - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?): @@ -257,7 +271,7 @@ CONFIGURE_PACKAGE_CONFIG_FILE(salome_adm/cmake_files/${PROJECT_NAME}Config.cmake # PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE CMAKE_INSTALL_PREFIX # CPPUNIT_ROOT_DIR GRAPHVIZ_ROOT_DIR DOXYGEN_ROOT_DIR # SPHINX_ROOT_DIR MPI_ROOT_DIR OMNIORB_ROOT_DIR OMNIORBPY_ROOT_DIR LIBBATCH_ROOT_DIR -# PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR +# SIMANIO_ROOT_DIR PTHREAD_ROOT_DIR BOOST_ROOT_DIR HDF5_ROOT_DIR LIBXML2_ROOT_DIR # PYTHON_ROOT_DIR SWIG_ROOT_DIR) WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake diff --git a/SalomeKERNELConfig.cmake.in b/SalomeKERNELConfig.cmake.in new file mode 100644 index 000000000..a5e884660 --- /dev/null +++ b/SalomeKERNELConfig.cmake.in @@ -0,0 +1,194 @@ +# - 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 +# +# Other stuff specific to this package: +# SALOME_USE_MPI - ON if KERNEL is built with MPI support +# SALOME_KERNEL_BUILD_DOC - ON if documentation for KERNEL module has been built +# SALOME_KERNEL_BUILD_TESTS - ON if tests for KERNEL module has been built +# SALOME_LIGHT_ONLY - ON if SALOME is built in Light mode (no CORBA) + +############################################################### +# 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 SALOMEBasics AND NOT @PROJECT_NAME@_BINARY_DIR) + INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE@/@PROJECT_NAME@Targets.cmake") +ENDIF() + +# Package root dir: +SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") + +# Include directories and definitions +SET_AND_CHECK(KERNEL_INCLUDE_DIRS "${KERNEL_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") +SET(KERNEL_INCLUDE_DIRS "${KERNEL_INCLUDE_DIRS};@_SalomeKERNEL_EXTRA_HEADERS@") +SET(KERNEL_DEFINITIONS) + +# Package specific environment variables +@_SalomeKERNEL_EXTRA_ENV_FULL@ + +#### Now the specificities + +# Options exported by the package: +SET(SALOME_USE_MPI @SALOME_USE_MPI@) +IF(SALOME_USE_MPI) + LIST(APPEND KERNEL_INCLUDE_DIRS "@MPI_INCLUDE_DIRS@") + LIST(APPEND KERNEL_DEFINITIONS "@MPI_DEFINITIONS@") +ENDIF() + +SET(SALOME_KERNEL_BUILD_DOC @SALOME_BUILD_DOC@) +SET(SALOME_KERNEL_BUILD_TESTS @SALOME_BUILD_TESTS@) +SET(SALOME_LIGHT_ONLY @SALOME_LIGHT_ONLY@) +SET(SALOME_USE_LIBBATCH @SALOME_USE_LIBBATCH@) + +SET(SALOME_USE_SIMAN @SALOME_USE_SIMAN@) +IF(SALOME_USE_SIMAN) + LIST(APPEND KERNEL_DEFINITIONS "-DWITH_SIMANIO") +ENDIF() + +# Prerequisites: +IF(SALOME_KERNEL_BUILD_TESTS) + SET_AND_CHECK(CPPUNIT_ROOT_DIR_EXP "@PACKAGE_CPPUNIT_ROOT_DIR@") +ENDIF() +IF(SALOME_KERNEL_BUILD_DOC) + SET_AND_CHECK(GRAPHVIZ_ROOT_DIR_EXP "@PACKAGE_GRAPHVIZ_ROOT_DIR@") + SET_AND_CHECK(DOXYGEN_ROOT_DIR_EXP "@PACKAGE_DOXYGEN_ROOT_DIR@") + SET_AND_CHECK(SPHINX_ROOT_DIR_EXP "@PACKAGE_SPHINX_ROOT_DIR@") +ENDIF() +IF(SALOME_USE_MPI) + SET_AND_CHECK(MPI_ROOT_DIR_EXP "@PACKAGE_MPI_ROOT_DIR@") +ENDIF() +IF(NOT SALOME_LIGHT_ONLY) + SET_AND_CHECK(OMNIORB_ROOT_DIR_EXP "@PACKAGE_OMNIORB_ROOT_DIR@") + SET_AND_CHECK(OMNIORBPY_ROOT_DIR_EXP "@PACKAGE_OMNIORBPY_ROOT_DIR@") +ENDIF() +IF(SALOME_USE_LIBBATCH) + SET_AND_CHECK(LIBBATCH_ROOT_DIR_EXP "@PACKAGE_LIBBATCH_ROOT_DIR@") +ENDIF() +IF(SALOME_USE_SIMAN) + SET_AND_CHECK(SIMANIO_ROOT_DIR_EXP "@PACKAGE_SIMANIO_ROOT_DIR@") +ENDIF() + +SET_AND_CHECK(PTHREAD_ROOT_DIR_EXP "@PACKAGE_PTHREAD_ROOT_DIR@") +SET_AND_CHECK(HDF5_ROOT_DIR_EXP "@PACKAGE_HDF5_ROOT_DIR@") +SET_AND_CHECK(LIBXML2_ROOT_DIR_EXP "@PACKAGE_LIBXML2_ROOT_DIR@") +SET_AND_CHECK(PYTHON_ROOT_DIR_EXP "@PACKAGE_PYTHON_ROOT_DIR@") +SET_AND_CHECK(SWIG_ROOT_DIR_EXP "@PACKAGE_SWIG_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_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 "@SALOME_INSTALL_AMCONFIG@") # to be removed +SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@") # to be removed + +# Exposed targets: +SET(KERNEL_CalciumC CalciumC) +SET(KERNEL_DF DF) +SET(KERNEL_Launcher Launcher) +SET(KERNEL_LifeCycleCORBATest LifeCycleCORBATest) +SET(KERNEL_NamingServiceTest NamingServiceTest) +SET(KERNEL_OpUtil OpUtil) +SET(KERNEL_Registry Registry) +SET(KERNEL_ResourcesManager ResourcesManager) +SET(KERNEL_SALOMEBasics SALOMEBasics) +SET(KERNEL_SalomeCatalog SalomeCatalog) +SET(KERNEL_SalomeCommunication SalomeCommunication) +SET(KERNEL_SalomeContainer SalomeContainer) +SET(KERNEL_SalomeDatastream SalomeDatastream) +SET(KERNEL_SalomeDSCContainer SalomeDSCContainer) +SET(KERNEL_SalomeDSClient SalomeDSClient) +SET(KERNEL_SalomeDSCSupervBasic SalomeDSCSupervBasic) +SET(KERNEL_SalomeDSCSuperv SalomeDSCSuperv) +SET(KERNEL_SalomeDSImpl SalomeDSImpl) +SET(KERNEL_SALOMEDSImplTest SALOMEDSImplTest) +SET(KERNEL_SalomeDS SalomeDS) +SET(KERNEL_SALOMEDSTest SALOMEDSTest) +SET(KERNEL_SalomeGenericObj SalomeGenericObj) +SET(KERNEL_SalomeHDFPersist SalomeHDFPersist) +SET(KERNEL_SalomeIDLKernel SalomeIDLKernel) +SET(KERNEL_SalomeLauncher SalomeLauncher) +SET(KERNEL_SalomeLifeCycleCORBA SalomeLifeCycleCORBA) +SET(KERNEL_SALOMELocalTrace SALOMELocalTrace) +SET(KERNEL_SALOMELocalTraceTest SALOMELocalTraceTest) +SET(KERNEL_SalomeLoggerServer SalomeLoggerServer) +SET(KERNEL_SalomeMPIContainer SalomeMPIContainer) +SET(KERNEL_SalomeNotification SalomeNotification) +SET(KERNEL_SalomeNS SalomeNS) +SET(KERNEL_SalomeResourcesManager SalomeResourcesManager) +SET(KERNEL_SalomeTestComponentEngine SalomeTestComponentEngine) +SET(KERNEL_SalomeTestMPIComponentEngine SalomeTestMPIComponentEngine) +SET(KERNEL_SALOMETraceCollectorTest SALOMETraceCollectorTest) +SET(KERNEL_TOOLSDS TOOLSDS) +SET(KERNEL_UtilsTest UtilsTest) +SET(KERNEL_with_loggerTraceCollector with_loggerTraceCollector) +SET(KERNEL_SalomeKernelHelpers SalomeKernelHelpers) diff --git a/bin/PortManager.py b/bin/PortManager.py index da1e06cd6..a919ee7c5 100644 --- a/bin/PortManager.py +++ b/bin/PortManager.py @@ -175,13 +175,13 @@ class _ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler): pm.releasePort(port) response = "%s" % (RELEASE_PORT_ACK_MSG) _send(self.request, response) - #print "RELEASE_PORT:", port + print "RELEASE_PORT:", port if not pm.isBusy(): - #print "Close server" + print "Close server" self.server.shutdown() #print pm elif data == STOP_SERVER_MSG: - #print "Close server" + print "Close server" self.server.shutdown() # @@ -211,10 +211,10 @@ def __startServer(): #server_thread.setDaemon(True) server_thread.start() #print "Server loop running in thread:", server_thread.getName() - #print "Server address:", pm_address + print "Server address:", pm_address #return address except: - #print "Server already started" + print "Server already started" #print "Server address:", pm_address #return pm_address pass @@ -229,7 +229,7 @@ def __newClient(address, message): response = _receive(sock) if response.startswith(GET_PORT_ACK_MSG): port = int(response[len(GET_PORT_ACK_MSG)+1:]) - #print "GET_PORT:", port + print "GET_PORT:", port return port elif response == RELEASE_PORT_ACK_MSG: #print "Received: %s" % response @@ -237,7 +237,7 @@ def __newClient(address, message): pass sock.close() except socket.error: - #print "Unable to connect to server" + print "Unable to connect to server" return -1 # diff --git a/bin/appliskel/salome b/bin/appliskel/salome index 41e0883dc..d12155b33 100755 --- a/bin/appliskel/salome +++ b/bin/appliskel/salome @@ -17,14 +17,15 @@ def __initialize(): os.environ['APPLI'] = appliPath # needed to convert .sh environment files os.environ['ABSOLUTE_APPLI_PATH'] = absoluteAppliPath - # define folder to store omniorb config (initially in virtual application folder) - #omniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS") - omniorbUserPath = os.path.join(homePath, appliPath, "USERS") - os.environ['OMNIORB_USER_PATH'] = omniorbUserPath - if not os.path.exists(omniorbUserPath): - os.makedirs(omniorbUserPath) - sys.path[:0] = [absoluteAppliPath+'/bin/salome'] + + # define folder to store omniorb config (initially in virtual application folder) + try: + from salomeLauncherUtils import setOmniOrbUserPath + setOmniOrbUserPath() + except Exception, e: + print e + sys.exit(1) # End of preliminary work def main(args): @@ -36,21 +37,12 @@ def main(args): usage() sys.exit(0) - from salomeLauncherUtils import getConfigFileNames - configFileNames, args = getConfigFileNames(args) - - # WHY? Incorrect/Inexisting files are supposed to be ignored by SalomeRunner. - # Might simply need bug fix; please provide test case. - error=False - for aFile in configFileNames: - if not os.path.isfile(aFile): - print "ERROR: inexisting file: "+aFile - error=True - if error: + configFileNames, args, unexisting = getConfigFileNames(args, checkExistence=True) + if len(unexisting) > 0: + print "ERROR: unexisting configuration file(s): " + ', '.join(unexisting) sys.exit(1) - # Create a SalomeRunner which parses configFileNames to initialize environment try: from salomeRunner import SalomeRunner, SalomeRunnerException @@ -62,19 +54,6 @@ def main(args): # runner.addToPythonPath('mypythonpath') # runner.setEnviron('myvarname', 'value') - kernel_root_dir = os.getenv("KERNEL_ROOT_DIR") - if kernel_root_dir: - runner.addToLdLibraryPath(os.path.join(kernel_root_dir, "lib/salome")) - - gui_root_dir = os.getenv("GUI_ROOT_DIR") - if gui_root_dir: - runner.addToLdLibraryPath(os.path.join(gui_root_dir, "lib/salome")) - - paravis_root_dir = os.getenv("PARAVIS_ROOT_DIR") - if paravis_root_dir: - runner.addToLdLibraryPath(os.path.join(paravis_root_dir, "lib/salome")) - - # Start SALOME, parsing command line arguments runner.go(args) print 'Thank you for using SALOME!' diff --git a/bin/appliskel/tests/CMakeLists.txt b/bin/appliskel/tests/CMakeLists.txt index 41af658e2..2e50e0ea9 100644 --- a/bin/appliskel/tests/CMakeLists.txt +++ b/bin/appliskel/tests/CMakeLists.txt @@ -17,5 +17,5 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -ADD_SUBDIRECTORY(concurrentSession) +#ADD_SUBDIRECTORY(concurrentSession) ADD_SUBDIRECTORY(launcher) diff --git a/bin/launchConfigureParser.py b/bin/launchConfigureParser.py index 7937325cd..9c7497915 100755 --- a/bin/launchConfigureParser.py +++ b/bin/launchConfigureParser.py @@ -68,6 +68,10 @@ valgrind_session_nam = "valgrind_session" shutdown_servers_nam = "shutdown_servers" foreground_nam = "foreground" wake_up_session_nam = "wake_up_session" +siman_nam = "siman" +siman_study_nam = "siman_study" +siman_scenario_nam = "siman_scenario" +siman_user_nam = "siman_user" # values in XML configuration file giving specific module parameters ( section) # which are stored in opts with key _ (eg SMESH_plugins) @@ -769,9 +773,43 @@ def CreateOptionParser (theAdditionalOptions=[]): o_port = optparse.Option("--port", metavar="", type="int", - action="store", + action="store", dest="use_port", - help=help_str) + help=help_str) + + # SIMAN launch mode + help_str = "Special mode for interacting with SIMAN." + o_siman = optparse.Option("--siman", + action="store_true", + dest="siman", + help=help_str) + + # SIMAN study + help_str = "SIMAN study identifier." + o_siman_study = optparse.Option("--siman-study", + metavar="", + type="string", + action="store", + dest="siman_study", + help=help_str) + + # SIMAN scenario + help_str = "SIMAN scenario identifier." + o_siman_scenario = optparse.Option("--siman-scenario", + metavar="", + type="string", + action="store", + dest="siman_scenario", + help=help_str) + + # SIMAN user + help_str = "SIMAN user identifier." + o_siman_user = optparse.Option("--siman-user", + metavar="", + type="string", + action="store", + dest="siman_user", + help=help_str) # All options opt_list = [o_t,o_g, # GUI/Terminal @@ -802,6 +840,10 @@ def CreateOptionParser (theAdditionalOptions=[]): o_wake_up, o_slm, # Server launch mode o_port, # Use port + o_siman, # Siman launch mode + o_siman_study, # Siman study + o_siman_scenario,# Siman scenario + o_siman_user, # Siman user ] #std_options = ["gui", "desktop", "log_file", "resources", @@ -1112,6 +1154,16 @@ def get_env(theAdditionalOptions=[], appname=salomeappname, cfgname=salomecfgnam if cmd_opts.wake_up_session is not None: args[wake_up_session_nam] = cmd_opts.wake_up_session + # siman options + if cmd_opts.siman is not None: + args[siman_nam] = cmd_opts.siman + if cmd_opts.siman_study is not None: + args[siman_study_nam] = cmd_opts.siman_study + if cmd_opts.siman_scenario is not None: + args[siman_scenario_nam] = cmd_opts.siman_scenario + if cmd_opts.siman_user is not None: + args[siman_user_nam] = cmd_opts.siman_user + #################################################### # Add values to args for add_opt in theAdditionalOptions: diff --git a/bin/parseConfigFile.py b/bin/parseConfigFile.py index 3511bbe97..8dd21189f 100644 --- a/bin/parseConfigFile.py +++ b/bin/parseConfigFile.py @@ -138,10 +138,10 @@ def parseConfigFile(filename, reserved = []): logConfigParser.error("No section found in file: %s"%(filename)) return [] - return _processConfigFile(config, reserved, filename) + return __processConfigFile(config, reserved, filename) # -def _processConfigFile(config, reserved = [], filename="UNKNOWN FILENAME"): +def __processConfigFile(config, reserved = [], filename="UNKNOWN FILENAME"): # :TODO: may detect duplicated variables in the same section (raise a warning) # or even duplicate sections @@ -261,16 +261,28 @@ class EnvFileConverter(object): break while "clean " in line[0:6]: #skip clean calls with ending ";" crash line = self.fp.readline() + # Extract variable=value if "=" in line: try: variable, value = line.split('=') except: #avoid error for complicated sh line xx=`...=...`, but warning print "WARNING: parseConfigFile.py: line with multiples '=' character are hazardous: '"+line+"'" variable, value = line.split('=',1) + pass + + # Self-extending variables that are not in reserved keywords + # Example: FOO=something:${FOO} + # In this case, remove the ${FOO} in value + if variable in value: + value = self._purgeValue(value, variable) + line = "%s=%s"%(variable,value) + self.allParsedVariableNames.append(variable) - # Self-extending variables that are not in reserved keywords - # Example: FOO=something:${FOO} - # :TODO: + # End of extraction + + if not line: + return line + # # replace "${FOO}" and "$FOO" and ${FOO} and $FOO by %(FOO)s if FOO is # defined in current file (i.e. it is not an external environment variable) @@ -278,10 +290,16 @@ class EnvFileConverter(object): key = r'\$\{?'+k+'\}?' pattern = re.compile(key, re.VERBOSE) line = pattern.sub(r'%('+k+')s', line) - # Remove quotes - pattern = re.compile(r'\"', re.VERBOSE) - line = pattern.sub(r'', line) + # Remove quotes (if line does not contain whitespaces) + try: + variable, value = line.split('=', 1) + except ValueError: + variable, value = line.split(':', 1) + if not ' ' in value.strip(): + pattern = re.compile(r'\"', re.VERBOSE) + line = pattern.sub(r'', line) # + # Replace `shell_command` by its result def myrep(obj): obj = re.sub('`', r'', obj.group(0)) # remove quotes @@ -309,10 +327,8 @@ class EnvFileConverter(object): # # Convert .sh environment file to configuration file format -def convertEnvFileToConfigFile(envFilename, configFilename): - #reserved=['PATH', 'LD_LIBRARY_PATH', 'PYTHONPATH'] +def convertEnvFileToConfigFile(envFilename, configFilename, reserved=[]): logConfigParser.debug('convert env file %s to %s'%(envFilename, configFilename)) - reserved=['PATH', 'LD_LIBRARY_PATH', 'PYTHONPATH', 'MANPATH', 'R_LIBS', 'PV_PLUGIN_PATH', 'TCLLIBPATH', 'TKLIBPATH'] fileContents = open(envFilename, 'r').read() pattern = re.compile('\n[\n]+', re.VERBOSE) # multiple '\n' diff --git a/bin/runSalome.py b/bin/runSalome.py index 2a3852720..fef35cf21 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -32,7 +32,6 @@ import setenv from launchConfigureParser import verbose from server import process_id, Server import json -from salomeLauncherUtils import formatScriptsAndArgs import subprocess # ----------------------------------------------------------------------------- @@ -140,7 +139,28 @@ def get_cata_path(list_modules,modules_root_dir): return cata_path - +_siman_name = None +def simanStudyName(args): + global _siman_name + if _siman_name is None: + # siman session paramenters and checkout processing + _siman_name = "" + if 'siman' in args: + siman_data = [] + for param in [ 'study', 'scenario', 'user']: + siman_param = "siman_%s"%param + if siman_param in args: + siman_data.append(args[siman_param]) + else: + print "SIMAN %s must be defined using parameter --siman-%s=XXX" % (siman_param, siman_param) + pass + pass + if len(siman_data) == 3: + _siman_name = "_".join(siman_data) + pass + pass + pass + return _siman_name class CatalogServer(Server): def __init__(self,args): @@ -262,6 +282,9 @@ class SessionServer(Server): if self.args['study_hdf'] is not None: self.SCMD2+=['--study-hdf=%s'%self.args['study_hdf']] pass + if simanStudyName(self.args): + self.SCMD2+=['--siman-study=%s'%simanStudyName(self.args)] + pass pass if self.args.has_key('pyscript') and len(self.args['pyscript']) > 0: msg = json.dumps(self.args['pyscript']) @@ -495,6 +518,12 @@ def startSalome(args, modules_list, modules_root_dir): myServer=NotifyServer(args,modules_root_dir) myServer.run() + # set siman python path before the session server launching to import scripts inside python console + if simanStudyName(args): + # MPV: use os.environ here because session server is launched in separated process and sys.path is missed in this case + os.environ["PYTHONPATH"] = "/tmp/SimanSalome/" + args['siman_study'] + "/" + \ + args['siman_scenario'] + "/" + args['siman_user'] + os.pathsep + os.environ["PYTHONPATH"]; + # Launch Session Server (to show splash ASAP) # @@ -648,6 +677,27 @@ def startSalome(args, modules_list, modules_root_dir): except ImportError: pass + # siman session paramenters and checkout processing + if simanStudyName(args): + print '**********************************************' + print "Siman study name= '" + simanStudyName(args) + "'" + import SALOMEDS + obj = clt.Resolve('myStudyManager') + myStudyManager = obj._narrow(SALOMEDS.StudyManager) + aNewStudy = myStudyManager.NewStudy(simanStudyName(args)) + aSimS = myStudyManager.GetSimanStudy() + aSimS._set_StudyId(args['siman_study']) + aSimS._set_ScenarioId(args['siman_scenario']) + aSimS._set_UserId(args['siman_user']) + aSimS.CheckOut(aNewStudy) + # if session server is enabled, activate the created study + if args["gui"]: + print "Activate the SIMAN study in the SALOME GUI" + obj = clt.Resolve('/Kernel/Session') + mySession = obj._narrow(SALOME.Session) + mySession.emitMessage("simanCheckoutDone " + simanStudyName(args)) + print '**********************************************' + return clt # ----------------------------------------------------------------------------- @@ -728,10 +778,12 @@ def useSalome(args, modules_list, modules_root_dir): if not args['gui'] or not args['session_gui']: toimport = args['pyscript'] + from salomeLauncherUtils import formatScriptsAndArgs command = formatScriptsAndArgs(toimport) if command: proc = subprocess.Popen(command, shell=True) - proc.wait() + res = proc.wait() + if res: sys.exit(1) # if there's an error when executing script, we should explicitly exit return clt @@ -779,16 +831,13 @@ def no_main(): def main(): """Salome launch as a main application""" - ### TEMP >>> ### - if not os.getenv("OMNIORB_USER_PATH"): - homePath = os.path.realpath(os.path.expanduser('~')) - #defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS") - defaultOmniorbUserPath = homePath - if os.getenv("APPLI"): - defaultOmniorbUserPath = os.path.join(homePath, os.getenv("APPLI"), "USERS") - os.environ["OMNIORB_USER_PATH"] = defaultOmniorbUserPath - pass - ### <<< TEMP ### + # define folder to store omniorb config (initially in virtual application folder) + try: + from salomeLauncherUtils import setOmniOrbUserPath + setOmniOrbUserPath() + except Exception, e: + print e + sys.exit(1) from salome_utils import getHostName print "runSalome running on %s" % getHostName() diff --git a/bin/salomeLauncherUtils.py b/bin/salomeLauncherUtils.py index 5a59bb178..a3696dec6 100644 --- a/bin/salomeLauncherUtils.py +++ b/bin/salomeLauncherUtils.py @@ -32,7 +32,7 @@ def __getConfigFileNamesDefault(): return __listDirectory(envdDir) # -def getConfigFileNames(args): +def getConfigFileNames(args, checkExistence=False): # special case: configuration files are provided by user # Search for command-line argument(s) --config=file1,file2,..., filen # Search for command-line argument(s) --config=dir1,dir2,..., dirn @@ -40,12 +40,13 @@ def getConfigFileNames(args): configArgs = [ str(x) for x in args if str(x).startswith(configOptionPrefix) ] if len(configArgs) == 0: - return __getConfigFileNamesDefault(), args + return __getConfigFileNamesDefault(), args, [] args = [ x for x in args if not x.startswith(configOptionPrefix) ] allLists = [ x.replace(configOptionPrefix, '') for x in configArgs ] configFileNames = [] + unexisting = [] for currentList in allLists: elements = currentList.split(',') for elt in elements: @@ -53,9 +54,12 @@ def getConfigFileNames(args): if os.path.isdir(elt): configFileNames += __listDirectory(elt) else: - configFileNames += [elt] + if checkExistence and not os.path.isfile(elt): + unexisting += [elt] + else: + configFileNames += [elt] - return configFileNames, args + return configFileNames, args, unexisting # # Return an array of dictionaries {script_name: [list_of_its_args]} @@ -114,3 +118,29 @@ def formatScriptsAndArgs(scriptArgs=[]): command = "; ".join(["%s"%x for x in commands]) return command # + +# Ensure OMNIORB_USER_PATH is defined. This variable refers to a the folder in which +# SALOME will write omniOrb configuration files. +# If OMNIORB_USER_PATH is already set, only checks write access to associated directory ; +# an exception is raised if check fails. It allows users for choosing a specific folder. +# Else the function sets OMNIORB_USER_PATH this way: +# - If APPLI environment variable is set, OMNIORB_USER_PATH is set to ${APPLI}/USERS. +# The function does not check USERS folder existence or wrute access. This folder +# must exist ; this is the case if SALOME virtual application has been create using +# appli_gen.py script. +# - Else OMNIORB_USER_PATH is set to user home directory. +def setOmniOrbUserPath(): + omniorbUserPath = os.getenv("OMNIORB_USER_PATH") + if omniorbUserPath: + if not os.access(omniorbUserPath, os.W_OK): + raise Exception("Unable to get write access to directory: %s"%omniorbUserPath) + pass + else: + homePath = os.path.realpath(os.path.expanduser('~')) + #defaultOmniorbUserPath = os.path.join(homePath, ".salomeConfig/USERS") + defaultOmniorbUserPath = homePath + if os.getenv("APPLI"): + defaultOmniorbUserPath = os.path.join(homePath, os.getenv("APPLI"), "USERS") + pass + os.environ["OMNIORB_USER_PATH"] = defaultOmniorbUserPath +# diff --git a/bin/salomeRunner.py b/bin/salomeRunner.py index 512f40730..c80c4f316 100644 --- a/bin/salomeRunner.py +++ b/bin/salomeRunner.py @@ -58,17 +58,18 @@ class SalomeRunner: if len(configFileNames) == 0: raise SalomeRunnerException("No configuration files given") + reserved=['PATH', 'LD_LIBRARY_PATH', 'PYTHONPATH', 'MANPATH', 'PV_PLUGIN_PATH'] for filename in configFileNames: basename, extension = os.path.splitext(filename) if extension == ".cfg": - self.__setEnvironmentFromConfigFile(filename) + self.__setEnvironmentFromConfigFile(filename, reserved) elif extension == ".sh": #new convert procedures, temporary could be use not to be automatically deleted #temp = tempfile.NamedTemporaryFile(suffix='.cfg', delete=False) temp = tempfile.NamedTemporaryFile(suffix='.cfg') try: - convertEnvFileToConfigFile(filename, temp.name) - self.__setEnvironmentFromConfigFile(temp.name) + convertEnvFileToConfigFile(filename, temp.name, reserved) + self.__setEnvironmentFromConfigFile(temp.name, reserved) except ConfigParser.ParsingError, e: self.getLogger().warning("Invalid token found when parsing file: %s\n"%(filename)) print e @@ -90,27 +91,17 @@ class SalomeRunner: """Append value to PATH environment variable""" def addToPath(self, value): - self.__addToReserved('PATH', value) + self.addToEnviron('PATH', value) # """Append value to LD_LIBRARY_PATH environment variable""" def addToLdLibraryPath(self, value): - self.__addToReserved('LD_LIBRARY_PATH', value) + self.addToEnviron('LD_LIBRARY_PATH', value) # """Append value to PYTHONPATH environment variable""" def addToPythonPath(self, value): - self.__addToReserved('PYTHONPATH', value) - # - - """Append value to TCLLIBPATH environment variable""" - def addToTclLibPath(self, value): - self.__addToReservedTclTk('TCLLIBPATH', value) - # - - """Append value to TKLIBPATH environment variable""" - def addToTkLibPath(self, value): - self.__addToReservedTclTk('TKLIBPATH', value) + self.addToEnviron('PYTHONPATH', value) # """Set environment variable to value""" @@ -134,6 +125,20 @@ class SalomeRunner: del os.environ[name] # + """Append value to environment variable""" + def addToEnviron(self, name, value, separator=os.pathsep): + if value == '': + return + + value = os.path.expandvars(value) # expand environment variables + self.getLogger().debug("Add to %s: %s", name, value) + env = os.getenv(name, None) + if env is None: + os.environ[name] = value + else: + os.environ[name] = value + separator + env + # + ################################### # This begins the private section # ################################### @@ -197,8 +202,8 @@ class SalomeRunner: sys.exit(1) # - def __setEnvironmentFromConfigFile(self, filename): - unsetVars, configVars, reservedDict = parseConfigFile(filename, reserved=['PATH', 'LD_LIBRARY_PATH', 'PYTHONPATH']) + def __setEnvironmentFromConfigFile(self, filename, reserved=[]): + unsetVars, configVars, reservedDict = parseConfigFile(filename, reserved) # unset variables for var in unsetVars: @@ -208,7 +213,7 @@ class SalomeRunner: for reserved in reservedDict: a = filter(None, reservedDict[reserved]) # remove empty elements reformattedVals = ':'.join(a) - self.__addToReserved(reserved, reformattedVals) + self.addToEnviron(reserved, reformattedVals) pass for key,val in configVars: @@ -218,34 +223,6 @@ class SalomeRunner: sys.path[:0] = os.getenv('PYTHONPATH','').split(':') # - def __addToReserved(self, name, value): - if value == '': - return - - value = os.path.expandvars(value) # expand environment variables - self.getLogger().debug("Add to %s: %s", name, value) - env = os.getenv(name, None) - if env is None: - os.environ[name] = value - else: - os.environ[name] = value + os.pathsep + env - # - - def __addToReservedTclTk(self, name, value): - if value == '': - return - - value = os.path.expandvars(value) # expand environment variables - self.getLogger().debug("Add to %s: %s", name, value) - env = os.getenv(name, None) - #http://computer-programming-forum.com/57-tcl/1dfddc136afccb94.htm - #Tcl treats the contents of that variable as a list. Be happy, for you can now use drive letters on windows. - if env is None: - os.environ[name] = value - else: - os.environ[name] = value + " " + env #explicitely whitespace - # - def _runAppli(self, args=[]): # Initialize SALOME environment sys.argv = ['runSalome'] + args diff --git a/doc/docutils/CMakeLists.txt b/doc/docutils/CMakeLists.txt index 181a50692..f2dea22d8 100755 --- a/doc/docutils/CMakeLists.txt +++ b/doc/docutils/CMakeLists.txt @@ -17,73 +17,18 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# This file mainly prepares the environment in which sphinx should run: -# this sets the PYTHONPATH and LD_LIBRARY_PATH to include OMNIORB, DOCUTILS, SETUPTOOLS, etc ... +SALOME_CONFIGURE_FILE(conf.py.in conf.py) -# Prepare Sphinx options -SET(SPHINXOPTS -) -SET(SOURCEDIR - ${CMAKE_CURRENT_SOURCE_DIR} -) -SET(PAPEROPT_a4 - -D - latex_paper_size=a4 -) -SET(ALLSPHINXOPTS - -d - doctrees - ${PAPEROPT_a4} - ${SPHINXOPTS} - ${SOURCEDIR} -) +SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html -d doctrees -D latex_paper_size=a4 ${CMAKE_CURRENT_SOURCE_DIR} docutils) -SALOME_CONFIGURE_FILE(conf.py.in conf.py) +# This macro mainly prepares the environment in which sphinx should run: +# this sets the PYTHONPATH and LD_LIBRARY_PATH to include OMNIORB, DOCUTILS, SETUPTOOLS, etc ... +SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}") -# Write the shell file preparing the env for the Sphinx run: -# This uses the paths to SPHINX, DOCUTILS and SETUPTOOLS: -# Their root dir were found when looking for Sphinx (FindSalomeSphinx.cmake): - -SET(_pydir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) -IF(WIN32) - STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\${_pydir}\\site-packages\\salome\;%PYTHONPATH% - @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH% - @SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH% - @SET PYTHONPATH=${OMNIORB_ROOT_DIR}\\lib\\x86_win32\;%PYTHONPATH% - @SET PYTHONPATH=${OMNIORB_ROOT_DIR}\\lib\\python\;%PYTHONPATH% - @SET PATH=${OMNIORB_ROOT_DIR}\\lib\\x86_win32\;%PATH% - ") - SET(EXT "bat") - SET(CALL_STR "call") -ELSE(WIN32) - SET(SCR " export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/${_pydir}/site-packages/salome:\${PYTHONPATH} - export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome:\${PYTHONPATH} - export LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib/salome:\${LD_LIBRARY_PATH} - export PYTHONPATH=${OMNIORB_ROOT_DIR}/lib:\${PYTHONPATH} - export PYTHONPATH=${OMNIORB_ROOT_DIR}/lib/${_pydir}/site-packages:\${PYTHONPATH} - export PYTHONPATH=${OMNIORB_ROOT_DIR}/lib64/${_pydir}/site-packages:\${PYTHONPATH} - export PYTHONPATH=${OMNIORBPY_ROOT_DIR}/lib:\${PYTHONPATH} - export PYTHONPATH=${OMNIORBPY_ROOT_DIR}/lib/${_pydir}/site-packages:\${PYTHONPATH} - export PYTHONPATH=${OMNIORBPY_ROOT_DIR}/lib64/${_pydir}/site-packages:\${PYTHONPATH} - export LD_LIBRARY_PATH=${OMNIORB_ROOT_DIR}/lib:\${LD_LIBRARY_PATH} - export PYTHONPATH=${SETUPTOOLS_ROOT_DIR}/lib/${_pydir}/site-packages:\${PYTHONPATH} - export PYTHONPATH=${DOCUTILS_ROOT_DIR}/lib/${_pydir}/site-packages:\${PYTHONPATH} - export PYTHONPATH=${SPHINX_ROOT_DIR}/lib/${_pydir}/site-packages:\${PYTHONPATH}" - ) - IF(SALOME_PACO_PARALLEL) - SET(SCR "${SCR} - export LD_LIBRARY_PATH=${PACO_ROOT_DIR}/lib:\${LD_LIBRARY_PATH} - export PYTHONPATH=${PACO_ROOT_DIR}/lib/${_pydir}:\${PYTHONPATH}") - ENDIF() - SET(EXT "sh") - SET(CALL_STR ".") -ENDIF(WIN32) - -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}") - -ADD_CUSTOM_TARGET(html_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINX_EXECUTABLE} -c ${PROJECT_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} docutils -) +ADD_CUSTOM_TARGET(html_docs COMMAND ${_cmd}) INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs)") INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docutils DESTINATION ${SALOME_INSTALL_DOC}/tui/KERNEL) INSTALL(FILES ${PROJECT_SOURCE_DIR}/doc/salome/tui/images/head.png DESTINATION ${SALOME_INSTALL_DOC}/tui/KERNEL) + +SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES docutils) diff --git a/doc/salome/gui/CMakeLists.txt b/doc/salome/gui/CMakeLists.txt index 58027d8d5..9a943fa0e 100755 --- a/doc/salome/gui/CMakeLists.txt +++ b/doc/salome/gui/CMakeLists.txt @@ -27,3 +27,5 @@ ADD_DEPENDENCIES(usr_docs html_docs) INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)") INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/KERNEL DESTINATION ${SALOME_INSTALL_DOC}/gui) INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/KERNEL) + +SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES KERNEL) diff --git a/doc/salome/tui/CMakeLists.txt b/doc/salome/tui/CMakeLists.txt index bff14febd..0974627e2 100755 --- a/doc/salome/tui/CMakeLists.txt +++ b/doc/salome/tui/CMakeLists.txt @@ -20,17 +20,10 @@ SALOME_CONFIGURE_FILE(doxyfile.in doxyfile) SALOME_CONFIGURE_FILE(static/header.html.in static/header.html) -ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE} -u - COMMAND ${DOXYGEN_EXECUTABLE} - COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.remove(r'''${CMAKE_CURRENT_BINARY_DIR}/doxyfile.bak''')" - COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_DOC}/tui/KERNEL''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}/KERNEL''', r'''${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_DOC}/tui/KERNEL'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_DOC}/tui/KERNEL''')" - VERBATIM - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -) +ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE}) -# TODO -# - Stop using shutil.rmtree() to clear installation directory - this is not safe -# (as the directory can potentically point to custom location)! Moreover, currently, it remove -# the documentation generated with Sphinx (from docutils)! -# - Redesign dev_docs rule: 'make dev_docs' should generate documentation and 'make install' -# should the install it. Other solution: split dev_docs to two steps: dev_docs and install_dev_docs. +INSTALL(CODE "FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/KERNEL)") +INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/KERNEL DESTINATION ${SALOME_INSTALL_DOC}/tui) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/images/head.png DESTINATION ${SALOME_INSTALL_DOC}/tui/KERNEL) + +SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES KERNEL) diff --git a/idl/SALOMEDS.idl b/idl/SALOMEDS.idl index 79ce87142..d3f37f124 100644 --- a/idl/SALOMEDS.idl +++ b/idl/SALOMEDS.idl @@ -557,6 +557,69 @@ during each working session. void attach(in SALOMEDS::Observer theObserver, in boolean modify); }; + //=========================================================================== + /*! \brief %SimanStudy Interface + + The Siman (simulation management) study is an interface extension to the %Study + with functions for working with SIMAN server. Is allows to get data from SIMAN (check-out operation) + and to store it back (check-in operation). + This interface is correctly working if SALOME is compiled with SimanIO library, launched with siman + option and connection to SIMAN server is established and alive. Only one study per application, + checked out from the SIMAN is SimanStudy. For other studies all functionality is unaccessible. +*/ + + interface SimanStudy + { + +//! No connection with SIMAN server + exception SimanStudyNoConnection {}; +//! There is no SimanStudy with: study with checked out data. + exception SimanStudyNotExists {}; + +/*! \brief The ID of the study in SIMAN server + + This is equivalent to the methods setStudyId() & getStudyId() +*/ + attribute string StudyId; + +/*! \brief The ID of the scenario in SIMAN server + + This is equivalent to the methods setScenarioId() & getScenarioId() +*/ + attribute string ScenarioId; +/*! \brief The ID of the user in SIMAN server + + This is equivalent to the methods setUserId() & getUserId() +*/ + attribute string UserId; + +/*! \brief Get data from SIMAN and put it to the given study + + This method is called for just created study to make it referenced + by this Siman study. Also it fills this study by the checked out + data from SIMAN server. + Warning: StudyID, ScenarioID and User Id must be set before calling of this method! + + \param theTarget referenced study for checking out +*/ + void CheckOut(in Study theTarget); + +/*! \brief Get data from the source study and store in SIMAN + + It works only with already checked out study. + \param theModuleName name of the module the check in must be perfrormed for. If empty, check in is performed for all modules. +*/ + void CheckIn(in string theModuleName); + +/*! \brief Returns the %Study with checked out data + + If study is null, there is no such study in this application instance, or Salome was + launched without siman option. +*/ + Study getReferencedStudy(); + +}; + //========================================================================== /*! \brief %Study Builder Interface @@ -985,6 +1048,12 @@ Gets the list of open studies */ long long GetLocalImpl(in string theHostname, in long thePID, out boolean isLocal); +/*! \brief Returns the siman study based on the given study. + + Creates a new Siman study, or returns just a previously created. + \return Siman study, or none if it is not siman mode +*/ + SimanStudy GetSimanStudy(); }; diff --git a/idl/SALOME_Component.idl b/idl/SALOME_Component.idl index ed31e2e07..d74618094 100644 --- a/idl/SALOME_Component.idl +++ b/idl/SALOME_Component.idl @@ -60,12 +60,17 @@ module Engines }; typedef sequence FieldsDict; + typedef sequence ListOfOptions; + typedef sequence ListOfIdentifiers; interface EngineComponent ; interface fileRef ; interface fileTransfer ; interface Salome_file; + interface DataContainer; + typedef sequence ListOfData; + /*! \brief Interface of the %Container. This interface defines the process of loading and registration of new components in %SALOME application @@ -225,6 +230,32 @@ module Engines PyScriptNode createPyScriptNode(in string nodeName, in string code) raises(SALOME::SALOME_Exception); }; + /*! \brief Interface to pass data files from the client side to the SALOME Container. + Passes data from client side to the SALOME container (where component engine is running) + size via the CORBA bus as a stream of bytes. + */ + + interface DataContainer + { + //! This operation returns the stream with the data file content. + TMPFile get(); + + //! Returns the name of the document corresponding to this data container. + string name(); + + //! Returns the identifier of the document corresponding to this data container. + string identifier(); + + //! Returns the extension (type) of the document corresponding to this data container. + //! It is taked from the SIMAN URL. + string extension(); + + //! Defines the extension. It is required is extension of the file is not + //! matched with a read extension: archived file, for example. + void setExtension(in string extension); + }; + + /*! \brief Interface of the %component. This interface is used for interaction between the %container and the %component and between the components inside the container. @@ -464,7 +495,22 @@ module Engines \return string containing component's version, e.g. "1.0" */ string getVersion(); - } ; + + //! Generic Import operation to let the component to import data, corresponding to it. + /*! + \param studyId indentifier of the study where the data must be placed + \param data data for import: usually this is just imported file content + \param options additional options for Importat operation + \return the sequence of identifiers of the importedData in the component (to use later in the export function) + */ + ListOfIdentifiers importData(in long studyId, in DataContainer data, in ListOfOptions options); + + //! Generic Export operation to ket the component export all modified data corresponding to it. + /*! + \param studyId identifier of the study that contains the exported data + */ + ListOfData getModifiedData(in long studyId); + }; /*! \brief Base interface of the %component that supports exporting data. diff --git a/salome_adm/cmake_files/CMakeLists.txt b/salome_adm/cmake_files/CMakeLists.txt index 3ae3bf234..7cd6517f9 100755 --- a/salome_adm/cmake_files/CMakeLists.txt +++ b/salome_adm/cmake_files/CMakeLists.txt @@ -48,12 +48,13 @@ SET(DATA FindSalomePython.cmake FindSalomeSphinx.cmake FindSalomeSWIG.cmake - FindSphinx.cmake + FindSphinx.cmake + FindSalomeVTK.cmake FindMEDFile.cmake InstallAndCompilePythonFile.cmake UseOmniORB.cmake SalomeMacros.cmake - SalomeSetupPlatform.cmake + SalomeSetupPlatform.cmake ) INSTALL(FILES ${DATA} DESTINATION ${SALOME_INSTALL_CMAKE}) diff --git a/salome_adm/cmake_files/FindGraphviz.cmake b/salome_adm/cmake_files/FindGraphviz.cmake index cf987bede..6eb1e5a71 100644 --- a/salome_adm/cmake_files/FindGraphviz.cmake +++ b/salome_adm/cmake_files/FindGraphviz.cmake @@ -1,10 +1,10 @@ # - Graphviz detection # -# Output variable: GRAPHVIZ_EXECUTABLE -# -# The executable 'dot' is looked for and returned in the above variable. +# Output variables: GRAPHVIZ_EXECUTABLE - where is executable 'dot' takes place. +# GRAPHVIZ_INCLUDE_DIRS - where to find headers. +# GRAPHVIZ_LIBRARIES - where to get libraries. +# GRAPHVIZ_FOUND - True if Graphiz was found. # - ########################################################################### # Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE # @@ -31,7 +31,26 @@ FIND_PROGRAM(GRAPHVIZ_EXECUTABLE dot) +FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/graph.h) +SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz) + +FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY NAMES cdt PATH_SUFFIXES bin) +FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY NAMES cgraph PATH_SUFFIXES bin) +FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY NAMES graph PATH_SUFFIXES bin) +FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY NAMES gvc PATH_SUFFIXES bin) +FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin) + +SET(GRAPHVIZ_LIBRARIES + ${GRAPHVIZ_cdt_LIBRARY} + ${GRAPHVIZ_cgraph_LIBRARY} + ${GRAPHVIZ_graph_LIBRARY} + ${GRAPHVIZ_gvc_LIBRARY} + ${GRAPHVIZ_pathplan_LIBRARY} + ) + # Handle the standard arguments of the find_package() command: INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS GRAPHVIZ_EXECUTABLE) - +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS + GRAPHVIZ_EXECUTABLE + GRAPHVIZ_LIBRARIES + GRAPHVIZ_INCLUDE_DIRS) diff --git a/salome_adm/cmake_files/FindOmniORB.cmake b/salome_adm/cmake_files/FindOmniORB.cmake index b6680e701..5d005b75d 100644 --- a/salome_adm/cmake_files/FindOmniORB.cmake +++ b/salome_adm/cmake_files/FindOmniORB.cmake @@ -7,6 +7,7 @@ # OMNIORB_VERSION - OmniORB4 version # OMNIORB_IDL_COMPILER - OmniORB4 idl compiler command (omniidl) # OMNIORB_NAMESERVER - OmniORB4 CORBA naming service (omniNames) +# OMNIORB_PYTHONPATH - path to the OmniORB Python modules # and many other mainly used in UseOmniORB.cmake # # Detection is made through calls to @@ -54,13 +55,23 @@ FIND_PATH(OMNIORB_INCLUDE_DIR omniORB4/CORBA.h) ############################################################################## # find libraries ############################################################################## + +# Win release / debug specific stuff: +IF (WIN32) + IF(CMAKE_BUILD_TYPE STREQUAL Debug) + SET(OMNIORB_RD_SUFFIX d) + ELSE() + SET(OMNIORB_RD_SUFFIX) + ENDIF() +ENDIF() + IF (WIN32) FIND_LIBRARY(OMNIORB_LIBRARY_omniORB4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4_rt${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) FIND_LIBRARY( OMNIORB_LIBRARY_omnithread - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread_rt${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) FIND_LIBRARY( OMNIORB_LIBRARY_omniDynamic4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4_rt${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) ELSE (WIN32) FIND_LIBRARY(OMNIORB_LIBRARY_omniORB4 NAMES omniORB4) FIND_LIBRARY(OMNIORB_LIBRARY_omnithread NAMES omnithread) @@ -71,9 +82,9 @@ ENDIF (WIN32) IF (WIN32) FIND_LIBRARY( OMNIORB_LIBRARY_COS4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COS4_rt${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COS4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) FIND_LIBRARY( OMNIORB_LIBRARY_COSDynamic4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4_rt${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) ELSE (WIN32) FIND_LIBRARY(OMNIORB_LIBRARY_COS4 NAMES COS4) FIND_LIBRARY(OMNIORB_LIBRARY_COSDynamic4 NAMES COSDynamic4) @@ -84,10 +95,12 @@ ENDIF (WIN32) ############################################################################## IF (WIN32) FIND_PROGRAM( OMNIORB_IDL_COMPILER - NAMES omniidl PATHS bin/x86_win32 + NAMES omniidl + PATH_SUFFIXES x86_win32 DOC "What is the path where omniidl (the idl compiler) can be found") FIND_PROGRAM( OMNIORB_OMNINAMES_COMMAND - NAMES omniNames PATHS bin/x86_win32 + NAMES omniNames + PATH_SUFFIXES x86_win32 DOC "What is the path where omniNames (the ORB server) can be found") ELSE(WIN32) FIND_PROGRAM(OMNIORB_IDL_COMPILER NAMES omniidl) @@ -115,6 +128,10 @@ IF(OMNIORB_LIBRARY_COSDynamic4) LIST(APPEND OMNIORB_LIBRARIES ${OMNIORB_LIBRARY_COSDynamic4}) ENDIF() +# Set path to the OmniORB Python modules +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${OMNIORB_LIBRARIES}" PATH) +SET(OMNIORB_PYTHONPATH "${_tmp_ROOT_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") + # Optionaly, extract the the version number from the acconfig.h file: # The version check is done at the very bottom of this file. IF( EXISTS ${OMNIORB_INCLUDE_DIR}/omniORB4/acconfig.h ) @@ -131,7 +148,9 @@ SET(IDL_CLN_H .hh) SET(IDL_SRV_H .hh) SET(OMNIORB_DEFINITIONS "-D__x86__ -DCOMP_CORBA_DOUBLE -DCOMP_CORBA_LONG") IF(WIN32) - SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__WIN32__") + ## OmniORB isn`t defines SIZEOF_LONG and SIZEOF_INT on WIN32 platform + ## Note SIZE_OF_LONG calculates in the SalomeSetupPlatform.cmake + SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__WIN32__ -DSIZEOF_INT=4 -DSIZEOF_LONG=${SIZE_OF_LONG}") ENDIF() IF(APPLE) SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__macos__")#for omnithread.h to be checked... diff --git a/salome_adm/cmake_files/FindOmniORBPy.cmake b/salome_adm/cmake_files/FindOmniORBPy.cmake index 5484e2e4c..965ad1659 100644 --- a/salome_adm/cmake_files/FindOmniORBPy.cmake +++ b/salome_adm/cmake_files/FindOmniORBPy.cmake @@ -45,9 +45,9 @@ FIND_PATH(OMNIORB_PYTHON_BACKEND ############################################################################## MARK_AS_ADVANCED(OMNIORB_PYTHON_BACKEND) -SET(OMNIORB_IDLPYFLAGS -bpython) +SET(OMNIORB_IDLPYFLAGS) IF (OMNIORB_PYTHON_BACKEND) - LIST(APPEND OMNIORB_IDLPYFLAGS -p${OMNIORB_PYTHON_BACKEND}) + LIST(APPEND OMNIORB_IDLPYFLAGS -bpython -p${OMNIORB_PYTHON_BACKEND}) ENDIF() SET(IDLPYFLAGS ${OMNIORB_IDLPYFLAGS}) diff --git a/salome_adm/cmake_files/FindSIMANIO.cmake b/salome_adm/cmake_files/FindSIMANIO.cmake new file mode 100644 index 000000000..dadf08a1b --- /dev/null +++ b/salome_adm/cmake_files/FindSIMANIO.cmake @@ -0,0 +1,54 @@ +# - Find SIMANIO installation +# +# The following variable are set: +# SIMANIO_FOUND - TRUE if SIMANIO installation has been found +# SIMANIO_INCLUDE_DIR - SIMANIO headers path +# SIMANIO_LIBRARIES - SIMANIO libraries +# +# The CMake (or environment) variable SIMANIO_ROOT_DIR can be set to +# guide the detection and indicate a root directory to look into. +# +############################################################################ +# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# 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 +# + +# ------ + +IF(NOT SIMANIO_FIND_QUIETLY) + MESSAGE(STATUS "Check for SimanIO ...") +ENDIF() + +# ------ + +SET(SIMANIO_ROOT_DIR $ENV{SIMANIO_ROOT_DIR} CACHE PATH "Path to the SIMANIO.") +IF(SIMANIO_ROOT_DIR) + LIST(APPEND CMAKE_PREFIX_PATH "${SIMANIO_ROOT_DIR}") +ENDIF() + +FIND_PATH(SIMANIO_INCLUDE_DIR SimanIO_Link.hxx) +FIND_LIBRARY(SIMANIO_LIBRARIES NAMES SimanIO) + +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SIMANIO REQUIRED_VARS SIMANIO_INCLUDE_DIR SIMANIO_LIBRARIES) + +IF(SIMANIO_FOUND) + IF(NOT SIMANIO_FIND_QUIETLY) + MESSAGE(STATUS "SIMANIO library: ${SIMANIO_LIBRARIES}") + ENDIF() +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeBoost.cmake b/salome_adm/cmake_files/FindSalomeBoost.cmake index 93ba717ec..df3d85464 100644 --- a/salome_adm/cmake_files/FindSalomeBoost.cmake +++ b/salome_adm/cmake_files/FindSalomeBoost.cmake @@ -27,7 +27,7 @@ SET(Boost_USE_STATIC_LIBS OFF) SET(Boost_USE_MULTITHREADED ON) SET(Boost_USE_STATIC_RUNTIME OFF) SET(Boost_NO_BOOST_CMAKE ON) -SET(SalomeBoost_FIND_COMPONENTS filesystem regex signals system thread) +SET(SalomeBoost_FIND_COMPONENTS filesystem regex signals system thread date_time chrono) IF(WIN32) # Under windows, one extra sub-directory in the boost installation hierarchy: @@ -42,7 +42,10 @@ ENDIF() ## Specific definitions: IF(WIN32) - SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS) + SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS -DBOOST_ALL_DYN_LINK) ENDIF() -#SALOME_ACCUMULATE_HEADERS(Boost_INCLUDE_DIRS) +IF(Boost_FOUND OR BOOST_FOUND) + SALOME_ACCUMULATE_HEADERS(Boost_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Boost_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeCAS.cmake b/salome_adm/cmake_files/FindSalomeCAS.cmake index 99e00f8ba..50161cce7 100644 --- a/salome_adm/cmake_files/FindSalomeCAS.cmake +++ b/salome_adm/cmake_files/FindSalomeCAS.cmake @@ -45,3 +45,8 @@ ELSE() SET(CAS_STDPLUGIN TKStdSchema) ENDIF() ENDIF() + +IF(CAS_FOUND) + SALOME_ACCUMULATE_HEADERS(CAS_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CAS_TKernel}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeCppUnit.cmake b/salome_adm/cmake_files/FindSalomeCppUnit.cmake index 4eaf46eed..9e20e145f 100644 --- a/salome_adm/cmake_files/FindSalomeCppUnit.cmake +++ b/salome_adm/cmake_files/FindSalomeCppUnit.cmake @@ -27,4 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(CppUnit CPPUNIT_INCLUDE_DIRS 1) MARK_AS_ADVANCED(CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES CPPUNIT_CONFIG_BIN CPPUNIT_SUBLIB_cppunit CPPUNIT_SUBLIB_dl) -#SALOME_ACCUMULATE_HEADERS(CPPUNIT_INCLUDE_DIRS) +IF(CPPUNIT_FOUND) + SALOME_ACCUMULATE_HEADERS(CPPUNIT_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CPPUNIT_LIBRARIES}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeDoxygen.cmake b/salome_adm/cmake_files/FindSalomeDoxygen.cmake index b217886d3..9da127e35 100644 --- a/salome_adm/cmake_files/FindSalomeDoxygen.cmake +++ b/salome_adm/cmake_files/FindSalomeDoxygen.cmake @@ -38,3 +38,7 @@ IF(DOXYGEN_FOUND) ENDIF() ENDIF() MARK_AS_ADVANCED(DOXYGEN_SUPPORT_STL) + +IF(DOXYGEN_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_EXECUTABLE}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeGraphviz.cmake b/salome_adm/cmake_files/FindSalomeGraphviz.cmake index e9b02f7bb..ad3c3c499 100644 --- a/salome_adm/cmake_files/FindSalomeGraphviz.cmake +++ b/salome_adm/cmake_files/FindSalomeGraphviz.cmake @@ -24,5 +24,10 @@ # !! Please read the generic detection procedure in SalomeMacros.cmake !! # -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Graphviz GRAPHVIZ_EXECUTABLE 2) -MARK_AS_ADVANCED(GRAPHVIZ_EXECUTABLE) +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Graphviz GRAPHVIZ_EXECUTABLE GRAPHVIZ_LIBRARIES GRAPHVIZ_INCLUDE_DIRS 2) +MARK_AS_ADVANCED(GRAPHVIZ_EXECUTABLE GRAPHVIZ_LIBRARIES GRAPHVIZ_INCLUDE_DIRS) + +IF(GRAPHVIZ_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${GRAPHVIZ_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${GRAPHVIZ_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeHDF5.cmake b/salome_adm/cmake_files/FindSalomeHDF5.cmake index 24be3f1f5..6b227faf7 100644 --- a/salome_adm/cmake_files/FindSalomeHDF5.cmake +++ b/salome_adm/cmake_files/FindSalomeHDF5.cmake @@ -27,9 +27,12 @@ # MPI root directory used for HDF5 compilation is exposed into MPI_ROOT_DIR_EXP # +SET(HDF5_ROOT_DIR $ENV{HDF5_ROOT_DIR} CACHE PATH "Path to the HDF5.") + if(WIN32) set(PREV_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) set(CMAKE_FIND_LIBRARY_SUFFIXES dll${CMAKE_IMPORT_LIBRARY_SUFFIX}) + set(CMAKE_LIBRARY_PATH ${HDF5_ROOT_DIR}/dll) endif() SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(HDF5 HDF5_INCLUDE_DIR 1) @@ -42,8 +45,6 @@ IF(NOT DEFINED HDF5_LIBRARIES) SET(HDF5_LIBRARIES hdf5) ENDIF() -#SALOME_ACCUMULATE_HEADERS(HDF5_INCLUDE_DIRS) - ## ## 7. Specific to HDF5 only: ## Expose MPI configuration to the rest of the world @@ -85,3 +86,8 @@ ENDIF() if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES ${PREV_CMAKE_FIND_LIBRARY_SUFFIXES}) endif() + +IF(HDF5_FOUND) + SALOME_ACCUMULATE_HEADERS(HDF5_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${HDF5_LIBRARIES}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeKERNEL.cmake b/salome_adm/cmake_files/FindSalomeKERNEL.cmake index 0f0ff81fc..fcfb7756b 100644 --- a/salome_adm/cmake_files/FindSalomeKERNEL.cmake +++ b/salome_adm/cmake_files/FindSalomeKERNEL.cmake @@ -47,3 +47,7 @@ SALOME_FIND_PACKAGE(SalomeKERNEL SalomeKERNEL CONFIG) IF(NOT SalomeKERNEL_FIND_QUIETLY) MESSAGE(STATUS "Found Salome KERNEL: ${KERNEL_ROOT_DIR}") ENDIF() + +FOREACH(_res ${SalomeKERNEL_EXTRA_ENV}) + SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeKERNEL_EXTRA_ENV_${_res}}") +ENDFOREACH() diff --git a/salome_adm/cmake_files/FindSalomeLibBatch.cmake b/salome_adm/cmake_files/FindSalomeLibBatch.cmake index 6922b184f..8f01c2385 100644 --- a/salome_adm/cmake_files/FindSalomeLibBatch.cmake +++ b/salome_adm/cmake_files/FindSalomeLibBatch.cmake @@ -19,7 +19,7 @@ # Author: Adrien Bruneton # -# LibBatch detection dor Salome +# LibBatch detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # @@ -27,5 +27,7 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibBatch LIBBATCH_ROOT_DIR_EXP 0) #MARK_AS_ADVANCED() -#SALOME_ACCUMULATE_HEADERS(LIBBATCH_INCLUDE_DIRS) - +IF(SALOMELIBBATCH_FOUND) + SALOME_ACCUMULATE_HEADERS(LIBBATCH_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBBATCH_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeLibXml2.cmake b/salome_adm/cmake_files/FindSalomeLibXml2.cmake index 78019255e..4c760e162 100644 --- a/salome_adm/cmake_files/FindSalomeLibXml2.cmake +++ b/salome_adm/cmake_files/FindSalomeLibXml2.cmake @@ -28,4 +28,7 @@ ELSE() ENDIF() #MARK_AS_ADVANCED() -#SALOME_ACCUMULATE_HEADERS(LIBXML2_INCLUDE_DIR) +IF(LIBXML2_FOUND) + SALOME_ACCUMULATE_HEADERS(LIBXML2_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBXML2_LIBRARIES}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeMEDFile.cmake b/salome_adm/cmake_files/FindSalomeMEDFile.cmake index a44420836..7180826e2 100644 --- a/salome_adm/cmake_files/FindSalomeMEDFile.cmake +++ b/salome_adm/cmake_files/FindSalomeMEDFile.cmake @@ -19,10 +19,15 @@ # Author: Adrien Bruneton # -# Medfile detection dor Salome +# Medfile detection for Salome # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(MEDFile MEDFILE_INCLUDE_DIRS 1) #MARK_AS_ADVANCED() + +IF(MEDFILE_FOUND) + SALOME_ACCUMULATE_HEADERS(MEDFILE_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MEDFILE_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeMPI.cmake b/salome_adm/cmake_files/FindSalomeMPI.cmake index 2d0df7a84..4a5dbaaaa 100644 --- a/salome_adm/cmake_files/FindSalomeMPI.cmake +++ b/salome_adm/cmake_files/FindSalomeMPI.cmake @@ -29,3 +29,8 @@ MARK_AS_ADVANCED(MPI_EXTRA_LIBRARY MPI_LIBRARY) SET(MPI_INCLUDE_DIRS ${MPI_C_INCLUDE_PATH} ${MPI_CXX_INCLUDE_PATH}) SET(MPI_LIBRARIES ${MPI_C_LIBRARIES} ${MPI_CXX_LIBRARIES}) + +IF(MPI_FOUND) + SALOME_ACCUMULATE_HEADERS(MPI_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${MPI_LIBRARIES}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeOmniORB.cmake b/salome_adm/cmake_files/FindSalomeOmniORB.cmake index 548475a59..fefba9d36 100644 --- a/salome_adm/cmake_files/FindSalomeOmniORB.cmake +++ b/salome_adm/cmake_files/FindSalomeOmniORB.cmake @@ -26,4 +26,9 @@ SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OmniORB OMNIORB_INCLUDE_DIR 1) #MARK_AS_ADVANCED() -#SALOME_ACCUMULATE_HEADERS(OMNIORB_INCLUDE_DIR) \ No newline at end of file +IF(OMNIORB_FOUND) + SALOME_ACCUMULATE_HEADERS(OMNIORB_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OMNIORB_LIBRARIES}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${OMNIORB_LIBRARIES} + ${OMNIORB_PYTHONPATH}) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake index 3e4a0c493..be0b2f22d 100644 --- a/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake +++ b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake @@ -48,3 +48,9 @@ ELSE() MESSAGE(STATUS "OmniORB Python backend needs OmniORB, and OmniORB was not found!") ENDIF() ENDIF() + +IF(OMNIORBPY_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OMNIORBPY_LIBRARIES}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${OMNIORBPY_LIBRARIES} + ${OMNIORBPY_PYTHONPATH}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomePThread.cmake b/salome_adm/cmake_files/FindSalomePThread.cmake index 4d1353fb5..19964adb7 100644 --- a/salome_adm/cmake_files/FindSalomePThread.cmake +++ b/salome_adm/cmake_files/FindSalomePThread.cmake @@ -25,3 +25,9 @@ # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PThread PTHREAD_INCLUDE_DIR 1) MARK_AS_ADVANCED(PTHREAD_LIBRARIES PTHREAD_INCLUDE_DIR) + +IF(SALOMEPTHREAD_FOUND) + SALOME_ACCUMULATE_HEADERS(PTHREAD_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PTHREAD_LIBRARIES}) +ENDIF() + diff --git a/salome_adm/cmake_files/FindSalomePaco.cmake b/salome_adm/cmake_files/FindSalomePaco.cmake index b47bf8ebf..045f137ca 100644 --- a/salome_adm/cmake_files/FindSalomePaco.cmake +++ b/salome_adm/cmake_files/FindSalomePaco.cmake @@ -25,3 +25,8 @@ # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Paco PACO_INCLUDE_DIRS 1) #MARK_AS_ADVANCED() + +IF(SALOMEPACO_FOUND) + SALOME_ACCUMULATE_HEADERS(PACO_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PACO_LIBRARIES}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomePython.cmake b/salome_adm/cmake_files/FindSalomePython.cmake index 5c1f6e87c..13adbcdb0 100644 --- a/salome_adm/cmake_files/FindSalomePython.cmake +++ b/salome_adm/cmake_files/FindSalomePython.cmake @@ -150,6 +150,7 @@ IF (SALOMEPYTHON_FOUND) ## 6. Save the final detected installation ## SET(PYTHON_ROOT_DIR "${_tmp_ROOT_DIR}") + SET(PYTHON_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") ## 7. Specifics ## @@ -172,6 +173,9 @@ ELSE() MESSAGE(STATUS "Python was only partially (or not at all) found .") ENDIF() - -#SALOME_ACCUMULATE_HEADERS(PYTHON_INCLUDE_DIR) - +IF(SALOMEPYTHON_FOUND) + SALOME_ACCUMULATE_HEADERS(PYTHON_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYTHON_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYTHON_LIBRARIES}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYTHON_PYTHONPATH}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeSIMANIO.cmake b/salome_adm/cmake_files/FindSalomeSIMANIO.cmake new file mode 100644 index 000000000..0a36c8407 --- /dev/null +++ b/salome_adm/cmake_files/FindSalomeSIMANIO.cmake @@ -0,0 +1,33 @@ +# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# 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 +# +# Author: Vadim SANDLER +# + +# SIMANIO detection dor Salome +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SIMANIO SIMANIO_INCLUDE_DIR 1) +#MARK_AS_ADVANCED() + +IF(SIMANIO_FOUND) + SALOME_ACCUMULATE_HEADERS(SIMANIO_INCLUDE_DIR) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${SIMANIO_LIBRARIES}) +ENDIF() \ No newline at end of file diff --git a/salome_adm/cmake_files/FindSalomeSWIG.cmake b/salome_adm/cmake_files/FindSalomeSWIG.cmake index 80c7b6595..8d2cb42c4 100644 --- a/salome_adm/cmake_files/FindSalomeSWIG.cmake +++ b/salome_adm/cmake_files/FindSalomeSWIG.cmake @@ -25,3 +25,7 @@ # SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2) MARK_AS_ADVANCED(SWIG_EXECUTABLE SWIG_VERSION) + +IF(SWIG_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SWIG_EXECUTABLE}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeSphinx.cmake b/salome_adm/cmake_files/FindSalomeSphinx.cmake index 2d26445a9..f7d625c95 100644 --- a/salome_adm/cmake_files/FindSalomeSphinx.cmake +++ b/salome_adm/cmake_files/FindSalomeSphinx.cmake @@ -21,19 +21,12 @@ # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # -# The caller of this macro might set SPHINX_PYTHONPATH to provide a path to be added in front -# of the PYTHONPATH with which the sphinx command should be ran. -# -# Note the environment is also overriden in -# doc/docutils/CMakeLists.txt -# with the creation of a dedicated launcher script. -# SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Sphinx SPHINX_EXECUTABLE 2) # Also retrieve paths to DOCUTILS and SETUPTOOLS: SET(SETUPTOOLS_ROOT_DIR "$ENV{SETUPTOOLS_ROOT_DIR}" CACHE PATH "Path to the Setuptools installation") -SET(DOCUTILS_ROOT_DIR "$ENV{DOCUTILS_ROOT_DIR}" CACHE PATH "Path to the Setuptools installation") +SET(DOCUTILS_ROOT_DIR "$ENV{DOCUTILS_ROOT_DIR}" CACHE PATH "Path to the Docutils installation") # Ensure the command is run with the given PYTHONPATH IF(WIN32 AND NOT CYGWIN) @@ -44,3 +37,8 @@ ELSE() ENDIF() MARK_AS_ADVANCED(SPHINX_EXECUTABLE) + +IF(SPHINX_FOUND) + SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_EXECUTABLE}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SPHINX_PYTHONPATH}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSalomeVTK.cmake b/salome_adm/cmake_files/FindSalomeVTK.cmake new file mode 100644 index 000000000..76c58c21f --- /dev/null +++ b/salome_adm/cmake_files/FindSalomeVTK.cmake @@ -0,0 +1,69 @@ +# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# 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 +# +# Author: Adrien Bruneton +# + +# VTK detection for Salome (see http://www.vtk.org/Wiki/VTK/Build_System_Migration) +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +# List the required components: +SET(SalomeVTK_COMPONENTS + vtkRenderingFreeTypeOpenGL + vtkRenderingLOD + vtkRenderingAnnotation + vtkFiltersParallel + vtkIOExport + #vtkWrappingPythonCore ## ParaView 4.0.1 + vtkWrappingPython + vtkIOXML + vtkFiltersVerdict + vtkRenderingLabel + vtkInteractionWidgets +) + +# Seting the following variable is equivalent to having passed the components +# when calling the FIND_PACKAGE() command. +SET(SalomeVTK_FIND_COMPONENTS ${SalomeVTK_COMPONENTS}) + +# If no VTK root dir is specified, try the ParaView root dir: +SET(PARAVIEW_ROOT_DIR "$ENV{PARAVIEW_ROOT_DIR}" CACHE PATH "Path to the ParaView installation") +IF(EXISTS "${PARAVIEW_ROOT_DIR}" AND (NOT VTK_ROOT_DIR)) + MESSAGE(STATUS "Looking for VTK in the ParaView installation (PARAVIEW_ROOT_DIR exists and VTK_ROOT_DIR is not defined) ...") + + # Extract sub-directory "paraview-x.xx": + FILE(GLOB VTK_DIR "${PARAVIEW_ROOT_DIR}/lib/cmake/paraview-*") + MESSAGE(STATUS "Setting VTK_DIR to: ${VTK_DIR}") +ENDIF() + +SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(VTK VTK_INCLUDE_DIRS 2) +MARK_AS_ADVANCED(VTK_DIR) + +IF(VTK_FOUND) + MESSAGE(STATUS "VTK version is ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}") + #MESSAGE(STATUS "VTK libraries are: ${VTK_LIBRARIES}") +ENDIF() + +IF(VTK_FOUND) + SALOME_ACCUMULATE_HEADERS(VTK_INCLUDE_DIRS) + SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${VTK_LIBRARIES}) + SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${VTK_LIBRARIES}) + SALOME_ACCUMULATE_ENVIRONMENT(PV_PLUGIN_PATH ${VTK_LIBRARIES}) +ENDIF() diff --git a/salome_adm/cmake_files/FindSphinx.cmake b/salome_adm/cmake_files/FindSphinx.cmake index 8e05c7a73..9871e4dd3 100644 --- a/salome_adm/cmake_files/FindSphinx.cmake +++ b/salome_adm/cmake_files/FindSphinx.cmake @@ -1,11 +1,9 @@ # - Sphinx detection # -# Output variable: SPHINX_EXECUTABLE -# +# Output variables: +# SPHINX_EXECUTABLE - path to the Sphinx executable +# SPHINX_PYTHONPATH - path to the Sphinx Python modules # -# The executable 'sphinx-build' is looked for and returned in the above variable. -# - ########################################################################### # Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE # @@ -30,8 +28,16 @@ # ########################################################################### -FIND_PROGRAM(SPHINX_EXECUTABLE sphinx-build) +FIND_PROGRAM(SPHINX_EXECUTABLE sphinx-build PATH_SUFFIXES Scripts) +# Get root dir locally, going up two levels from the exec: +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${SPHINX_EXECUTABLE}" PATH) +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH) +IF(WIN32) + SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/site-packages") +ELSE() + SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") +ENDIF() # Handle the standard arguments of the find_package() command: INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE) diff --git a/salome_adm/cmake_files/SalomeKERNELConfig.cmake.in b/salome_adm/cmake_files/SalomeKERNELConfig.cmake.in deleted file mode 100644 index 60fa8cc39..000000000 --- a/salome_adm/cmake_files/SalomeKERNELConfig.cmake.in +++ /dev/null @@ -1,182 +0,0 @@ -# - 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 -# -# Other stuff specific to this package: -# SALOME_USE_MPI - -# SALOME_BUILD_DOC - -# SALOME_BUILD_TESTS - -# SALOME_LIGHT_ONLY - - -############################################################### -# 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 SALOMEBasics AND NOT @PROJECT_NAME@_BINARY_DIR) - INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE@/@PROJECT_NAME@Targets.cmake") -ENDIF() - -# Package root dir: -SET_AND_CHECK(KERNEL_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") - -# Include directories and definitions -SET_AND_CHECK(KERNEL_INCLUDE_DIRS "${KERNEL_ROOT_DIR_EXP}/@SALOME_INSTALL_HEADERS@") -#SET(KERNEL_INCLUDE_DIRS "${KERNEL_INCLUDE_DIRS};@_SalomeKERNEL_EXTRA_HEADERS@") -SET(KERNEL_DEFINITIONS) - -#### Now the specificities - -# Options exported by the package: -SET(SALOME_USE_MPI @SALOME_USE_MPI@) -IF(SALOME_USE_MPI) - SET(KERNEL_INCLUDE_DIRS "${KERNEL_INCLUDE_DIRS};@MPI_INCLUDE_DIRS@") - SET(KERNEL_DEFINITIONS "@MPI_DEFINITIONS@") -ENDIF() - -SET(SALOME_BUILD_DOC @SALOME_BUILD_DOC@) -SET(SALOME_BUILD_TESTS @SALOME_BUILD_TESTS@) -SET(SALOME_LIGHT_ONLY @SALOME_LIGHT_ONLY@) -SET(SALOME_USE_LIBBATCH @SALOME_USE_LIBBATCH@) - -# Prerequisites: -IF(SALOME_BUILD_TESTS) - SET_AND_CHECK(CPPUNIT_ROOT_DIR_EXP "@PACKAGE_CPPUNIT_ROOT_DIR@") -ENDIF() -IF(SALOME_BUILD_DOC) - SET_AND_CHECK(GRAPHVIZ_ROOT_DIR_EXP "@PACKAGE_GRAPHVIZ_ROOT_DIR@") - SET_AND_CHECK(DOXYGEN_ROOT_DIR_EXP "@PACKAGE_DOXYGEN_ROOT_DIR@") - SET_AND_CHECK(SPHINX_ROOT_DIR_EXP "@PACKAGE_SPHINX_ROOT_DIR@") -ENDIF() -IF(SALOME_USE_MPI) - SET_AND_CHECK(MPI_ROOT_DIR_EXP "@PACKAGE_MPI_ROOT_DIR@") -ENDIF() -IF(NOT SALOME_LIGHT_ONLY) - SET_AND_CHECK(OMNIORB_ROOT_DIR_EXP "@PACKAGE_OMNIORB_ROOT_DIR@") - SET_AND_CHECK(OMNIORBPY_ROOT_DIR_EXP "@PACKAGE_OMNIORBPY_ROOT_DIR@") -ENDIF() -IF(SALOME_USE_LIBBATCH) - SET_AND_CHECK(LIBBATCH_ROOT_DIR_EXP "@PACKAGE_LIBBATCH_ROOT_DIR@") -ENDIF() - -# We need to export Boost_INCLUDE_DIRS because dependent projects may use header file -# SALOMEDSClient_definitions.hxx that depends on Boost shared pointers -SET_AND_CHECK(BOOST_ROOT_DIR_EXP "@PACKAGE_BOOST_ROOT_DIR@") -SET(KERNEL_INCLUDE_DIRS "${KERNEL_INCLUDE_DIRS};@Boost_INCLUDE_DIRS@") -SET(KERNEL_DEFINITIONS "${KERNEL_DEFINITIONS};@BOOST_DEFINITIONS@") - -SET_AND_CHECK(PTHREAD_ROOT_DIR_EXP "@PACKAGE_PTHREAD_ROOT_DIR@") -SET_AND_CHECK(HDF5_ROOT_DIR_EXP "@PACKAGE_HDF5_ROOT_DIR@") -SET_AND_CHECK(LIBXML2_ROOT_DIR_EXP "@PACKAGE_LIBXML2_ROOT_DIR@") -SET_AND_CHECK(PYTHON_ROOT_DIR_EXP "@PACKAGE_PYTHON_ROOT_DIR@") -SET_AND_CHECK(SWIG_ROOT_DIR_EXP "@PACKAGE_SWIG_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 CppUnit Graphviz Doxygen Sphinx MPI omniORB LibBatch PThread Boost HDF5 libXml2 Python) -SET(_PREREQ_CONFIG_DIR "@CppUnit_DIR@" "@Graphviz_DIR@" "@Doxygen_DIR@" "@Sphinx_DIR@" - "@MPI_DIR@" "@omniORB_DIR@" "@LibBatch_DIR@" "@PThread_DIR@" "@Boost_DIR@" "@HDF5_DIR@" - "@libXml2_DIR@" "@Python_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 "@SALOME_INSTALL_AMCONFIG@") # to be removed -SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@") # to be removed - -# Exposed targets: -SET(KERNEL_CalciumC CalciumC) -SET(KERNEL_DF DF) -SET(KERNEL_Launcher Launcher) -SET(KERNEL_LifeCycleCORBATest LifeCycleCORBATest) -SET(KERNEL_NamingServiceTest NamingServiceTest) -SET(KERNEL_OpUtil OpUtil) -SET(KERNEL_Registry Registry) -SET(KERNEL_ResourcesManager ResourcesManager) -SET(KERNEL_SALOMEBasics SALOMEBasics) -SET(KERNEL_SalomeCatalog SalomeCatalog) -SET(KERNEL_SalomeCommunication SalomeCommunication) -SET(KERNEL_SalomeContainer SalomeContainer) -SET(KERNEL_SalomeDatastream SalomeDatastream) -SET(KERNEL_SalomeDSCContainer SalomeDSCContainer) -SET(KERNEL_SalomeDSClient SalomeDSClient) -SET(KERNEL_SalomeDSCSupervBasic SalomeDSCSupervBasic) -SET(KERNEL_SalomeDSCSuperv SalomeDSCSuperv) -SET(KERNEL_SalomeDSImpl SalomeDSImpl) -SET(KERNEL_SALOMEDSImplTest SALOMEDSImplTest) -SET(KERNEL_SalomeDS SalomeDS) -SET(KERNEL_SALOMEDSTest SALOMEDSTest) -SET(KERNEL_SalomeGenericObj SalomeGenericObj) -SET(KERNEL_SalomeHDFPersist SalomeHDFPersist) -SET(KERNEL_SalomeIDLKernel SalomeIDLKernel) -SET(KERNEL_SalomeLauncher SalomeLauncher) -SET(KERNEL_SalomeLifeCycleCORBA SalomeLifeCycleCORBA) -SET(KERNEL_SALOMELocalTrace SALOMELocalTrace) -SET(KERNEL_SALOMELocalTraceTest SALOMELocalTraceTest) -SET(KERNEL_SalomeLoggerServer SalomeLoggerServer) -SET(KERNEL_SalomeMPIContainer SalomeMPIContainer) -SET(KERNEL_SalomeNotification SalomeNotification) -SET(KERNEL_SalomeNS SalomeNS) -SET(KERNEL_SalomeResourcesManager SalomeResourcesManager) -SET(KERNEL_SalomeTestComponentEngine SalomeTestComponentEngine) -SET(KERNEL_SalomeTestMPIComponentEngine SalomeTestMPIComponentEngine) -SET(KERNEL_SALOMETraceCollectorTest SALOMETraceCollectorTest) -SET(KERNEL_TOOLSDS TOOLSDS) -SET(KERNEL_UtilsTest UtilsTest) -SET(KERNEL_with_loggerTraceCollector with_loggerTraceCollector) -SET(KERNEL_SalomeKernelHelpers SalomeKernelHelpers) - - diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index a156c08b0..ea9604d2a 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -286,31 +286,33 @@ MACRO(SALOME_PACKAGE_REPORT_AND_CHECK) IF(SALOME_PACKAGE_REPORT_JUSTIFY) SET(_length ${SALOME_PACKAGE_REPORT_JUSTIFY}) ELSE() - SET(_length 10) + SET(_length 23) ENDIF() MESSAGE(STATUS "") MESSAGE(STATUS " Optional packages - Detection report ") MESSAGE(STATUS " ==================================== ") MESSAGE(STATUS "") - LIST(LENGTH _SALOME_OPTIONAL_PACKAGES_names _list_len) - # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... - MATH(EXPR _range "${_list_len}-1") - FOREACH(_idx RANGE ${_range}) - LIST(GET _SALOME_OPTIONAL_PACKAGES_names ${_idx} _pkg_name) - LIST(GET _SALOME_OPTIONAL_PACKAGES_found ${_idx} _pkg_found) - LIST(GET _SALOME_OPTIONAL_PACKAGES_flags ${_idx} _pkg_flag) - SALOME_JUSTIFY_STRING(${_pkg_name} ${_length} _pkg_name) - IF(_pkg_found) - SET(_found_msg "Found") - SET(_flag_msg "") - ELSE() - SET(_will_fail ON) - SET(_found_msg "NOT Found") - SET(_flag_msg " - ${_pkg_flag} can be switched OFF to skip this prerequisite.") - ENDIF() + IF(DEFINED _SALOME_OPTIONAL_PACKAGES_names) + LIST(LENGTH _SALOME_OPTIONAL_PACKAGES_names _list_len) + # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... + MATH(EXPR _range "${_list_len}-1") + FOREACH(_idx RANGE ${_range}) + LIST(GET _SALOME_OPTIONAL_PACKAGES_names ${_idx} _pkg_name) + LIST(GET _SALOME_OPTIONAL_PACKAGES_found ${_idx} _pkg_found) + LIST(GET _SALOME_OPTIONAL_PACKAGES_flags ${_idx} _pkg_flag) + SALOME_JUSTIFY_STRING(${_pkg_name} ${_length} _pkg_name) + IF(_pkg_found) + SET(_found_msg "Found") + SET(_flag_msg "") + ELSE() + SET(_will_fail ON) + SET(_found_msg "NOT Found") + SET(_flag_msg " - ${_pkg_flag} can be switched OFF to skip this prerequisite.") + ENDIF() - MESSAGE(STATUS " * ${_pkg_name} -> ${_found_msg}${_flag_msg}") - ENDFOREACH() + MESSAGE(STATUS " * ${_pkg_name} -> ${_found_msg}${_flag_msg}") + ENDFOREACH() + ENDIF(DEFINED _SALOME_OPTIONAL_PACKAGES_names) MESSAGE(STATUS "") MESSAGE(STATUS "") @@ -628,7 +630,211 @@ MACRO(SALOME_ACCUMULATE_HEADERS lst) FOREACH(l IN LISTS ${lst}) LIST(FIND _${PROJECT_NAME}_EXTRA_HEADERS "${l}" _res) IF(_res EQUAL "-1") - LIST(APPEND _${PROJECT_NAME}_EXTRA_HEADERS "${l}") + IF(NOT "${l}" STREQUAL "/usr/include") + LIST(APPEND _${PROJECT_NAME}_EXTRA_HEADERS "${l}") + ENDIF() ENDIF() ENDFOREACH() ENDMACRO(SALOME_ACCUMULATE_HEADERS) + +######################################################################### +# SALOME_ACCUMULATE_ENVIRONMENT() +# +# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(envvar value [value ...]) +# +# ARGUMENTS: +# envvar [in] environment variable name, e.g. PATH +# value [in] value(s) to be added to environment variable +# +# This macro is called in the various FindSalomeXYZ.cmake modules to +# accumulate environment variables, to be used later to run some command +# in proper environment. +# +# 1. Each envrironment variable is stored in specific CMake variable +# _${PROJECT_NAME}_EXTRA_ENV_, where is name of variable. +# 2. Full list of environment variable names is stored in CMake variable +# _${PROJECT_NAME}_EXTRA_ENV. +# +# Notes: +# - The arguments list can include optional CHECK or NOCHECK keywords: +# * For all arguments following CHECK keyword the macro perform an +# additional check (see below); this is the default mode, it is suitable +# for path variables (PATH, LD_LIBRARY_PATH, etc). +# * For all arguments following NOCHECK keyword, no additional check is +# performed. +# Checking an argument means that we check: +# - That the path actually exists +# - That this is not a standard system path (starting with "/usr"); this avoids +# polluting LD_LIBRARY_PATH or PATH with things like "/usr/lib64" ... +# +MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar) + SET(_is_check ON) + FOREACH(_item ${ARGN}) + IF(${_item} STREQUAL "NOCHECK") + SET(_is_check OFF) + ELSEIF(${_item} STREQUAL "CHECK") + SET(_is_check ON) + ELSE() + IF(_is_check) + IF(NOT IS_DIRECTORY ${_item}) + IF(TARGET ${_item}) + GET_TARGET_PROPERTY(_item ${_item} LOCATION) + ENDIF() + GET_FILENAME_COMPONENT(_item ${_item} PATH) + ENDIF() + IF(EXISTS ${_item}) + STRING(REGEX MATCH "^(/usr|/lib|/bin)" _usr_find ${_item}) + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) + IF(NOT _usr_find AND _res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) + ENDIF() + ENDIF() + ELSE(_is_check) + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) + IF( _res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) + ENDIF() + ENDIF(_is_check) + ENDIF() + ENDFOREACH() + + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res) + IF(_res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV ${envvar}) + ENDIF() + SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "SET\(${PROJECT_NAME}_EXTRA_ENV ${_${PROJECT_NAME}_EXTRA_ENV}\)") + FOREACH(_res ${_${PROJECT_NAME}_EXTRA_ENV}) + SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "${_${PROJECT_NAME}_EXTRA_ENV_FULL}\nSET\(${PROJECT_NAME}_EXTRA_ENV_${_res} ${_${PROJECT_NAME}_EXTRA_ENV_${_res}}\)") + ENDFOREACH() +ENDMACRO(SALOME_ACCUMULATE_ENVIRONMENT) + +######################################################################### +# SALOME_GENERATE_ENVIRONMENT_SCRIPT() +# +# USAGE: SALOME_GENERATE_ENVIRONMENT_SCRIPT(output script cmd opts) +# +# ARGUMENTS: +# output [out] output command, e.g. for creation of target. +# script [in] output environement script name +# cmd [in] input command, e.g. sphinx or python command. +# opts [in] options for input command (cmd). +# +# This macro is called when it's necessary to use given environment to run some command. +# Macro generates environement script using previously created variables +# _${PROJECT_NAME}_EXTRA_ENV_, where is name of variable and +# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT); +# and puts generated command in proper environment into argument. +# +# Notes: +# - If