]> SALOME platform Git repositories - plugins/blsurfplugin.git/blob - doc/salome/gui/BLSURFPLUGIN/CMakeLists.txt
Salome HOME
CoTech decision: move MEDWrapper from MED to SMESH
[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 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/BLSURFPLUGIN)
29
30 SALOME_CONFIGURE_FILE(doxyfile.in doxyfile)
31 SALOME_CONFIGURE_FILE(doxyfile_py.in doxyfile_py)
32 SALOME_CONFIGURE_FILE(static/header.html.in ${builddir}/static/header.html)
33 SALOME_CONFIGURE_FILE(static/header_py.html.in ${builddir}/static/header_py.html)
34
35 SET(DOC_SMESH_MeshersList BLSURFPlugin)
36 SET(f1 "$(SMESH_ROOT_DIR)/bin/salome/collect_mesh_methods.py")
37 SET(f "$ENV{KERNEL_ROOT_DIR}/bin/salome/prepare_generating_doc.py")
38 IF(WINDOWS)
39   STRING(REPLACE "/" "\\" f ${f})
40   STRING(REPLACE "/" "\\" f1 ${f1})
41   STRING(REPLACE "/" "\\" SCR "@SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PYTHONPATH%
42   @SET PYTHONPATH=${OMNIORB_ROOT_USER}/lib/python\;%PYTHONPATH%
43   @SET PATH=${OMNIORB_ROOT_USER}/lib/x86_win32\;%PATH%
44   @SET PATH=$ENV{KERNEL_ROOT_DIR}/lib/salome\;%PATH%
45   @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/bin/salome\;%PYTHONPATH%
46   @SET PYTHONPATH=$ENV{KERNEL_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
47   @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
48   @SET PYTHONPATH=$ENV{GEOM_ROOT_DIR}/bin/salome\;%PYTHONPATH%
49   @SET PYTHONPATH=$ENV{SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
50   @SET PYTHONPATH=$ENV{SMESH_ROOT_DIR}/bin/salome\;%PYTHONPATH%
51   @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome\;%PYTHONPATH%
52   @SET PYTHONPATH=${CMAKE_INSTALL_PREFIX}/bin/salome\;%PYTHONPATH%
53   @SET SMESH_MeshersList=${DOC_SMESH_MeshersList}
54   ")
55   SET(EXT "bat")
56   SET(CALL_STR "call")
57 ELSE(WINDOWS)
58   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)
59   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")
60   SET(SCR "export PYTHONPATH=${DOC_PYTHONPATH}:\${PYTHONPATH}
61   export LD_LIBRARY_PATH=${DOC_LD_LIBRARY_PATH}:\${LD_LIBRARY_PATH}
62   export SMESH_MeshersList=${DOC_SMESH_MeshersList}
63   ")
64   SET(EXT "sh")
65   SET(CALL_STR ".")
66 ENDIF(WINDOWS)
67
68 FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} "${SCR}")
69
70 ADD_CUSTOM_TARGET(usr_docs mkdir -p tmp
71   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/BLSURFPluginBuilder.py ${CMAKE_SOURCE_DIR}/src/BLSURFPlugin/BLSURFPluginBuilder.py
72   COMMAND ${PYTHON_EXECUTABLE} ${f} -o tmp/smesh_algorithm.py ${SMESH_ROOT_DIR}/lib/python${PYTHON_VERSION}/site-packages/salome/salome/smesh/smesh_algorithm.py
73   COMMAND ${CALL_STR} ${CMAKE_CURRENT_BINARY_DIR}/tmp_env.${EXT} && ${PYTHON_EXECUTABLE} ${f1} -d -o tmp/smeshBuilder.py BLSURFPlugin
74   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile_py
75   COMMAND ${DOXYGEN_EXECUTABLE} doxyfile
76   COMMAND ${PYTHON_EXECUTABLE} -c "import os, shutil; shutil.rmtree(r'''tmp''')"
77   COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/BLSURFPLUGIN''',True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}''',r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/BLSURFPLUGIN''', ignore=shutil.ignore_patterns('tmp_env.*', '*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/BLSURFPLUGIN'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''',r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/gui/BLSURFPLUGIN/blsurfpluginpy_doc''')"
78   VERBATIM 
79   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}             
80 )