From: ana Date: Wed, 17 Oct 2012 06:21:34 +0000 (+0000) Subject: 0021308: EDF 1923 SMESH: Remove hard-coded dependency of the external mesh plugins... X-Git-Tag: V6_6_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7dd57261be4116a3c430351ccc2a4660cf6b0ff9;p=modules%2Fsmesh.git 0021308: EDF 1923 SMESH: Remove hard-coded dependency of the external mesh plugins from the SMESH module * Improve documentation for meshing plug-ins (in particular, dynamically added methods). Porting to CMake. --- diff --git a/doc/salome/gui/SMESH/CMakeLists.txt b/doc/salome/gui/SMESH/CMakeLists.txt new file mode 100644 index 000000000..513460f28 --- /dev/null +++ b/doc/salome/gui/SMESH/CMakeLists.txt @@ -0,0 +1,251 @@ +# --------------------------------------------------------------------- +# 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 +# +# 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 +# + +# 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}) + + + 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} + ) + + 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}) + + + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) + + + 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})