Salome HOME
Merge from BR_PARAVIS_LOT1_2 24/02/2010
[modules/paravis.git] / src / PV_SWIG / CMakeLists.txt
1
2         SET(VERSION_INFO 0.0.0)
3         SET(SOVERSION_INFO 0)
4         SET(SUBDIRS)
5         SET(AM_CPPFLAGS)
6         SET(AM_CXXFLAGS)
7         SET(LDADD)
8         
9
10                 SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h)
11                 SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h)
12                 
13 #  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
14 #
15 #  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
16 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
17 #
18 #  This library is free software; you can redistribute it and/or
19 #  modify it under the terms of the GNU Lesser General Public
20 #  License as published by the Free Software Foundation; either
21 #  version 2.1 of the License.
22 #
23 #  This library is distributed in the hope that it will be useful,
24 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
25 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26 #  Lesser General Public License for more details.
27 #
28 #  You should have received a copy of the GNU Lesser General Public
29 #  License along with this library; if not, write to the Free Software
30 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
31 #
32 #  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
33 #
34 #  VISU VISU_SWIG : binding of C++ implementation and Python
35 #  File   : Makefile.am
36 #  Author : Paul RASCLE, EDF
37 #  Module : VISU
38 #
39 # include $(top_srcdir)/adm_local/unix/make_common_starter.am
40
41 SET(dist_salomescript_DATA
42     paravis.py
43     paravisSM.py
44     pvsimple.py
45 )
46
47
48
49             FOREACH(dir ${SUBDIRS})
50             IF(NOT dir STREQUAL .)
51             ADD_SUBDIRECTORY(${dir})
52             ENDIF(NOT dir STREQUAL .)
53             ENDFOREACH(dir ${SUBDIRS})
54             
55 FOREACH(f ${dist_salomescript_DATA})
56
57         SET(DEST bin/salome)
58         
59
60         STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in)
61         IF(test_SALOMEconfig.h.in)
62         INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in)
63         ELSE(test_SALOMEconfig.h.in)
64         SET(dummy dummy-NOTFOUND)
65         MARK_AS_ADVANCED(dummy)
66         # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f})
67         FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
68         IF(dummy)
69         
70
71             GET_FILENAME_COMPONENT(ext ${f} EXT)
72             IF(ext STREQUAL .py)
73             IF(DEST STREQUAL bin/salome)
74             SET(PERMS)
75             SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE)
76             SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE)
77             SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE)
78             INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS})
79             ELSE(DEST STREQUAL bin/salome)
80             INSTALL(FILES ${f} DESTINATION ${DEST})
81             ENDIF(DEST STREQUAL bin/salome)
82             ELSE(ext STREQUAL .py)
83             INSTALL(FILES ${f} DESTINATION ${DEST})
84             ENDIF(ext STREQUAL .py)
85             
86
87         ELSE(dummy)
88         GET_FILENAME_COMPONENT(ext ${f} EXT)
89         IF(ext STREQUAL .qm)
90         STRING(REGEX REPLACE .qm .ts input ${f})
91         
92
93             SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input})
94             
95
96         SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f})
97         # ADD_CUSTOM_COMMAND(
98         # OUTPUT ${output}
99         # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}
100         # MAIN_DEPENDENCY ${input}
101         # )
102         EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output})
103         ENDIF(ext STREQUAL .qm)
104         INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST})
105         ENDIF(dummy)
106         ENDIF(test_SALOMEconfig.h.in)
107         
108
109         GET_FILENAME_COMPONENT(ext ${f} EXT)
110         IF(ext STREQUAL .py)
111         INSTALL(CODE "SET(PYTHON_FILE ${f})")
112         INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})")
113         INSTALL(CODE "SET(DEST ${DEST})")
114         INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})")
115         
116
117             STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
118             INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake)
119             
120
121         ENDIF(ext STREQUAL .py)
122         
123 ENDFOREACH(f ${dist_salomescript_DATA})