]> SALOME platform Git repositories - modules/paravis.git/blob - resources/CMakeLists.txt
Salome HOME
Merge from BR_PARAVIS_LOT1_2 24/02/2010
[modules/paravis.git] / resources / 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) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
14 #  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
15 #
16 #  This library is free software; you can redistribute it and/or
17 #  modify it under the terms of the GNU Lesser General Public
18 #  License as published by the Free Software Foundation; either
19 #  version 2.1 of the License.
20 #
21 #  This library is distributed in the hope that it will be useful,
22 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
23 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
24 #  Lesser General Public License for more details.
25 #
26 #  You should have received a copy of the GNU Lesser General Public
27 #  License along with this library; if not, write to the Free Software
28 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
29 #
30 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
31 #
32 # -* Makefile *- 
33 #
34 # Author : Patrick GOLDBRONN (CEA)
35 # Date : 28/06/2001
36 #  Modified by : Alexander BORODIN (OCN) - autotools usage
37
38 # include $(top_srcdir)/adm_local/unix/make_common_starter.am
39
40 SET(dist_salomeres_DATA
41     LightApp.xml
42     SalomeApp.xml
43     pqAppIcon22.png
44     pqAppIcon16.png
45     ParaViewFilters.xml
46     ParaViewReaders.xml
47     ParaViewSources.xml
48     ParaViewWriters.xml
49 )
50
51 SET(nodist_salomeres_SCRIPTS
52     PARAVISCatalog.xml
53 )
54
55
56                 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVISCatalog.xml.in)
57                 
58
59                 SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVISCatalog.xml)
60                 
61
62                 MESSAGE(STATUS "Creation of ${output}")
63                 CONFIGURE_FILE(${input} ${output})
64                 
65
66                 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in)
67                 
68
69                 SET(output ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml)
70                 
71
72                 MESSAGE(STATUS "Creation of ${output}")
73                 CONFIGURE_FILE(${input} ${output})
74                 
75
76             FOREACH(dir ${SUBDIRS})
77             IF(NOT dir STREQUAL .)
78             ADD_SUBDIRECTORY(${dir})
79             ENDIF(NOT dir STREQUAL .)
80             ENDFOREACH(dir ${SUBDIRS})
81             
82 FOREACH(f ${nodist_salomeres_SCRIPTS})
83
84         SET(DEST share/salome/resources/paravis)
85         
86
87         STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in)
88         IF(test_SALOMEconfig.h.in)
89         INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in)
90         ELSE(test_SALOMEconfig.h.in)
91         SET(dummy dummy-NOTFOUND)
92         MARK_AS_ADVANCED(dummy)
93         # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f})
94         FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
95         IF(dummy)
96         
97
98             GET_FILENAME_COMPONENT(ext ${f} EXT)
99             IF(ext STREQUAL .py)
100             IF(DEST STREQUAL bin/salome)
101             SET(PERMS)
102             SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE)
103             SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE)
104             SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE)
105             INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS})
106             ELSE(DEST STREQUAL bin/salome)
107             INSTALL(FILES ${f} DESTINATION ${DEST})
108             ENDIF(DEST STREQUAL bin/salome)
109             ELSE(ext STREQUAL .py)
110             INSTALL(FILES ${f} DESTINATION ${DEST})
111             ENDIF(ext STREQUAL .py)
112             
113
114         ELSE(dummy)
115         GET_FILENAME_COMPONENT(ext ${f} EXT)
116         IF(ext STREQUAL .qm)
117         STRING(REGEX REPLACE .qm .ts input ${f})
118         
119
120             SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input})
121             
122
123         SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f})
124         # ADD_CUSTOM_COMMAND(
125         # OUTPUT ${output}
126         # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}
127         # MAIN_DEPENDENCY ${input}
128         # )
129         EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output})
130         ENDIF(ext STREQUAL .qm)
131         INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST})
132         ENDIF(dummy)
133         ENDIF(test_SALOMEconfig.h.in)
134         
135
136         GET_FILENAME_COMPONENT(ext ${f} EXT)
137         IF(ext STREQUAL .py)
138         INSTALL(CODE "SET(PYTHON_FILE ${f})")
139         INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})")
140         INSTALL(CODE "SET(DEST ${DEST})")
141         INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})")
142         
143
144             STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
145             INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake)
146             
147
148         ENDIF(ext STREQUAL .py)
149         
150 ENDFOREACH(f ${nodist_salomeres_SCRIPTS})
151 FOREACH(f ${dist_salomeres_DATA})
152
153         SET(DEST share/salome/resources/paravis)
154         
155
156         STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in)
157         IF(test_SALOMEconfig.h.in)
158         INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in)
159         ELSE(test_SALOMEconfig.h.in)
160         SET(dummy dummy-NOTFOUND)
161         MARK_AS_ADVANCED(dummy)
162         # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f})
163         FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
164         IF(dummy)
165         
166
167             GET_FILENAME_COMPONENT(ext ${f} EXT)
168             IF(ext STREQUAL .py)
169             IF(DEST STREQUAL bin/salome)
170             SET(PERMS)
171             SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE)
172             SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE)
173             SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE)
174             INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS})
175             ELSE(DEST STREQUAL bin/salome)
176             INSTALL(FILES ${f} DESTINATION ${DEST})
177             ENDIF(DEST STREQUAL bin/salome)
178             ELSE(ext STREQUAL .py)
179             INSTALL(FILES ${f} DESTINATION ${DEST})
180             ENDIF(ext STREQUAL .py)
181             
182
183         ELSE(dummy)
184         GET_FILENAME_COMPONENT(ext ${f} EXT)
185         IF(ext STREQUAL .qm)
186         STRING(REGEX REPLACE .qm .ts input ${f})
187         
188
189             SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input})
190             
191
192         SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f})
193         # ADD_CUSTOM_COMMAND(
194         # OUTPUT ${output}
195         # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}
196         # MAIN_DEPENDENCY ${input}
197         # )
198         EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output})
199         ENDIF(ext STREQUAL .qm)
200         INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST})
201         ENDIF(dummy)
202         ENDIF(test_SALOMEconfig.h.in)
203         
204
205         GET_FILENAME_COMPONENT(ext ${f} EXT)
206         IF(ext STREQUAL .py)
207         INSTALL(CODE "SET(PYTHON_FILE ${f})")
208         INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})")
209         INSTALL(CODE "SET(DEST ${DEST})")
210         INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})")
211         
212
213             STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
214             INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake)
215             
216
217         ENDIF(ext STREQUAL .py)
218         
219 ENDFOREACH(f ${dist_salomeres_DATA})