Salome HOME
Copyright update 2021
[modules/geom.git] / doc / salome / gui / GEOM / CMakeLists.txt
1 # Copyright (C) 2012-2021  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=${KERNEL_ROOT_DIR}/bin/salome)
44   LIST(APPEND ADD_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome)
45   LIST(APPEND ADD_VARS PYTHONPATH=${KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome)
46   LIST(APPEND ADD_VARS PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/salome/shared_modules)
47   LIST(APPEND ADD_VARS PATH=${CMAKE_INSTALL_PREFIX}/lib/salome)
48   LIST(APPEND ADD_VARS PATH=${KERNEL_ROOT_DIR}/lib/salome)
49 ENDIF()
50
51 SALOME_GENERATE_ENVIRONMENT_SCRIPT(plugins_cmd env_script "${PYTHON_EXECUTABLE}" "${plugins_cmd_options}" ADDITIONAL_VARIABLES ${ADD_VARS})
52 # Install a script
53 SALOME_INSTALL_SCRIPTS(collect_geom_methods.py ${SALOME_INSTALL_BINS})
54
55 SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
56 IF(WIN32)
57   STRING(REPLACE "/" "\\" f ${f})
58 ENDIF(WIN32)
59
60 ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp
61   COMMAND ${CMAKE_COMMAND} -E make_directory tmp1
62   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomBuilder.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/geomBuilder.py
63   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/gsketcher.py   ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/gsketcher.py
64   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomtools.py   ${CMAKE_SOURCE_DIR}/src/GEOM_PY/geomtools.py
65   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/sketcher.py    ${CMAKE_SOURCE_DIR}/src/GEOM_PY/sketcher.py
66   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/structelem.py  ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/__init__.py
67   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/parts.py       ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/parts.py
68   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/orientation.py ${CMAKE_SOURCE_DIR}/src/GEOM_PY/structelem/orientation.py
69   COMMAND ${plugins_cmd}
70   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_tui 
71   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
72   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
73   COMMAND  ${CMAKE_COMMAND} -E remove_directory tmp
74   COMMAND  ${CMAKE_COMMAND} -E remove_directory tmp1
75   VERBATIM 
76   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
77 )
78
79 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
80 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GEOM DESTINATION ${SALOME_INSTALL_DOC}/gui)
81 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
82 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM/geompy_doc)
83 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
84 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/static/ExtractAndRebuild.pdf DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)
85 INSTALL(FILES input/geompy_migration.doc input/tui_auto_completion_documentation.doc input/tui_execution_distribution.doc DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM/input)
86
87 FILE(GLOB tag_files ${CMAKE_CURRENT_BINARY_DIR}/*.tag)
88 SET(make_clean_files GEOM ${tag_files})
89 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${make_clean_files}")