]> SALOME platform Git repositories - modules/med.git/blob - CMakeLists.txt
Salome HOME
Increment version to 7.2.0
[modules/med.git] / CMakeLists.txt
1 # Copyright (C) 2012-2013  CEA/DEN, EDF R&D
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 ENABLE_TESTING()
27 SET(VERSION "7.2.0")
28 SET(VERSION_DEV "0")
29 SET(WITH_MEDMEMGUI "0")
30
31 #Defining all options first
32 option(SALOME_USE_MPI "Use MPI containers" OFF)
33
34 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR})
35 IF(KERNEL_ROOT_DIR)
36   FILE(TO_CMAKE_PATH $ENV{KERNEL_ROOT_DIR} KERNEL_ROOT_DIR)
37   SET(MED_ENABLE_KERNEL ON)
38   
39   # directories for packages detection
40   SET(SALOME_MACROS_DIR ${KERNEL_ROOT_DIR}/salome_adm/cmake_files)
41   SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SALOME_MACROS_DIR})
42
43   find_package(PLATFORM)
44   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindPYTHON.cmake)
45   if(SALOME_USE_MPI)
46     INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindMPI.cmake)
47   endif(SALOME_USE_MPI)
48   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindOMNIORB.cmake)
49   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindPTHREADS.cmake)
50   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindHDF5.cmake)
51   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindBOOST.cmake)
52   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindLIBXML2.cmake)
53   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindSWIG.cmake)
54   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake)
55   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindDOXYGEN.cmake)
56   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSPHINX.cmake)
57   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSalomeLIBBATCH.cmake)
58   INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindKERNEL.cmake)
59
60   SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR})
61   FILE(TO_CMAKE_PATH $ENV{GUI_ROOT_DIR} GUI_ROOT_DIR)
62   IF(GUI_ROOT_DIR)
63   SET(MED_ENABLE_GUI ON)
64   INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindCAS.cmake)
65   INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindQT4.cmake)
66   INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindOPENGL.cmake)
67   INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindSalomeVTK.cmake)
68   INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindQWT.cmake)
69   INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindSIPPYQT.cmake)
70   INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/deprecated/FindGUI.cmake)
71   ENDIF(GUI_ROOT_DIR)
72 ELSE(KERNEL_ROOT_DIR)
73   SET(SALOME_MACROS_DIR ${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files)
74   
75   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPLATFORM.cmake)
76   if(SALOME_USE_MPI)
77     INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindMPI.cmake)
78   endif(SALOME_USE_MPI)
79   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindBOOST.cmake)
80   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindCPPUNIT.cmake)
81   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindHDF5.cmake)
82   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPYTHON.cmake)
83   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindLIBXML2.cmake)
84   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPTHREADS.cmake)
85   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindSWIG.cmake)
86
87 ENDIF(KERNEL_ROOT_DIR)
88
89 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindPARMETIS.cmake)
90 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindMETIS.cmake)
91 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSCOTCH.cmake)
92 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindSPLITTER.cmake)
93 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindRENUMBER.cmake)
94 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindMEDFILE.cmake)
95 IF(WIN32)
96   INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindXDR.cmake)
97 ENDIF(WIN32)
98
99 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}
100   OUTPUT_VARIABLE XVERSION)
101
102 SET(MED_salomebin_BINS bin/salome)
103
104 SET(MED_salomelib_LIBS lib/salome)
105
106 SET(MED_salomeidl_IDLS idl/salome)
107 SET(KERNEL_salomeidl_IDLS ${MED_salomeidl_IDLS})
108
109 SET(MED_salomeinclude_HEADERS include/salome)
110
111 SET(MED_salomeres_DATA share/salome/resources/med)
112
113 SET(MED_salomeres_SCRIPTS share/salome/resources/med)
114
115 SET(MED_salomescript_SCRIPTS bin/salome)
116
117 SET(MED_salomescript_DATA bin/salome)
118
119 SET(MED_salomescript_PYTHON bin/salome)
120 SET(KERNEL_salomescript_PYTHON ${MED_salomescript_PYTHON})
121
122 SET(MED_appliskel_SCRIPTS bin/salome/appliskel)
123
124 SET(MED_appliskel_PYTHON bin/salome/appliskel)
125
126 SET(MED_pythondir lib/python${PYTHON_VERSION}/site-packages)
127
128 SET(MED_salomepythondir ${MED_pythondir}/salome)
129 SET(KERNEL_salomepythondir ${MED_salomepythondir})
130
131 SET(MED_sharedpkgpython_PYTHON ${MED_salomepythondir}/shared_modules)
132
133 SET(MED_admlocalcmake adm_local/cmake_files)
134
135 IF(MED_ENABLE_KERNEL)
136   ADD_SUBDIRECTORY(idl)
137 ELSE(MED_ENABLE_KERNEL)
138   ADD_SUBDIRECTORY(adm_local_without_kernel)
139 ENDIF(MED_ENABLE_KERNEL)
140 ADD_SUBDIRECTORY(adm_local)
141 ADD_SUBDIRECTORY(src)
142 ADD_SUBDIRECTORY(doc)
143 ADD_SUBDIRECTORY(resources)
144 ADD_SUBDIRECTORY(bin)
145
146 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/MED_version.h.in)
147 SET(output ${CMAKE_CURRENT_BINARY_DIR}/MED_version.h)
148 MESSAGE(STATUS "Creation of ${output}")
149 CONFIGURE_FILE(${input} ${output} @ONLY)
150 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/MED_version.h DESTINATION ${MED_salomeinclude_HEADERS})