]> SALOME platform Git repositories - plugins/blsurfplugin.git/blob - doc/salome/gui/BLSURFPLUGIN/CMakeLists.txt
Salome HOME
Cmake: add a deletion of documentation directory to command make clean
[plugins/blsurfplugin.git] / doc / salome / gui / BLSURFPLUGIN / CMakeLists.txt
1 # Copyright (C) 2012-2013  CEA/DEN, EDF R&D
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 SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
23 SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
24 SALOME_CONFIGURE_FILE(static/header.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header.html)
25 SALOME_CONFIGURE_FILE(static/header_py.html.in ${CMAKE_CURRENT_BINARY_DIR}/static/header_py.html)
26
27 SET(DOC_SMESH_MeshersList BLSURFPlugin)
28 SET(f1 "$(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py")
29 SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
30 IF(WIN32)
31   STRING(REPLACE "/" "\\" f ${f})
32   STRING(REPLACE "/" "\\" f1 ${f1})
33   STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PYTHONPATH%
34   @SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python\;%PYTHONPATH%
35   @SET PATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PATH%
36   @SET PATH=$ENV{KERNEL_ROOT_DIR}/lib/salome\;%PATH%
37   @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/bin/salome\;%PYTHONPATH%
38   @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
39   @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
40   @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/bin/salome\;%PYTHONPATH%
41   @SET PYTHONPATH=$ENV{SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
42   @SET PYTHONPATH=$ENV{SMESH_ROOT_DIR}/bin/salome\;%PYTHONPATH%
43   @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
44   @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome\;%PYTHONPATH%
45   @SET SMESH_MeshersList=${DOC_SMESH_MeshersList}
46   ")
47   SET(EXT "bat")
48   SET(CALL_STR "call")
49 ELSE(WIN32)
50   SET(DOC_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/bin/salome:${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome:${SMESH_ROOT_DIR}/bin/salome:${SMESH_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_USER}/lib/python${PYTHON_VERSION}/site-packages:${OMNIORB_ROOT_USER}/lib64/python${PYTHON_VERSION}/site-packages)
51   SET(DOC_LD_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/lib/salome:${SMESH_ROOT_DIR}/lib/salome:${GEOM_ROOT_DIR}/lib/salome:${KERNEL_ROOT_DIR}/lib/salome")
52   SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:\${PYTHONPATH}
53   export LD_LIBRARY_PATH=${DOC_LD_LIBRARY_PATH}:\${LD_LIBRARY_PATH}
54   export SMESH_MeshersList=${DOC_SMESH_MeshersList}
55   ")
56   SET(EXT "sh")
57   SET(CALL_STR ".")
58 ENDIF(WIN32)
59
60 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} "${SCR}")
61
62 ADD_CUSTOM_TARGET(usr_docs ${CMAKE_COMMAND} -E make_directory tmp
63   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/BLSURFPluginBuilder.py ${CMAKE_SOURCE_DIR}/src/BLSURFPlugin/BLSURFPluginBuilder.py
64   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/smesh_algorithm.py ${SMESH_ROOT_DIR}/${SALOME_INSTALL_PYTHON}/salome/smesh/smesh_algorithm.py
65   COMMAND ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} && ${PYTHON_EXECUTABLE} ${f1} -d -o tmp/smeshBuilder.py BLSURFPlugin
66   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
67   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
68   COMMAND ${CMAKE_COMMAND} -E remove_directory tmp   
69   VERBATIM
70   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}            
71 )
72
73 INSTALL(CODE "EXECUTE_PROCESS(COMMAND \"${CMAKE_COMMAND}\" --build ${PROJECT_BINARY_DIR} --target usr_docs)")
74 INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/BLSURFPLUGIN DESTINATION ${SALOME_INSTALL_DOC}/gui/)
75 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/BLSURFPLUGIN)
76 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/gui/BLSURFPLUGIN/blsurfpluginpy_doc)  
77
78 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES BLSURFPLUGIN)