Salome HOME
a03543dd252ab1a56ca819917bf1d040edad3676
[modules/gui.git] / CMakeLists.txt
1 # Copyright (C) 2012  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
20 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
21
22 IF(COMMAND cmake_policy)
23   cmake_policy(SET CMP0003 NEW)
24 ENDIF(COMMAND cmake_policy)
25
26 # Temporary definitions
27 SET(DOXYGEN_IS_OK 0)
28 IF(WINDOWS)
29  SET(CPPUNIT_IS_OK 0)
30 ENDIF(WINDOWS)
31 SET(GUI_ENABLE_CORBA ON)
32 SET(ENABLE_VTKVIEWER ON)
33 SET(ENABLE_SALOMEOBJECT ON)
34 SET(ENABLE_OCCVIEWER ON)
35 SET(ENABLE_GLVIEWER ON)
36 SET(ENABLE_PLOT2DVIEWER ON)
37 SET(ENABLE_PYCONSOLE ON)
38 SET(ENABLE_SUPERVGRAPHVIEWER ON)
39 SET(ENABLE_QXGRAPHVIEWER ON)
40
41 ENABLE_TESTING()
42 SET(VERSION "7.0.0")
43 SET(VERSION_DEV "1")
44
45 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR})
46 IF(KERNEL_ROOT_DIR)
47   STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
48   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake)
49   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake)
50   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake)
51   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake)
52   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindMPI.cmake)
53   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake)
54   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake)
55   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake)
56   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake)
57   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
58   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake)
59   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBBATCH.cmake)
60   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake)
61 ENDIF(KERNEL_ROOT_DIR)
62
63 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindCAS.cmake)
64 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindQT4.cmake)
65 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindOPENGL.cmake)
66 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindVTK.cmake)
67 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindQWT.cmake)
68 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSIPPYQT.cmake)
69
70 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}
71   OUTPUT_VARIABLE XVERSION)
72
73 SET(GUI_salomebin_BINS bin/salome)
74
75 SET(GUI_salomelib_LIBS lib/salome)
76 SET(GUI_paraviewlib_LIBS lib/paraview)
77
78 SET(GUI_salomeinclude_HEADERS include/salome)
79
80 SET(GUI_salomeres_DATA share/salome/resources/gui)
81
82 SET(GUI_salomeres_SCRIPTS share/salome/resources/gui)
83
84 SET(GUI_salomepluginsdir share/salome/plugins/gui)
85
86 SET(GUI_salomescript_SCRIPTS bin/salome)
87
88 SET(GUI_salomescript_DATA bin/salome)
89
90 SET(GUI_salomescript_PYTHON bin/salome)
91 SET(KERNEL_salomescript_PYTHON ${GUI_salomescript_PYTHON})
92
93 SET(GUI_appliskel_SCRIPTS bin/salome/appliskel)
94
95 SET(GUI_appliskel_PYTHON bin/salome/appliskel)
96
97 SET(GUI_pythondir lib/python${PYTHON_VERSION}/site-packages)
98
99 SET(GUI_salomepythondir ${GUI_pythondir}/salome)
100 SET(KERNEL_salomepythondir ${GUI_salomepythondir})
101
102 SET(GUI_sharedpkgpython_PYTHON ${GUI_salomepythondir}/shared_modules)
103
104 SET(GUI_admlocalcmake adm_local/cmake_files)
105
106 SET(IDLDIR)                        
107 IF(GUI_ENABLE_CORBA)
108   SET(IDLDIR idl)
109 ENDIF(GUI_ENABLE_CORBA)
110
111 SET(SUBDIRS
112   ${IDLDIR}
113   adm_local
114   resources
115   src
116   doc
117   bin
118   tools
119 )
120 FOREACH(dir ${SUBDIRS})
121   ADD_SUBDIRECTORY(${dir})
122 ENDFOREACH(dir ${SUBDIRS})
123
124 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/GUI_version.h.in)
125 SET(output ${CMAKE_CURRENT_BINARY_DIR}/GUI_version.h)
126 MESSAGE(STATUS "Creation of ${output}")
127 CONFIGURE_FILE(${input} ${output} @ONLY)
128 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/GUI_version.h DESTINATION ${GUI_salomeinclude_HEADERS})