Salome HOME
Build Geometry documentation under Windows.
[modules/geom.git] / doc / salome / gui / GEOM / CMakeLists.txt
1 # Copyright (C) 2012-2019  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 SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
21 SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
22 SALOME_CONFIGURE_FILE(doxyfile_tui.in doxyfile_tui)
23 SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
24 SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html)
25
26 # Generate a temporary python file, needed for the generation of the documentation
27 # of the built-in Geometry plugins.
28 SET(DOC_GEOM_PluginsList AdvancedGEOM STLPlugin BREPPlugin STEPPlugin IGESPlugin XAOPlugin)
29 IF(SALOME_GEOM_USE_VTK)
30   SET(DOC_GEOM_PluginsList ${DOC_GEOM_PluginsList} VTKPlugin)
31 ENDIF()
32 SALOME_ACCUMULATE_ENVIRONMENT(GEOM_PluginsList NOCHECK ${DOC_GEOM_PluginsList})
33 SET(geom_file "${CMAKE_CURRENT_SOURCE_DIR}/collect_geom_methods.py")
34 SET(plugins_cmd_options ${geom_file} -o tmp1/geomBuilder.py ${DOC_GEOM_PluginsList})
35
36 SET(ADD_VARS)
37 IF(WIN32 AND "$ENV{SALOME_HAS_GLOBAL_ENV}" STREQUAL "1")
38
39   FOREACH(plg ${DOC_GEOM_PluginsList})
40     LIST(APPEND ADD_VARS GEOM_PluginsList=${plg})
41   ENDFOREACH()
42   LIST(APPEND ADD_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome)
43   LIST(APPEND ADD_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome)
44   LIST(APPEND ADD_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome/shared_modules)
45 ENDIF()
46
47 SALOME_GENERATE_ENVIRONMENT_SCRIPT(plugins_cmd env_script "${PYTHON_EXECUTABLE}" "${plugins_cmd_options}" ADDITIONAL_VARIABLES ${ADD_VARS})
48 # Install a script
49 SALOME_INSTALL_SCRIPTS(collect_geom_methods.py ${SALOME_INSTALL_BINS})
50
51 SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
52 IF(WIN32)
53   STRING(REPLACE "/" "\\" f ${f})
54 ENDIF(WIN32)
55
56 ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp
57   COMMAND ${CMAKE_COMMAND} -E make_directory tmp1
58   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomBuilder.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/geomBuilder.py
59   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/gsketcher.py   ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/gsketcher.py
60   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomtools.py   ${CMAKE_SOURCE_DIR}/src/GEOM_PY/geomtools.py
61   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/sketcher.py    ${CMAKE_SOURCE_DIR}/src/GEOM_PY/sketcher.py
62   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/structelem.py  ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/__init__.py
63   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/parts.py       ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/parts.py
64   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/orientation.py ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/orientation.py
65   COMMAND ${plugins_cmd}
66   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_tui 
67   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
68   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
69   COMMAND  ${CMAKE_COMMAND} -E remove_directory tmp
70   COMMAND  ${CMAKE_COMMAND} -E remove_directory tmp1
71   VERBATIM 
72   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
73 )
74
75 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
76 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GEOM DESTINATION ${SALOME_INSTALL_DOC}/gui)
77 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
78 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM/geompy_doc)
79 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
80 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/ExtractAndRebuild.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
81 INSTALL(FILES input/geompy_migration.doc input/tui_auto_completion_documentation.doc input/tui_execution_distribution.doc DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM/input)
82
83 FILE(GLOB tag_files ${CMAKE_CURRENT_BINARY_DIR}/*.tag)
84 SET(make_clean_files GEOM ${tag_files})
85 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")