]> SALOME platform Git repositories - modules/homard.git/commitdiff
Salome HOME
CMake:
authormpa <mpa@opencascade.com>
Fri, 1 Nov 2013 07:48:01 +0000 (07:48 +0000)
committermpa <mpa@opencascade.com>
Fri, 1 Nov 2013 07:48:01 +0000 (07:48 +0000)
Edit documentation. Use salome macros to set the environment for sphinx run.

doc/en/CMakeLists.txt
doc/fr/CMakeLists.txt

index 13c2ca9582da614a144cbc7c7297987fdc7283e1..ad003d55f9b69763ee42cd93b0e9c89eb25cab94 100755 (executable)
 # 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 ...
-
-# Prepare Sphinx options
-SET(SPHINXOPTS
-)
-
-SET(SPHINXBUILD
-  sphinx-build
-)
-
 SALOME_CONFIGURE_FILE(conf.py.in conf.py)
 
-# 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(WINDOWS)
-  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=${CMAKE_INSTALL_PREFIX}\\${SALOME_INSTALL_PYTHON}\;%PYTHONPATH%
-  @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\${SALOME_INSTALL_PYTHON_SHARED}\;%PYTHONPATH%
-  @SET PYTHONPATH=${HDF5_ROOT_DIR}\\lib\;%PYTHONPATH%
-  @SET PYTHONPATH=${MPI_ROOT_DIR}\\lib\;%PYTHONPATH%
-
-  @SET PYTHONPATH=${KERNEL_ROOT_DIR}\\bin\\salome\;%PYTHONPATH%
-  @SET PATH=${KERNEL_ROOT_DIR}\\lib\\salome\;%PATH%
-  @SET PYTHONPATH=${KERNEL_ROOT_DIR}\\${SALOME_INSTALL_PYTHON}\;%PYTHONPATH%
-  @SET PYTHONPATH=${KERNEL_ROOT_DIR}\\${SALOME_INSTALL_PYTHON_SHARED}\;%PYTHONPATH%
-
-  @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(WINDOWS)
-  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=${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}:\${PYTHONPATH}
-  export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED}:\${PYTHONPATH}
-  export PYTHONPATH=${HDF5_ROOT_DIR}/lib:\${PYTHONPATH}
-  export PYTHONPATH=${MPI_ROOT_DIR}/lib:\${PYTHONPATH}
-
-  export PYTHONPATH=${KERNEL_ROOT_DIR}/bin/salome:\${PYTHONPATH}
-  export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
-  export PYTHONPATH=${KERNEL_ROOT_DIR}/${SALOME_INSTALL_PYTHON}:\${PYTHONPATH}
-  export PYTHONPATH=${KERNEL_ROOT_DIR}/${SALOME_INSTALL_PYTHON_SHARED}:\${PYTHONPATH}
-
-  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}
-"
-  )
-  SET(EXT "sh")
-  SET(CALL_STR ".")
-ENDIF(WINDOWS)
-
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}")
+SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html ${CMAKE_CURRENT_SOURCE_DIR} html)
+SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}")            
 
-ADD_CUSTOM_TARGET(html_docs_en ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINXBUILD} -c ${PROJECT_BINARY_DIR}/doc/en -b html ${CMAKE_CURRENT_SOURCE_DIR} html)
+ADD_CUSTOM_TARGET(html_docs_en COMMAND ${_cmd})
 
 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs_en)")
 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/HOMARD/en)
index e6893b53f2bded8d1f9541d73461eb15cca2b4d2..da3d2500a72fde06eab0c3caa0afdc8dc6e23197 100755 (executable)
 # 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 ...
-
-# Prepare Sphinx options
-SET(SPHINXOPTS
-)
-
-SET(SPHINXBUILD
-  sphinx-build
-)
-
 SALOME_CONFIGURE_FILE(conf.py.in conf.py)
 
-# 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(WINDOWS)
-  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=${CMAKE_INSTALL_PREFIX}\\${SALOME_INSTALL_PYTHON}\;%PYTHONPATH%
-  @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}\\${SALOME_INSTALL_PYTHON_SHARED}\;%PYTHONPATH%
-  @SET PYTHONPATH=${HDF5_ROOT_DIR}\\lib\;%PYTHONPATH%
-  @SET PYTHONPATH=${MPI_ROOT_DIR}\\lib\;%PYTHONPATH%
-
-  @SET PYTHONPATH=${KERNEL_ROOT_DIR}\\bin\\salome\;%PYTHONPATH%
-  @SET PATH=${KERNEL_ROOT_DIR}\\lib\\salome\;%PATH%
-  @SET PYTHONPATH=${KERNEL_ROOT_DIR}\\${SALOME_INSTALL_PYTHON}\;%PYTHONPATH%
-  @SET PYTHONPATH=${KERNEL_ROOT_DIR}\\${SALOME_INSTALL_PYTHON_SHARED}\;%PYTHONPATH%
-
-  @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(WINDOWS)
-  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=${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON}:\${PYTHONPATH}
-  export PYTHONPATH=${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED}:\${PYTHONPATH}
-  export PYTHONPATH=${HDF5_ROOT_DIR}/lib:\${PYTHONPATH}
-  export PYTHONPATH=${MPI_ROOT_DIR}/lib:\${PYTHONPATH}
-
-  export PYTHONPATH=${KERNEL_ROOT_DIR}/bin/salome:\${PYTHONPATH}
-  export LD_LIBRARY_PATH=${KERNEL_ROOT_DIR}/lib/salome:\${LD_LIBRARY_PATH}
-  export PYTHONPATH=${KERNEL_ROOT_DIR}/${SALOME_INSTALL_PYTHON}:\${PYTHONPATH}
-  export PYTHONPATH=${KERNEL_ROOT_DIR}/${SALOME_INSTALL_PYTHON_SHARED}:\${PYTHONPATH}
-
-  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}
-"
-  )
-  SET(EXT "sh")
-  SET(CALL_STR ".")
-ENDIF(WINDOWS)
-
-FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} "${SCR}")
+SET(_cmd_options -c ${CMAKE_CURRENT_BINARY_DIR} -b html ${CMAKE_CURRENT_SOURCE_DIR} html)
+SALOME_GENERATE_ENVIRONMENT_SCRIPT(_cmd env_script "${SPHINX_EXECUTABLE}" "${_cmd_options}")            
 
-ADD_CUSTOM_TARGET(html_docs_fr ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/env_s.${EXT} && ${SPHINXBUILD} -c ${PROJECT_BINARY_DIR}/doc/fr -b html ${CMAKE_CURRENT_SOURCE_DIR} html)
+ADD_CUSTOM_TARGET(html_docs_fr COMMAND ${_cmd})
 
 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target html_docs_fr)")
 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ DESTINATION ${SALOME_INSTALL_DOC}/gui/HOMARD/fr)
 
-SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES html)
\ No newline at end of file
+SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES html)