Salome HOME
CMake porting
[modules/geom.git] / doc / salome / gui / GEOM / CMakeLists.txt
1 # Copyright (C) 2012-2013  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.
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 SET(top_builddir ${CMAKE_BINARY_DIR})
23 SET(top_srcdir ${CMAKE_SOURCE_DIR})
24 SET(srcdir ${CMAKE_CURRENT_SOURCE_DIR})
25 SET(builddir ${CMAKE_CURRENT_BINARY_DIR})
26 SET(datadir ${CMAKE_INSTALL_PREFIX}/share)
27 SET(docdir ${datadir}/doc/salome)
28 SET(guidocdir ${docdir}/gui/GEOM)
29
30 SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
31 SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
32 SALOME_CONFIGURE_FILE(doxyfile_tui.in doxyfile_tui)
33 SALOME_CONFIGURE_FILE(static/header.html.in ${builddir}/static/header.html)
34 SALOME_CONFIGURE_FILE(static/header_py.html.in ${builddir}/static/header_py.html)
35
36 SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
37 IF(WINDOWS)
38   STRING(REPLACE "/" "\\" f ${f})
39 ENDIF(WINDOWS)
40
41 ADD_CUSTOM_TARGET(usr_docs mkdir -p tmp 
42   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/geomBuilder.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/geomBuilder.py
43   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/gsketcher.py ${CMAKE_SOURCE_DIR}/src/GEOM_SWIG/gsketcher.py
44   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_tui 
45   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
46   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
47   COMMAND ${PYTHON_EXECUTABLE} -c "import shutil; shutil.rmtree(r'''tmp''')"
48   COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''', 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/GEOM'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM/geompy_doc'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/static/SALOME_BOA_PA.pdf''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/GEOM''')"
49   VERBATIM 
50   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}             
51 )
52
53 ADD_DEPENDENCIES(usr_docs html_docs)
54
55 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
56 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${SALOME_INSTALL_DOC}/gui)
57 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/GEOM)