From: ana Date: Mon, 22 Oct 2012 08:41:19 +0000 (+0000) Subject: Generating documentation by CMake X-Git-Tag: V6_6_0a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dd5d551117a36bcbfcb671fbddc6c7c4214d2b78;p=modules%2Fsmesh.git Generating documentation by CMake --- diff --git a/doc/salome/gui/SMESH/CMakeLists.txt b/doc/salome/gui/SMESH/CMakeLists.txt index 513460f28..681f6e2a8 100644 --- a/doc/salome/gui/SMESH/CMakeLists.txt +++ b/doc/salome/gui/SMESH/CMakeLists.txt @@ -1,29 +1,4 @@ -# --------------------------------------------------------------------- -# This file was automatically generated by am2cmake (erwan.adam@cea.fr) -# --------------------------------------------------------------------- - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(bin_PROGRAMS) - SET(AM_CPPFLAGS -I${CMAKE_BINARY_DIR} ) - SET(AM_CXXFLAGS -I${CMAKE_BINARY_DIR}) - SET(LDADD) - SET(pythondir lib/python${PYTHON_VERSION}/site-packages) - SET(salomepythondir ${pythondir}/salome) - SET(salomepypkgdir ${salomepythondir}/salome) - - - IF(KERNEL_ROOT_DIR) - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - ENDIF(KERNEL_ROOT_DIR) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DWITH_SMESH_CANCEL_COMPUTE) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DWITH_SMESH_CANCEL_COMPUTE) - -# Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +# 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 @@ -42,210 +17,62 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# File : Makefile.in -# Author : Vasily Rusyaev (Open Cascade NN) -# Modified by : Alexander BORODIN (OCN) - autotools usage -# Module : doc -# -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(EXTRA_DIST - ${EXTRA_DIST} - images - input - static/footer.html - static/doxygen.css -) - -SET(dist_salomescript_PYTHON - collect_mesh_methods.py -) - -SET(guidocdir - ${docdir}/gui/SMESH -) -SET(guidoc_DATA - images/head.png -) - -SET(DOC_PYTHONPATH - ${prefix}/bin/salome:${prefix}/lib/python${PYTHON_VERSION}/site-packages/salome:${MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT}/lib64/python${PYTHON_VERSION}/site-packages -) -SET(DOC_SMESH_MeshersList - StdMeshers -) - -# to have smesh.py in the documentation instead of smeshDC.py -# we create dummy smesh.py from the smeshDC.py -# smesh.py: ../../../../src/SMESH_SWIG/smeshDC.py -#)/ { match( $$0, /^ +/); print substr( $$0, 1+RLENGTH ); next } /^class smeshDC/ { next } //' $< > $@ -# @awk '/^class Mesh:/ { mesh_found=1 } // { if (mesh_found) {print $$0; next} } /^ +(def| - -# tmp/smesh.py: $(top_srcdir)/src/SMESH_SWIG/StdMeshersDC.py $(srcdir)/collect_mesh_methods.py -# @mkdir -p tmp && PYTHONPATH=$(DOC_PYTHONPATH):${PYTHONPATH} SMESH_MeshersList=$(DOC_SMESH_MeshersList) $(PYTHON) $(srcdir)/collect_mesh_methods.py -o $@ StdMeshers - -# usr_docs: doxyfile_py doxyfile smesh.py tmp/smesh.py -# @$(DOXYGEN) doxyfile_py ; $(DOXYGEN) doxyfile - -# docs: usr_docs - -# clean-local: -# @for filen in `find . -maxdepth 1` ; do case $${filen} in ./Makefile | ./doxyfile | ./doxyfile_py ) ;; . | .. | ./static ) ;; *) echo "Removing $${filen}" ; rm -rf $${filen} ;; esac ; done ; - -# install-data-local: usr_docs -# $(INSTALL) -d $(DESTDIR)$(docdir)/gui/SMESH -# @for filen in `find . -maxdepth 1` ; do case $${filen} in ./Makefile | ./doxyfile | ./doxyfile_py ) ;; ./doxyfile.bak | ./doxyfile_py.bak ) ;; . | .. | ./static ) ;; *) echo "Installing $${filen}" ; cp -rp $${filen} $(DESTDIR)$(docdir)/gui/SMESH ;; esac ; done ; cp -rp $(srcdir)/images/head.png $(DESTDIR)$(docdir)/gui/SMESH/smeshpy_doc ; - -# uninstall-local: -# rm -rf $(DESTDIR)$(docdir)/gui/SMESH - - - SET(top_builddir - ${CMAKE_BINARY_DIR} - ) - SET(top_srcdir - ${CMAKE_SOURCE_DIR} - ) - SET(srcdir - ${CMAKE_CURRENT_SOURCE_DIR} - ) - SET(builddir - ${CMAKE_CURRENT_BINARY_DIR} - ) - SET(datadir - ${CMAKE_INSTALL_PREFIX}/share - ) - SET(docdir - ${datadir}/doc/salome - ) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/doxyfile) - - - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile_py.in) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/doxyfile_py) - - - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/static/header.html.in) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/static/header.html) - - - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/static/header_py.html.in) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html) - - - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake) - IF(WINDOWS) - STRING(REPLACE "/" "\\" f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py") - ELSE(WINDOWS) - SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py") - ENDIF(WINDOWS) - ADD_CUSTOM_TARGET(usr_docs ${PYTHON_EXECUTABLE} ${f} smesh.py ${CMAKE_SOURCE_DIR}/src/SMESH_SWIG/smeshDC.py smesh - COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py - COMMAND ${DOXYGEN_EXECUTABLE} doxyfile - COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.remove(r'''smesh.py''')" - COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/SMESH''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/SMESH''', ignore=shutil.ignore_patterns('*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*')); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/SMESH''')" - VERBATIM - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) +SET(top_builddir ${CMAKE_BINARY_DIR}) +SET(top_srcdir ${CMAKE_SOURCE_DIR}) +SET(srcdir ${CMAKE_CURRENT_SOURCE_DIR}) +SET(builddir ${CMAKE_CURRENT_BINARY_DIR}) +SET(datadir${CMAKE_INSTALL_PREFIX}/share) +SET(docdir ${datadir}/doc/salome) +SET(guidocdir ${docdir}/gui/SMESH) - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - -FOREACH(f ${dist_salomescript_PYTHON}) - - SET(DEST bin/salome) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - +SALOME_CONFIGURE_FILE(doxyfile.in doxyfile) +SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py) +SALOME_CONFIGURE_FILE(static/header.html.in ${builddir}/static/header.html) +SALOME_CONFIGURE_FILE(static/header_py.html.in ${builddir}/static/header_py.html) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) +SALOME_INSTALL_SCRIPTS(collect_mesh_methods.py ${CMAKE_INSTALL_PREFIX}/bin/salome) - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${dist_salomescript_PYTHON}) +SET(DOC_SMESH_MeshersList StdMeshers) +SET(f1 "${srcdir}/collect_mesh_methods.py") +SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py") +IF(WINDOWS) + STRING(REPLACE "/" "\\" f ${f}) + STRING(REPLACE "/" "\\" f1 ${f1}) + STRING(REPLACE "/" "\\" SCR "@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 PATH=$ENV{KERNEL_ROOT_DIR}/lib/salome\;%PATH% + @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/bin/salome\;%PYTHONPATH% + @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% + @SET PYTHONPATH=$ENV{MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% + @SET PYTHONPATH=$ENV{MED_ROOT_DIR}/bin/salome\;%PYTHONPATH% + @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% + @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/bin/salome\;%PYTHONPATH% + @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH% + @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome\;%PYTHONPATH% + @SET SMESH_MeshersList=${DOC_SMESH_MeshersList} + ") + SET(EXT "bat") + SET(CALL_STR "call") +ELSE(WINDOWS) + SET(DOC_PYTHONPATH "${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${MED_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${GEOM_ROOT_DIR}/bin/salome:${GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${KERNEL_ROOT_DIR}/bin/salome:${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome:${OMNIORB_ROOT}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT}/lib64/python${PYTHON_VERSION}/site-packages") + SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:${PYTHONPATH} + export SMESH_MeshersList=${DOC_SMESH_MeshersList} + ") + SET(EXT "sh") + SET(CALL_STR ".") +ENDIF(WINDOWS) + +FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} "${SCR}") + +ADD_CUSTOM_TARGET(usr_docs ${PYTHON_EXECUTABLE} ${f} smesh.py ${CMAKE_SOURCE_DIR}/src/SMESH_SWIG/smeshDC.py smesh + COMMAND mkdir tmp && ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} && ${PYTHON_EXECUTABLE} ${f1} -o tmp/smesh.py StdMeshers + COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py + COMMAND ${DOXYGEN_EXECUTABLE} doxyfile + COMMAND ${PYTHON_EXECUTABLE} -c "import os, shutil; os.remove(r'''smesh.py'''); os.remove(r'''tmp_env.${EXT}'''); shutil.rmtree(r'''tmp''')" + COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/SMESH''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/SMESH''', ignore=shutil.ignore_patterns('*usr_docs*', '*CMakeFiles*', '*.cmake', 'doxyfile*', '*.vcproj', 'static', 'Makefile*')); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/SMESH''')" + VERBATIM + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +)