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