Salome HOME
b30c3ca01b16d67eac2f50bce405fb240d18eb35
[modules/geom.git] / doc / salome / gui / GEOM / CMakeLists.txt
1 # Copyright (C) 2012-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/SalomeMacros.cmake)
21
22 SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
23 SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
24 SALOME_CONFIGURE_FILE(doxyfile_tui.in doxyfile_tui)
25 SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
26 SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html)
27
28 # Generate a temporary python file, needed for the genaration of the documentation
29 # of the built-in Geometry plugins.
30 SET(DOC_GEOM_PluginsList AdvancedGEOM STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin)
31 IF(SALOME_GEOM_USE_VTK)
32   SET(DOC_GEOM_PluginsList ${DOC_GEOM_PluginsList} VTKPlugin)
33 ENDIF()
34 SALOME_ACCUMULATE_ENVIRONMENT(GEOM_PluginsList NOCHECK ${DOC_GEOM_PluginsList})
35 SET(geom_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_geom_methods.py")
36 SET(plugins_cmd_options ${geom_file} -o tmp1/geomBuilder.py ${DOC_GEOM_PluginsList})
37 SALOME_GENERATE_ENVIRONMENT_SCRIPT(plugins_cmd env_script "${PYTHON_EXECUTABLE}" "${plugins_cmd_options}")
38 # Install a script
39 SALOME_INSTALL_SCRIPTS(collect_geom_methods.py ${SALOME_INSTALL_BINS})
40
41 SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
42 IF(WIN32)
43   STRING(REPLACE "/" "\\" f ${f})
44 ENDIF(WIN32)
45
46 ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp
47   COMMAND ${CMAKE_COMMAND} -E make_directory tmp1
48   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomBuilder.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/geomBuilder.py
49   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/gsketcher.py   ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/gsketcher.py
50   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomtools.py   ${CMAKE_SOURCE_DIR}/src/GEOM_PY/geomtools.py
51   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/sketcher.py    ${CMAKE_SOURCE_DIR}/src/GEOM_PY/sketcher.py
52   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/structelem.py  ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/__init__.py
53   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/parts.py       ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/parts.py
54   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/orientation.py ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/orientation.py
55   COMMAND ${plugins_cmd}
56   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_tui 
57   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
58   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
59   COMMAND  ${CMAKE_COMMAND} -E remove_directory tmp
60   COMMAND  ${CMAKE_COMMAND} -E remove_directory tmp1
61   VERBATIM 
62   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
63 )
64
65 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
66 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GEOM DESTINATION ${SALOME_INSTALL_DOC}/gui)
67 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
68 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM/geompy_doc)
69 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
70 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/ExtractAndRebuild.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
71 INSTALL(FILES input/geompy_migration.doc input/tui_auto_completion_documentation.doc input/tui_execution_distribution.doc DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM/input)
72
73 FILE(GLOB tag_files ${CMAKE_CURRENT_BINARY_DIR}/*.tag)
74 SET(make_clean_files GEOM ${tag_files})
75 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")