-# Copyright (C) 2012 CEA/DEN, EDF R&D, OPEN CASCADE\r
-#\r
-# This library is free software; you can redistribute it and/or\r
-# modify it under the terms of the GNU Lesser General Public\r
-# License as published by the Free Software Foundation; either\r
-# version 2.1 of the License.\r
-#\r
-# This library is distributed in the hope that it will be useful,\r
-# but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\r
-# Lesser General Public License for more details.\r
-#\r
-# You should have received a copy of the GNU Lesser General Public\r
-# License along with this library; if not, write to the Free Software\r
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
-#\r
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com\r
-#\r
-\r
-SET(SPHINXOPTS\r
-)\r
-SET(SOURCEDIR\r
- ${CMAKE_CURRENT_SOURCE_DIR}\r
-)\r
-SET(PAPEROPT_a4\r
- -D\r
- latex_paper_size=a4\r
-)\r
-SET(ALLSPHINXOPTS\r
- -d\r
- doctrees\r
- ${PAPEROPT_a4}\r
- ${SPHINXOPTS}\r
- ${SOURCEDIR}\r
-)\r
-\r
-SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${CMAKE_CURRENT_BINARY_DIR}/conf.py") \r
-\r
-IF(WINDOWS)\r
- STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=%KERNEL_ROOT_DIR%/lib/python2.6/site-packages/salome\;%PYTHONPATH%\r
- @SET PYTHONPATH=%KERNEL_ROOT_DIR%/bin/salome\;%PYTHONPATH%\r
- @SET PATH=%KERNEL_ROOT_DIR%/lib/salome\;%PATH%\r
- @SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PYTHONPATH%\r
- @SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python\;%PYTHONPATH%\r
- @SET PATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PATH%\r
- ")\r
- SET(EXT "bat")\r
- SET(CALL_STR "call")\r
-ELSE(WINDOWS)\r
- SET(SCR "export PYTHONPATH=\${KERNEL_ROOT_DIR}/lib/python2.6/site-packages/salome:\${PYTHONPATH}\r
- export PYTHONPATH=\${KERNEL_ROOT_DIR}/bin/salome:\${PYTHONPATH}\r
- export LD_LIBRARY_PATH=\${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}\r
- export PYTHONPATH=\${OMNIORB_ROOT_USER}/omniORB-4.1.5/lib:\${PYTHONPATH}\r
- export PYTHONPATH=\${OMNIORB_ROOT_USER}/omniORB-4.1.5/lib/python2.6/site-packages:\${PYTHONPATH}\r
- export LD_LIBRARY_PATH=\${INST_ROOT}/omniORB-4.1.5/lib:\${LD_LIBRARY_PATH}\r
- ")\r
- SET(EXT "sh")\r
- SET(CALL_STR ".")\r
-ENDIF(WINDOWS)\r
-\r
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}")\r
-\r
-ADD_CUSTOM_TARGET(html_docs ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINX_EXECUTABLE} -Q -c ${CMAKE_BINARY_DIR}/doc/docutils -W -b html ${ALLSPHINXOPTS} html\r
- COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''')\"\r
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}\r
-)\r
+# Copyright (C) 2012 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
+#
+
+SET(SPHINXOPTS
+)
+SET(SOURCEDIR
+ ${CMAKE_CURRENT_SOURCE_DIR}
+)
+SET(PAPEROPT_a4
+ -D
+ latex_paper_size=a4
+)
+SET(ALLSPHINXOPTS
+ -d
+ doctrees
+ ${PAPEROPT_a4}
+ ${SPHINXOPTS}
+ ${SOURCEDIR}
+)
+
+SALOME_CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" "${CMAKE_CURRENT_BINARY_DIR}/conf.py")
+
+IF(WINDOWS)
+ STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\lib\\python2.6\\site-packages\\salome\;%PYTHONPATH%
+ @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\bin\\salome\;%PYTHONPATH%
+ @SET PATH=${CMAKE_INSTALL_PREFIX}\\lib\\salome\;%PATH%
+ @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PYTHONPATH%
+ @SET PYTHONPATH=${OMNIORB_ROOT_USER}\\lib\\python\;%PYTHONPATH%
+ @SET PATH=${OMNIORB_ROOT_USER}\\lib\\x86_win32\;%PATH%
+ ")
+ SET(EXT "bat")
+ SET(CALL_STR "call")
+ELSE(WINDOWS)
+ SET(SCR "export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python2.6/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_USER}/lib:\${PYTHONPATH}
+ export PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python2.6/site-packages:\${PYTHONPATH}
+ export LD_LIBRARY_PATH=${OMNIORB_ROOT_USER}/lib:\${LD_LIBRARY_PATH}
+ ")
+ SET(EXT "sh")
+ SET(CALL_STR ".")
+ENDIF(WINDOWS)
+
+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 ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} html
+ COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/KERNEL/docutils''')\"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
INCLUDE(${GEOM_ROOT_DIR}/adm_local/cmake_files/FindGEOM.cmake)
INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake)
INCLUDE(${SMESH_ROOT_DIR}/adm_local/cmake_files/FindSMESH.cmake)
- INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindBLSURF.cmake)
+ INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindCADSURF.cmake)
""")
pass
if self.module in ["ghs3dplugin", "hexoticplugin"]:
INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
""")
pass
+ if self.module == "jobmanager":
+ newlines.append("""
+ INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
+ """)
+ pass
if self.module == "hxx2salome":
newlines.append("""
SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR})
pass
# --
newlines.append("""
- set(VERSION 6.5.0)
- set(SHORT_VERSION 6.5)
- set(XVERSION 0x060500)
+ set(VERSION 6.6.0)
+ set(SHORT_VERSION 6.6)
+ set(XVERSION 0x060600)
set(VERSION_DEV 1)
""")
pass
)
''')
self.files.append("static/header.html.in")
- elif self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['kernel', 'gui', 'geom', 'med', 'smesh', 'visu'] and self.root[-len('tui'):] == 'tui':
+ elif self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['kernel', 'gui', 'geom', 'med', 'smesh', 'visu', 'blsurfplugin'] and self.root[-len('tui'):] == 'tui' or operator.contains(self.root, 'doc') and mod in ['pyhello']:
newlines.append(r'''
SET(top_builddir
${CMAKE_BINARY_DIR}
${datadir}/doc/salome
)
''')
- self.files.append("static/header.html.in")
+ if mod not in ['blsurfplugin']:
+ self.files.append("static/header.html.in")
if mod in ['geom', 'smesh', 'visu','netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin',"ghs3dprlplugin"] and self.root[-len(mod):] == upmod:
self.files.append("static/header_py.html.in")
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)"""%(input, doc_gui_destination, doc_source, doc_gui_destination, head_source, doc_gui_destination))
from os import path
- if mod in ['geom', 'smesh', 'visu', 'netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin','ghs3dprlplugin'] and self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc'):
+ if mod in ['geom', 'smesh', 'visu', 'netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin','ghs3dprlplugin','pyhello'] and self.root[-len(mod):] == upmod and operator.contains(self.root, 'doc') or mod in ['pyhello'] and operator.contains(self.root, 'doc'):
ign = r"""'*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*'"""
if mod in ['geom', 'smesh']:
if mod == 'geom':
VERBATIM
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)"""%(prepare_generating_doc_src, prepare_generating_doc_src, tmp, upmod, tmp, tmp, input, tmp, doc_gui_destination, doc_gui_destination, ign, head_source, doc_gui_destination))
+ newlines.append(r"""ADD_DEPENDENCIES(usr_docs html_docs)""")
else:
config_f = ""
if mod in ['netgenplugin','blsurfplugin','hexoticplugin','ghs3dplugin', "ghs3dprlplugin"] :
- config_f = "doxyfile_py"
- else:
- config_f = "doxyfile_idl"
- newlines.append("""\t ADD_CUSTOM_TARGET(usr_docs ${DOXYGEN_EXECUTABLE} %s
+ config_f = "${DOXYGEN_EXECUTABLE} doxyfile_py"
+ elif mod not in ['pyhello']:
+ config_f = "${DOXYGEN_EXECUTABLE} doxyfile_idl"
+ newlines.append("""\t ADD_CUSTOM_TARGET(usr_docs %s
COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''',True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''',r'''%s''', ignore=shutil.ignore_patterns(%s)); shutil.copy(r'''%s''',r'''%s''')"
VERBATIM
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)"""%(config_f, doc_gui_destination, doc_gui_destination, ign, head_source, doc_gui_destination))
- elif mod == 'yacs' and operator.contains(self.root, upmod + '_SRC'+path.sep+'doc'):
+ elif mod in ['yacs', 'jobmanager'] and operator.contains(self.root, upmod + '_SRC'+path.sep+'doc'):
from sys import platform
params = '';
if platform == "win32":
params = '-Q';
ext = "bat"
prf = "call"
+ cmd = "STRING(REPLACE \"/\" \"\\\\\" SCR"
else:
ext = "sh"
prf = ". "
+ cmd = "SET(SCR"
doc_gui_destination = "${CMAKE_INSTALL_PREFIX}/share/doc/salome/tui/%s/docutils"%(upmod)
scr = self.writeEnvScript(upmod)
newlines.append(r"""
- IF(WINDOWS)
- STRING(REPLACE "/" "\\" SCR "%s")
- ELSE(WINDOWS)
- SET(SCR "%s")
- ENDIF(WINDOWS)
+ %s "%s")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s "${SCR}")
- ADD_CUSTOM_TARGET(html_docs %s ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s && ${SPHINX_EXECUTABLE} %s -c ${CMAKE_BINARY_DIR}/doc/docutils -W -b html ${ALLSPHINXOPTS} html
+ ADD_CUSTOM_TARGET(html_docs %s ${CMAKE_CURRENT_BINARY_DIR}/env_s.%s && ${SPHINX_EXECUTABLE} %s -c ${CMAKE_BINARY_DIR}/doc/docutils -b html ${ALLSPHINXOPTS} html
COMMAND ${PYTHON_EXECUTABLE} -c \"import shutil\;shutil.rmtree('''%s''', True)\;shutil.copytree('''${CMAKE_CURRENT_BINARY_DIR}/html''', '''%s''')\"
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"""%(scr,scr,ext,prf,ext,params, doc_gui_destination, doc_gui_destination))
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"""%(cmd, scr, ext, prf, ext, params, doc_gui_destination, doc_gui_destination))
# --
upmod = self.module.upper()
- if mod in ['kernel', 'gui', 'med', 'smesh', 'visu'] and self.root[-len('tui'):] == 'tui':
+ if mod in ['kernel', 'gui', 'med', 'smesh', 'visu', 'blsurfplugin'] and self.root[-len('tui'):] == 'tui':
if mod == 'kernel':
tmp = """\tADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE} -u
COMMAND ${DOXYGEN_EXECUTABLE}
if mod == 'visu':
tmp1= r"""\n COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/visuscreen.png''', r'''%s''')" """%(doc_tui_destination)
elif mod == 'smesh':
- extra_srcdir = "${CMAKE_CURRENT_SOURCE_DIR}/extra"
- tmp1= """\n COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/smeshscreen.png''', r'''%s'''); copy(r'''%s/AddNetgenInSalome2.pdf''', r'''%s'''); copy(r'''%s/PluginMeshers.html''', r'''%s''')"
- COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''%s/AddNetgenInSalome2.ps''', r'''%s'''); copy(r'''%s/AddNetgenInSalome2.sxw''', r'''%s''')" """%(doc_tui_destination, extra_srcdir,doc_destination, extra_srcdir,doc_destination, extra_srcdir,doc_destination,extra_srcdir,doc_destination)
+ tmp1= """\n COMMAND ${PYTHON_EXECUTABLE} -c "from shutil import copy; copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/smeshscreen.png''', r'''%s''')" """%(doc_tui_destination)
else:
tmp1=""
doc_source = "${CMAKE_CURRENT_BINARY_DIR}/%s"%(upmod)
+ inst_head_command=""
+ if mod not in ['blsurfplugin']:
+ inst_head_command = "; shutil.copy(r'''%s''', r'''%s''')"%(head_source, doc_tui_destination)
newlines.append(tmp + """
- COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''', True); shutil.copytree(r'''%s''', r'''%s'''); shutil.copy(r'''%s''', r'''%s''')" """%(doc_tui_destination, doc_source, doc_tui_destination, head_source, doc_tui_destination) + tmp1 + """
+ COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''%s''', True); shutil.copytree(r'''%s''', r'''%s''')%s" """%(doc_tui_destination, doc_source, doc_tui_destination, inst_head_command) + tmp1 + """
VERBATIM
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)""")
f.close()
return
- def writeEnvScript(self, upmod):
- from sys import platform, version_info
- p_version = """%s.%s"""%(version_info[0],version_info[1])
- python_path ="PYTHONPATH"
- path = ""
- begin = ""
- end = ""
- delim = ""
- cmd = ""
- pdir = ""
- omni = ""
- omni_py = ""
- if platform == "win32" :
- path = "PATH"
- begin = "%"
- end = "%"
- delim = ";"
- cmd = "@SET "
- omni = "/x86_win32"
- omni_py = "/python"
- pdir = "PDIR"
+ def writeEnvScript(self, upmod, buildmod=True):
+ import os, sys
+ p_version = sys.version[:3]
+ python_path = "PYTHONPATH"
+ root_dir = "%s_ROOT_DIR" % upmod
+ if sys.platform == "win32":
+ script_line = '@SET %(var)s=%(val)s;%%%(var)s%%\n'
+ var_line = '%%%s%%'
+ lib_path = "PATH"
+ omni = "x86_win32"
+ omni_py = "python"
+ pass
else:
- path = "LD_LIBRARY_PATH"
- begin = "\${"
- end = "}"
- delim = ":"
- cmd = "export "
- omni_py = "/python" + p_version + "/" + "site-packages"
- pdir = "INST_ROOT"
-
-
- path_ = begin + path + end
- root_dir_ = begin + upmod + "_ROOT_DIR" + end
- python_path_ = begin + python_path + end
- _python_path_ = delim + python_path_+ "\n"
- _path_ = delim + path_+ "\n"
- _pdir = begin + pdir + end
-
-
- script = cmd + " " + python_path + "=" + root_dir_+"/lib/python" + p_version \
- + "/site-packages/salome" + _python_path_
-
- script = script + cmd + " " + python_path + "=" + root_dir_+"/bin/salome" + \
- _python_path_
-
- script = script + cmd + " "+ path + "=" + root_dir_+"/lib/salome"+ _path_
-
+ script_line = 'export %(var)s=%(val)s:\$%(var)s\n'
+ var_line = '\${%s}'
+ lib_path = "LD_LIBRARY_PATH"
+ omni = ""
+ omni_py = "/".join( ["python%s"%p_version , "site-packages"] )
+ pass
+ #
+ script = ""
+ #
+ if buildmod:
+ script += script_line % { 'var':python_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "lib", "python%s"%p_version, "site-packages", "salome"] ) }
+ script += script_line % { 'var':python_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "bin", "salome"] ) }
+ script += script_line % { 'var':lib_path, 'val':"/".join( ["${CMAKE_INSTALL_PREFIX}", "lib", "salome"] ) }
+ pass
+ else:
+ script += script_line % { 'var':python_path, 'val':"/".join( [var_line % root_dir, "lib", "python%s"%p_version, "site-packages", "salome"] ) }
+ script += script_line % { 'var':python_path, 'val':"/".join( [var_line % root_dir, "bin", "salome"] ) }
+ script += script_line % { 'var':lib_path, 'val':"/".join( [var_line % root_dir, "lib", "salome"] ) }
+ pass
+ #
if upmod == "KERNEL" :
- script = script + cmd + " " + python_path + "=" + _pdir + \
- "/omniORB-4.1.5/lib" + omni + _python_path_
-
- script = script + cmd + " " + python_path + "=" + _pdir + \
- "/omniORB-4.1.5/lib" + omni_py + _python_path_
-
- script = script + cmd + " "+ path + "=" + _pdir+ "/omniORB-4.1.5/lib" + \
- omni + _path_
-
+ script += "\n"
+ if omni:
+ script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni] ) }
+ script += script_line % { 'var':lib_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni] ) }
+ pass
+ else:
+ script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib"] ) }
+ script += script_line % { 'var':lib_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib"] ) }
+ pass
+ script += script_line % { 'var':python_path, 'val':"/".join( ["${OMNIORB_ROOT_USER}", "lib", omni_py] ) }
+ pass
+ #
if upmod == "GEOM" :
- script = self.writeEnvScript("KERNEL") + script
- script = self.writeEnvScript("GUI") + script
-
+ script = self.writeEnvScript("KERNEL", False) + "\n" + script
+ script = self.writeEnvScript("GUI", False) + "\n" + script
+ pass
+ #
if upmod == "SMESH" :
- script = self.writeEnvScript("GEOM") + script
-
+ script = self.writeEnvScript("GEOM", False) + "\n" + script
+ pass
+
return script
pass