]> SALOME platform Git repositories - modules/paravis.git/blob - CMakeLists.txt
Salome HOME
do not configure SalomeApp.xml so that we can relocate the generated module.
[modules/paravis.git] / CMakeLists.txt
1
2             CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
3             IF(COMMAND cmake_policy)
4             cmake_policy(SET CMP0003 NEW)
5             ENDIF(COMMAND cmake_policy)
6             
7
8                 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR})
9                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake)
10                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake)
11                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake)
12                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake)
13                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake)
14                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake)
15                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake)
16                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake)
17                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
18                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake)
19                 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake)
20                 
21
22                     INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindPARAVIEW.cmake)
23                     IF(EXISTS ${PARAVIEW_VTK_DIR}/VTKConfig.cmake)
24                     SET(VTK_DIR ${PARAVIEW_VTK_DIR})
25                     ENDIF(EXISTS ${PARAVIEW_VTK_DIR}/VTKConfig.cmake)
26                     SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR})
27                     INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindCAS.cmake)
28                     INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQT4.cmake)
29                     INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindOPENGL.cmake)
30                     INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindVTK.cmake)
31                     INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQWT.cmake)
32                     INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindSIPPYQT.cmake)
33                     INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindGUI.cmake)
34                     
35
36                         SET(BUILD_PLUGINS 1)
37                         SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR})
38                         SET(VISU_ROOT_DIR $ENV{VISU_ROOT_DIR})
39                         INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake)
40                         IF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake)
41                         INCLUDE(${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake)
42                         SET(WITH_VISU 1)
43                         ENDIF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake)
44                         EXECUTE_PROCESS(COMMAND pvpython ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIRS})
45                         
46
47             SET(DOXYGEN_IS_OK 0)
48             
49
50                 IF(WINDOWS)
51                 SET(CPPUNIT_IS_OK 0)
52                 ENDIF(WINDOWS)
53                 
54
55         SET(VERSION_INFO 0.0.0)
56         SET(SOVERSION_INFO 0)
57         SET(SUBDIRS)
58         SET(AM_CPPFLAGS)
59         SET(AM_CXXFLAGS)
60         SET(LDADD)
61         
62
63                 SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h)
64                 SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h)
65                 
66 #  Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
67 #
68 #  This library is free software; you can redistribute it and/or
69 #  modify it under the terms of the GNU Lesser General Public
70 #  License as published by the Free Software Foundation; either
71 #  version 2.1 of the License.
72 #
73 #  This library is distributed in the hope that it will be useful,
74 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
75 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
76 #  Lesser General Public License for more details.
77 #
78 #  You should have received a copy of the GNU Lesser General Public
79 #  License along with this library; if not, write to the Free Software
80 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
81 #
82 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
83 #
84 # -* Makefile *-
85 #
86 # Author :
87 # Modified by : Alexander BORODIN (OCN) - autotools usage
88 #
89
90 # include $(top_srcdir)/adm_local/unix/make_common_starter.am
91
92 SET(ACLOCAL_AMFLAGS
93     -I
94     adm_local/unix/config_files
95     -I
96     ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files
97     -I
98     ${GUI_ROOT_DIR}/adm_local/unix/config_files
99 )
100
101 SET(SUBDIRS
102     idl
103     adm_local
104     resources
105     src
106     doc
107     bin
108 )
109
110 SET(DISTCLEANFILES
111     a.out
112     aclocal.m4
113     configure
114     wrapfiles.txt
115 )
116
117 SET(salomeinclude_DATA
118     PARAVIS_version.h
119 )
120
121 SET(EXTRA_DIST
122     ${EXTRA_DIST}
123     build_configure
124     clean_configure
125 )
126
127 # include  $(top_srcdir)/wrapfiles.am
128 INCLUDE(wrapfiles.cmake)
129
130 # dist-hook:
131 #       rm -rf `find $(distdir) -name CVS`
132
133 # dev_docs:
134 #       (cd doc && $(MAKE) $(AM_MAKEFLAGS) dev_docs)
135
136 # docs: dev_docs
137
138
139                 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVIS_version.h.in)
140                 
141
142                 SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVIS_version.h)
143                 
144
145                 MESSAGE(STATUS "Creation of ${output}")
146                 CONFIGURE_FILE(${input} ${output})
147                 
148
149             FOREACH(dir ${SUBDIRS})
150             IF(NOT dir STREQUAL .)
151             ADD_SUBDIRECTORY(${dir})
152             ENDIF(NOT dir STREQUAL .)
153             ENDFOREACH(dir ${SUBDIRS})
154             
155 FOREACH(f ${salomeinclude_DATA})
156
157         SET(DEST include/salome)
158         
159
160         STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in)
161         IF(test_SALOMEconfig.h.in)
162         INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in)
163         ELSE(test_SALOMEconfig.h.in)
164         SET(dummy dummy-NOTFOUND)
165         MARK_AS_ADVANCED(dummy)
166         # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f})
167         FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
168         IF(dummy)
169         
170
171             GET_FILENAME_COMPONENT(ext ${f} EXT)
172             IF(ext STREQUAL .py)
173             IF(DEST STREQUAL bin/salome)
174             SET(PERMS)
175             SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE)
176             SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE)
177             SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE)
178             INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS})
179             ELSE(DEST STREQUAL bin/salome)
180             INSTALL(FILES ${f} DESTINATION ${DEST})
181             ENDIF(DEST STREQUAL bin/salome)
182             ELSE(ext STREQUAL .py)
183             INSTALL(FILES ${f} DESTINATION ${DEST})
184             ENDIF(ext STREQUAL .py)
185             
186
187         ELSE(dummy)
188         GET_FILENAME_COMPONENT(ext ${f} EXT)
189         IF(ext STREQUAL .qm)
190         STRING(REGEX REPLACE .qm .ts input ${f})
191         
192
193             SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input})
194             
195
196         SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f})
197         # ADD_CUSTOM_COMMAND(
198         # OUTPUT ${output}
199         # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}
200         # MAIN_DEPENDENCY ${input}
201         # )
202         EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output})
203         ENDIF(ext STREQUAL .qm)
204         INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST})
205         ENDIF(dummy)
206         ENDIF(test_SALOMEconfig.h.in)
207         
208
209         GET_FILENAME_COMPONENT(ext ${f} EXT)
210         IF(ext STREQUAL .py)
211         INSTALL(CODE "SET(PYTHON_FILE ${f})")
212         INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})")
213         INSTALL(CODE "SET(DEST ${DEST})")
214         INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})")
215         
216
217             STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
218             INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake)
219             
220
221         ENDIF(ext STREQUAL .py)
222         
223 ENDFOREACH(f ${salomeinclude_DATA})