]> SALOME platform Git repositories - modules/gui.git/blob - CMakeLists.txt
Salome HOME
Remove extra reference to salome_pluginsmanager module (Fix Mantis bug #22221, CEA...
[modules/gui.git] / CMakeLists.txt
1 # Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
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 PROJECT(SALOME_GUI)
20
21 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
22
23 IF(COMMAND cmake_policy)
24   cmake_policy(SET CMP0003 NEW)
25 ENDIF(COMMAND cmake_policy)
26
27 IF(APPLE)
28   SET(CMAKE_C_COMPILER gcc)
29   SET(CMAKE_CXX_COMPILER g++)
30   # because default is clang(llvm) with mountain lion at least
31 ENDIF(APPLE)
32
33 # Temporary definitions
34 SET(DOXYGEN_IS_OK 0)
35 IF(WINDOWS)
36  SET(CPPUNIT_IS_OK 0)
37 ENDIF(WINDOWS)
38
39 #Defining all options first
40 option(SALOME_USE_MPI "Use MPI containers" OFF)
41 option(SALOME_USE_CORBA "Use distribute application with components" ON)
42 option(SALOME_USE_DOC "Generate documentation" ON)
43 option(SALOME_USE_TEST "Generate test" OFF)
44 OPTION(SALOME_USE_VTKVIEWER "Enable VTK visualization (Mandatory in classic configurations)" ON)
45 OPTION(SALOME_USE_SALOMEOBJECT "Enable Salome Object (Mandatory in classic configurations)" ON)
46 OPTION(SALOME_USE_OCCVIEWER "Enable OCC visualization (Mandatory in classic configurations)" ON)
47 OPTION(SALOME_USE_GLVIEWER "Enable OpenGL visualization (Mandatory in classic configurations)" ON)
48 OPTION(SALOME_USE_PLOT2DVIEWER "Enable Plot2D visualization (Mandatory in classic configurations)" ON)
49 OPTION(SALOME_USE_PYCONSOLE "Enable Python GUI interface (Mandatory in classic configurations)" ON)
50 OPTION(SALOME_USE_SUPERVGRAPHVIEWER "Enable Supervision visualization (Mandatory in classic configurations)" ON)
51 OPTION(SALOME_USE_QXGRAPHVIEWER "Enable QX graph visualization (Mandatory in classic configurations)" ON)
52
53 ENABLE_TESTING()
54 SET(VERSION "7.2.0")
55 SET(VERSION_DEV "0")
56
57 SET(BUILD_SHARED_LIBS true)
58
59 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL")
60 IF(EXISTS ${KERNEL_ROOT_DIR})
61   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake)
62 ELSE(EXISTS ${KERNEL_ROOT_DIR})
63   MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
64 ENDIF(EXISTS ${KERNEL_ROOT_DIR})
65
66 STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
67
68 # directories for packages detection
69 SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KERNEL_ROOT_DIR}/salome_adm/cmake_files ${CMAKE_SOURCE_DIR}/adm_local/cmake_files ${CMAKE_SOURCE_DIR}/adm_local/cmake_files/deprecated )
70 find_package(PLATFORM)
71
72
73 # Threads
74 SET(CMAKE_THREAD_PREFER_PTHREAD)
75 find_package(Threads REQUIRED)
76
77
78 # required prerequisites from KERNEL
79
80 find_package(SalomePYTHON)
81 find_package(SalomeSWIG)
82 find_package(SalomeLIBXML2)
83 find_package(SalomeHDF5)
84 find_package(SalomeBOOST)
85
86 # required prerequisites for GUI
87
88 find_package(SalomeQT4)
89 find_package(SalomeSIP)
90 find_package(SalomePYQT4)
91
92 # optional prerequisites from KERNEL
93
94 if(SALOME_USE_MPI OR HDF5_IS_PARALLEL)
95   find_package(SalomeMPI)
96 endif(SALOME_USE_MPI OR HDF5_IS_PARALLEL)
97
98 if(SALOME_USE_CORBA)
99   find_package(OMNIORB)
100 endif(SALOME_USE_CORBA)
101
102 if(SALOME_USE_TEST)
103   find_package(SalomeCPPUNIT)
104 endif(SALOME_USE_TEST)
105
106 if(SALOME_USE_DOC)
107   find_package(SalomeDOXYGEN)
108   find_package(SalomeSPHINX)
109 endif(SALOME_USE_DOC)
110
111 if(SALOME_USE_LIBBATCH)
112   find_package(LIBBATCH)
113 endif(SALOME_USE_LIBBATCH)
114
115
116 # optional prerequisites for GUI
117
118 if(SALOME_USE_OCCVIEWER)
119   find_package(SalomeCAS)
120 endif(SALOME_USE_OCCVIEWER)
121
122 if(SALOME_USE_GLVIEWER)
123   find_package(OpenGL REQUIRED)
124 endif(SALOME_USE_GLVIEWER)
125
126 if(SALOME_USE_VTKVIEWER)
127   find_package(SalomeVTK)
128 endif(SALOME_USE_VTKVIEWER)
129
130 if(SALOME_USE_PLOT2DVIEWER)
131   find_package(SalomeQWT)
132 endif(SALOME_USE_PLOT2DVIEWER)
133
134 EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; t=sys.argv[-1].split(\".\") ; t[:]=(int(elt) for elt in t) ; sys.stdout.write(\"0x%02x%02x%02x\"%tuple(t))" ${VERSION}
135   OUTPUT_VARIABLE XVERSION)
136
137 SET(GUI_salomebin_BINS bin/salome)
138
139 SET(GUI_salomelib_LIBS lib/salome)
140 SET(GUI_paraviewlib_LIBS lib/paraview)
141
142 SET(GUI_salomeinclude_HEADERS include/salome)
143
144 SET(GUI_salomeres_DATA share/salome/resources/gui)
145
146 SET(GUI_salomeres_SCRIPTS share/salome/resources/gui)
147
148 SET(GUI_salomepluginsdir share/salome/plugins/gui)
149
150 SET(GUI_salomescript_SCRIPTS bin/salome)
151
152 SET(GUI_salomescript_DATA bin/salome)
153
154 SET(GUI_salomescript_PYTHON bin/salome)
155 SET(KERNEL_salomescript_PYTHON ${GUI_salomescript_PYTHON})
156
157 SET(GUI_appliskel_SCRIPTS bin/salome/appliskel)
158
159 SET(GUI_appliskel_PYTHON bin/salome/appliskel)
160
161 SET(GUI_pythondir lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
162
163 SET(GUI_salomepythondir ${GUI_pythondir}/salome)
164 SET(KERNEL_salomepythondir ${GUI_salomepythondir})
165
166 SET(GUI_sharedpkgpython_PYTHON ${GUI_salomepythondir}/shared_modules)
167
168 SET(GUI_admlocalcmake adm_local/cmake_files)
169
170 SET(IDLDIR)                        
171 IF(SALOME_USE_CORBA)
172   SET(IDLDIR idl)
173 ENDIF(SALOME_USE_CORBA)
174
175 SET(SUBDIRS
176   ${IDLDIR}
177   adm_local
178   resources
179   src
180   doc
181   bin
182   tools
183 )
184 FOREACH(dir ${SUBDIRS})
185   ADD_SUBDIRECTORY(${dir})
186 ENDFOREACH(dir ${SUBDIRS})
187
188 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/GUI_version.h.in)
189 SET(output ${CMAKE_CURRENT_BINARY_DIR}/GUI_version.h)
190 MESSAGE(STATUS "Creation of ${output}")
191 CONFIGURE_FILE(${input} ${output} @ONLY)
192 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/GUI_version.h DESTINATION ${GUI_salomeinclude_HEADERS})