]> SALOME platform Git repositories - modules/paravis.git/blob - src/Macro/CMakeLists.txt
Salome HOME
Fix of 0022530: [CEA 1108] The new macros are deleted at Paravis launch
[modules/paravis.git] / src / Macro / CMakeLists.txt
1 # Copyright (C) 2010-2014  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, 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 SET(_PYFILES_TO_INSTALL
21   modes.py
22   )
23
24 # Add warning message into scripts to be installed
25 INSTALL(CODE "
26   SET(warning_str \"\# DO NOT MAKE CHANGES to this file, it will be rewrote 
27 \# on activation of SALOME PARAVIS module.
28 \# Modify the source file instead.\")
29
30   FOREACH(file ${_PYFILES_TO_INSTALL})
31     SET(tmp_file tmp/\${file})
32     FILE(READ ${CMAKE_CURRENT_SOURCE_DIR}/\${file} tmp_string)
33     STRING(REPLACE \"\# Do not touch this anchor comment\" \"\${warning_str}\" new_tmp_string \${tmp_string})
34     FILE(WRITE \${tmp_file} \${new_tmp_string})
35   ENDFOREACH()
36 ")
37
38 # Install of the modified scripts
39 FOREACH(file ${_PYFILES_TO_INSTALL})
40   INSTALL_AND_COMPILE_PYTHON_FILE(${CMAKE_CURRENT_BINARY_DIR}/tmp/\${file} ${SALOME_INSTALL_SCRIPT_PYTHON}/Macro)
41 ENDFOREACH()
42
43 SET(MAKE_CLEAN_FILES tmp)
44 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${MAKE_CLEAN_FILES}")