-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2016 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
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
-PROJECT(Salome_[Name_of_Application]_Profile C CXX)
+PROJECT(Salome_SALOME_Profile C CXX)
# Ensure a proper linker behavior:
CMAKE_POLICY(SET CMP0003 NEW)
SET(${PROJECT_NAME_UC}_VERSION
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-# Common CMake macros
-# ===================
-SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files")
-IF(EXISTS ${CONFIGURATION_ROOT_DIR})
- LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake")
- INCLUDE(SalomeMacros)
-ELSE()
- MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !")
-ENDIF()
-
# Find KERNEL
# ===========
SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
# User options
# ============
OPTION(SALOME_BUILD_TESTS "Build SALOME tests" ON)
-OPTION(SALOME_BUILD_DOC "Generate SALOME [Name_of_Application] documentation" ON)
-OPTION(SALOME_BUILD_WITH_QT5 "Build SALOME with Qt 5" OFF)
+OPTION(SALOME_BUILD_DOC "Generate SALOME SALOME documentation" ON)
IF(SALOME_BUILD_TESTS)
ENABLE_TESTING()
# KERNEL optionals:
IF(SALOME_BUILD_DOC)
- FIND_PACKAGE(SalomePython)
+ FIND_PACKAGE(SalomePythonInterp REQUIRED)
+ FIND_PACKAGE(SalomePythonLibs REQUIRED)
FIND_PACKAGE(SalomeSphinx)
SALOME_LOG_OPTIONAL_PACKAGE(Sphinx SALOME_BUILD_DOC)
ENDIF()
ENDIF(EXISTS ${GUI_ROOT_DIR})
# Qt
-IF(NOT SALOME_BUILD_WITH_QT5)
+IF(NOT SALOME_GUI_BUILD_WITH_QT5)
FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
ELSE()
FIND_PACKAGE(SalomeQt5 REQUIRED)
ENDIF()
-#FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui)
-#INCLUDE(${QT_USE_FILE})
-
# Directories
# (default values taken from KERNEL)
# ===========
SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH "Install path: SALOME Python scripts")
-# Specific to [NAME_OF_APPLICATION]:
-SET(SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/(name_of_application)_profile" CACHE PATH "Install path: SALOME [NAME_OF_APPLICATION] specific data")
-SET(SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_DOC_GUI "${SALOME_INSTALL_DOC}/gui/${PROJECT_NAME_UC}" CACHE PATH "Install path: SALOME [NAME_OF_APPLICATION] gui documentation")
-SET(SALOME_[NAME_OF_APPLICATION]_PROFILE_HTML_STATIC_PATH "${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_DOC_GUI}/_static" CACHE PATH "Install path: SALOME [NAME_OF_APPLICATION] html static data")
+# Specific to SALOME:
+SET(SALOME_SALOME_PROFILE_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/salome_profile" CACHE PATH "Install path: SALOME SALOME specific data")
+SET(SALOME_SALOME_PROFILE_INSTALL_DOC_GUI "${SALOME_INSTALL_DOC}/gui/${PROJECT_NAME_UC}" CACHE PATH "Install path: SALOME SALOME gui documentation")
+SET(SALOME_SALOME_PROFILE_HTML_STATIC_PATH "${SALOME_SALOME_PROFILE_INSTALL_DOC_GUI}/_static" CACHE PATH "Install path: SALOME SALOME html static data")
MARK_AS_ADVANCED(SALOME_INSTALL_SCRIPT_PYTHON)
SET(_salome_context_BASHRC
${KERNEL_ROOT_DIR}/bin/salome/appliskel/.bashrc
)
-FILE(TO_CMAKE_PATH $ENV{[NAME_OF_APPLICATION]_PROFILE_ROOT_DIR} _[NAME_OF_APPLICATION]_PROFILE_ROOT_DIR)
-SALOME_INSTALL_SCRIPTS("${_salome_context_BASHRC}" ${_[NAME_OF_APPLICATION]_PROFILE_ROOT_DIR})
+FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} _SALOME_PROFILE_ROOT_DIR)
+SALOME_INSTALL_SCRIPTS("${_salome_context_BASHRC}" ${_SALOME_PROFILE_ROOT_DIR})
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2016 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
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}/html/ DESTINATION ${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_DOC_GUI})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_SALOME_PROFILE_INSTALL_DOC_GUI})
SET(make_clean_files html doctrees)
SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")
-This directory contains the sources of [Name_of_Application]'s documentation
+This directory contains the sources of SALOME's documentation
master_doc = 'index'
# General information about the project.
-project = '(name_of_application)'
-copyright = '2010-2015 CEA/DEN, EDF R&D, OPEN CASCADE, ASTEK INDUSTRIE'
+project = 'salome'
+copyright = '2010-2016 CEA/DEN, EDF R&D, OPEN CASCADE, ASTEK INDUSTRIE'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
-version = '@SALOME[NAME_OF_APPLICATION]_MAJOR_VERSION@.@SALOME[NAME_OF_APPLICATION]_MINOR_VERSION@'
+version = '@SALOMESALOME_MAJOR_VERSION@.@SALOMESALOME_MINOR_VERSION@'
# The full version, including alpha/beta/rc tags.
-release = '@SALOME[NAME_OF_APPLICATION]_VERSION@'
+release = '@SALOMESALOME_VERSION@'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'default' and 'sphinxdoc'.
-html_theme = 'default'
+html_theme = '@SPHINX_THEME@'
# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['@SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_DOC_GUI@/_static']
+html_static_path = ['@SALOME_SALOME_PROFILE_INSTALL_DOC_GUI@/_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_file_suffix = ''
# Output file base name for HTML help builder.
-htmlhelp_basename = '(name_of_application)doc'
+htmlhelp_basename = 'salomedoc'
# Options for LaTeX output
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
- ('index', '(name_of_application).tex', '[Name_of_Application] User Documentation', 'A. Ribes', 'manual')
+ ('index', 'salome.tex', 'SALOME User Documentation', 'A. Ribes', 'manual')
]
# The name of an image file (relative to this directory) to place at the top of
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-[Name_of_Application]'s documentation
+SALOME's documentation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Outline
Introduction
==========================================
-Welcome to [Name_of_Application]'s documentation!
+Welcome to SALOME's documentation!
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2016 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
#
# --- resources ---
-SET([NAME_OF_APPLICATION]_PROFILE_RESOURCES_FILES
+SET(SALOME_PROFILE_RESOURCES_FILES
app_icon.png
splash.png
about.png
)
# --- rules ---
-INSTALL(FILES ${[NAME_OF_APPLICATION]_PROFILE_RESOURCES_FILES} DESTINATION ${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_RES_DATA})
+INSTALL(FILES ${SALOME_PROFILE_RESOURCES_FILES} DESTINATION ${SALOME_SALOME_PROFILE_INSTALL_RES_DATA})
# --- config ---
-SALOME_CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml INSTALL ${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_RES_DATA})
+SALOME_CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml INSTALL ${SALOME_SALOME_PROFILE_INSTALL_RES_DATA})
# --- sub-directories ---
ADD_SUBDIRECTORY( doc )
<parameter name="portkill" value="no"/>
<parameter name="killall" value="no"/>
<parameter name="noexcepthandler" value="no"/>
- <parameter name="modules" value="[LIST_OF_MODULES]"/>
<parameter name="pyModules" value=""/>
<parameter name="embedded" value="SalomeAppEngine,study,cppContainer,registry,moduleCatalog"/>
<parameter name="standalone" value=""/>
</section>
<section name="splash">
- <parameter name="image" value="%[Name_of_Application]_PROFILE_ROOT_DIR%/share/salome/resources/(name_of_application)_profile/splash.png"/>
+ <parameter name="image" value="%SALOME_PROFILE_ROOT_DIR%/share/salome/resources/salome_profile/splash.png"/>
<parameter name="text_colors" value="#ffffff|#000000"/>
<parameter name="show_percents" value="yes"/>
<parameter name="show_progress" value="yes"/>
<parameter name="font" value="Xirod,12,normal"/>
</section>
<section name="resources">
- <parameter name="LightApp" value="%[Name_of_Application]_PROFILE_ROOT_DIR%/share/salome/resources/(name_of_application)_profile"/>
+ <parameter name="LightApp" value="%SALOME_PROFILE_ROOT_DIR%/share/salome/resources/salome_profile"/>
</section>
</document>
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2016 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
sample.pdf
)
-INSTALL(FILES ${_bin_DOCUMENTS} DESTINATION ${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_DOC_GUI})
+INSTALL(FILES ${_bin_DOCUMENTS} DESTINATION ${SALOME_SALOME_PROFILE_INSTALL_DOC_GUI})
-This directory contains binaries of [Name_of_Application]'s documentation
+This directory contains binaries of SALOME's documentation
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2016 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
-# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2016 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
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2016 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
# --- rules ---
-QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_[NAME_OF_APPLICATION]_PROFILE_INSTALL_RES_DATA}")
+QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_SALOME_PROFILE_INSTALL_RES_DATA}")
</message>
<message>
<source>ABOUT_CAPTION</source>
- <translation>About [Name_of_Application]</translation>
+ <translation>About SALOME</translation>
</message>
<message>
<source>APP_NAME</source>
- <translation>[Name_of_Application] [SLOGAN]</translation>
+ <translation>SALOME </translation>
</message>
<message>
<source>APP_VERSION</source>
- <translation>V[VERSION]</translation>
+ <translation>V8.1.0b1</translation>
</message>
<message>
<source>ABOUT_LICENSE</source>
</message>
<message>
<source>ABOUT_VERSION</source>
- <translation>Version [VERSION]</translation>
+ <translation>Version 8.1.0b1</translation>
</message>
<message>
<source>ABOUT_TITLE</source>
- <translation>[Name_of_Application]</translation>
+ <translation>SALOME</translation>
</message>
</context>
</TS>
</message>
<message>
<source>ABOUT_CAPTION</source>
- <translation>A propos de [Name_of_Application]</translation>
+ <translation>A propos de SALOME</translation>
</message>
<message>
<source>APP_NAME</source>
- <translation>[Name_of_Application] [SLOGAN]</translation>
+ <translation>SALOME </translation>
</message>
<message>
<source>APP_VERSION</source>
- <translation>V[VERSION]</translation>
+ <translation>V8.1.0b1</translation>
</message>
<message>
<source>ABOUT_LICENSE</source>
</message>
<message>
<source>ABOUT_VERSION</source>
- <translation>Version [VERSION]</translation>
+ <translation>Version 8.1.0b1</translation>
</message>
<message>
<source>ABOUT_TITLE</source>
- <translation>[Name_of_Application]</translation>
+ <translation>SALOME</translation>
</message>
</context>
</TS>
</message>
<message>
<source>ABOUT_CAPTION</source>
- <translation>About [Name_of_Application]</translation>
+ <translation>About SALOME</translation>
</message>
<message>
<source>APP_NAME</source>
- <translation>[Name_of_Application] [SLOGAN]</translation>
+ <translation>SALOME </translation>
</message>
<message>
<source>APP_VERSION</source>
- <translation>V[VERSION]</translation>
+ <translation>V8.1.0b1</translation>
</message>
<message>
<source>ABOUT_LICENSE</source>
</message>
<message>
<source>ABOUT_VERSION</source>
- <translation>Version [VERSION]</translation>
+ <translation>Version 8.1.0b1</translation>
</message>
<message>
<source>ABOUT_TITLE</source>
- <translation>[Name_of_Application]</translation>
+ <translation>SALOME</translation>
</message>
</context>
</TS>
-# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2016 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
Commands:
=========
- start Starts a SALOME session (through virtual application)
- context Initializes SALOME context.
- shell Initializes SALOME context, and executes scripts passed
- as command arguments
- connect Connects a Python console to the active SALOME session
- kill <port(s)> Terminate SALOME session running on given ports for current user
- Port numbers must be separated by blank characters
- killall Kill *all* SALOME running sessions for current user
+ start Start a new SALOME instance.
+ context Initialize SALOME context. Current environment is extended.
+ shell Initialize SALOME context, attached to the last created SALOME
+ instance if any, and executes scripts passed as command arguments.
+ User works in a Shell terminal; SALOME environment is set but
+ application is not started.
+ connect Connect a Python console to the active SALOME instance.
+ kill <port(s)> Terminate SALOME instances running on given ports for current user.
+ Port numbers must be separated by blank characters.
+ killall Terminate *all* SALOME running instances for current user.
+ Do not start a new one.
test Run SALOME tests.
- info Display some information about SALOME
- help Show this message
+ info Display some information about SALOME.
+ help Show this message.
If no command is given, default to start.
to .cfg format before setting the context.
"""
def __init__(self, configFileNames=0):
+ self.getLogger().setLevel(logging.INFO)
#it could be None explicitely (if user use multiples setVariable...for standalone)
if configFileNames is None:
return
absoluteAppliPath = os.getenv('ABSOLUTE_APPLI_PATH','')
env_copy = os.environ.copy()
proc = subprocess.Popen(['python', os.path.join(absoluteAppliPath,"bin","salome","salomeContext.py"), pickle.dumps(self), pickle.dumps(args)], shell=False, close_fds=True, env=env_copy)
- msg = proc.communicate()
- return msg, proc.returncode
+ out, err = proc.communicate()
+ return out, err, proc.returncode
#
"""Append value to PATH environment variable"""
"""Append value to LD_LIBRARY_PATH environment variable"""
def addToLdLibraryPath(self, value):
- self.addToVariable('LD_LIBRARY_PATH', value)
+ if platform.system() == 'Windows':
+ self.addToVariable('PATH', value)
+ else:
+ self.addToVariable('LD_LIBRARY_PATH', value)
#
"""Append value to DYLD_LIBRARY_PATH environment variable"""
# Initialize SALOME environment
sys.argv = ['runSalome'] + args
import setenv
- setenv.main(True)
+ setenv.main(True, exeName="salome start")
import runSalome
runSalome.runSalome()
p.start()
p.join()
except ImportError:
+ # :TODO: should be declared obsolete
from killSalome import killAllPorts
killAllPorts()
pass
#! /usr/bin/env python
-# Copyright (C) 2013-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2016 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
if not currentKey or callPython:
raise SalomeContextException("args list must follow corresponding script file in command line.")
elt = elt.replace(argsPrefix, '')
- scriptArgs[len(scriptArgs)-1].args = [os.path.expanduser(x) for x in elt.split(",")]
+ # Special process if some items of 'args:' list are themselves lists
+ # Note that an item can be a list, but not a list of lists...
+ # So we can have something like this:
+ # myscript.py args:['file1','file2'],val1,"done",[1,2,3],[True,False],"ok"
+ # With such a call, an elt variable contains the string representing ['file1','file2'],val1,"done",[1,2,3],[True,False],"ok" that is '[file1,file2],val1,done,[1,2,3],[True,False],ok'
+ # We have to split elt to obtain: ['[file1,file2]','val1','done','[1,2,3]','[True,False]','ok']
+ contains_list = re.findall('(\[[^\]]*\])', elt)
+ if contains_list:
+ extracted_args = []
+ x = elt.split(",")
+ # x is ['[file1', 'file2]', 'val1', 'done', '[1', '2', '3]', '[True', 'False]', 'ok']
+ list_begin_indices = [i for i in xrange(len(x)) if x[i].startswith('[')] # [0, 4, 7]
+ list_end_indices = [i for i in xrange(len(x)) if x[i].endswith(']')] # [1, 6, 8]
+ start = 0
+ for lbeg, lend in zip(list_begin_indices,list_end_indices): # [(0, 1), (4, 6), (7, 8)]
+ if lbeg > start:
+ extracted_args += x[start:lbeg]
+ pass
+ extracted_args += [','.join(x[lbeg:lend+1])]
+ start = lend+1
+ pass
+ if start < len(x):
+ extracted_args += x[start:len(x)]
+ pass
+ scriptArgs[len(scriptArgs)-1].args = extracted_args
+ pass
+ else: # a single split is enough
+ scriptArgs[len(scriptArgs)-1].args = [os.path.expanduser(x) for x in elt.split(",")]
+ pass
currentKey = None
callPython = False
afterArgs = True
-# Copyright (C) 2012-2015 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2016 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
-This directory contains the tests of [Name_of_Application]
+This directory contains the tests of SALOME