1 # Copyright (C) 2007-2012 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
22 IF(COMMAND cmake_policy)
23 cmake_policy(SET CMP0003 NEW)
24 ENDIF(COMMAND cmake_policy)
29 SET(WITH_MEDMEMGUI "0")
31 #Defining all options first
32 option(SALOME_USE_MPI "Use MPI containers" OFF)
34 SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR})
36 FILE(TO_CMAKE_PATH $ENV{KERNEL_ROOT_DIR} KERNEL_ROOT_DIR)
37 SET(MED_ENABLE_KERNEL ON)
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})
43 find_package(PLATFORM)
44 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindPYTHON.cmake)
46 INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/FindMPI.cmake)
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)
60 SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR})
61 FILE(TO_CMAKE_PATH $ENV{GUI_ROOT_DIR} 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)
73 SET(SALOME_MACROS_DIR ${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files)
75 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindPLATFORM.cmake)
77 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local_without_kernel/cmake_files/FindMPI.cmake)
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)
87 ENDIF(KERNEL_ROOT_DIR)
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)
96 INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindXDR.cmake)
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)
102 SET(MED_salomebin_BINS bin/salome)
104 SET(MED_salomelib_LIBS lib/salome)
106 SET(MED_salomeidl_IDLS idl/salome)
107 SET(KERNEL_salomeidl_IDLS ${MED_salomeidl_IDLS})
109 SET(MED_salomeinclude_HEADERS include/salome)
111 SET(MED_salomeres_DATA share/salome/resources/med)
113 SET(MED_salomeres_SCRIPTS share/salome/resources/med)
115 SET(MED_salomescript_SCRIPTS bin/salome)
117 SET(MED_salomescript_DATA bin/salome)
119 SET(MED_salomescript_PYTHON bin/salome)
120 SET(KERNEL_salomescript_PYTHON ${MED_salomescript_PYTHON})
122 SET(MED_appliskel_SCRIPTS bin/salome/appliskel)
124 SET(MED_appliskel_PYTHON bin/salome/appliskel)
126 SET(MED_pythondir lib/python${PYTHON_VERSION}/site-packages)
128 SET(MED_salomepythondir ${MED_pythondir}/salome)
129 SET(KERNEL_salomepythondir ${MED_salomepythondir})
131 SET(MED_sharedpkgpython_PYTHON ${MED_salomepythondir}/shared_modules)
133 SET(MED_admlocalcmake adm_local/cmake_files)
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)
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})