1 # -*- coding: utf-8 -*-
2 # CONFIGURATION MANAGEMENT OF EDF VERSION
3 # ======================================================================
4 # COPYRIGHT (C) 1991 - 2002 EDF R&D WWW.CODE-ASTER.ORG
5 # THIS PROGRAM IS FREE SOFTWARE; YOU CAN REDISTRIBUTE IT AND/OR MODIFY
6 # IT UNDER THE TERMS OF THE GNU GENERAL PUBLIC LICENSE AS PUBLISHED BY
7 # THE FREE SOFTWARE FOUNDATION; EITHER VERSION 2 OF THE LICENSE, OR
8 # (AT YOUR OPTION) ANY LATER VERSION.
10 # THIS PROGRAM IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT
11 # WITHOUT ANY WARRANTY; WITHOUT EVEN THE IMPLIED WARRANTY OF
12 # MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE GNU
13 # GENERAL PUBLIC LICENSE FOR MORE DETAILS.
15 # YOU SHOULD HAVE RECEIVED A COPY OF THE GNU GENERAL PUBLIC LICENSE
16 # ALONG WITH THIS PROGRAM; IF NOT, WRITE TO EDF R&D CODE_ASTER,
17 # 1 AVENUE DU GENERAL DE GAULLE, 92141 CLAMART CEDEX, FRANCE.
20 # ======================================================================
22 cmake_minimum_required ( VERSION 2.8 )
24 project ( Eficas CXX C )
26 # Definition du chemin d'acces aux modules additionnels
27 set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules" )
30 find_package ( PythonInterp 2.4 REQUIRED )
31 if (PYTHONINTERP_FOUND)
32 string ( RANDOM tmpPyScript )
33 set ( tmpPyScript "${tmpPyScript}.py" )
34 file ( WRITE ${tmpPyScript}
35 "# Automaticaly generated by CMake. Do NOT edit. Changes will be lost
37 print '%d.%d' % ( sys.version_info[0], sys.version_info[1] )
39 get_source_file_property ( PYSCRIPT_LOC ${tmpPyScript} LOCATION )
40 execute_process ( COMMAND ${PYTHON_EXECUTABLE} ${PYSCRIPT_LOC}
41 OUTPUT_VARIABLE PYTHON_VERSION
43 OUTPUT_STRIP_TRAILING_WHITESPACE )
44 file ( REMOVE ${tmpPyScript} )
45 endif (PYTHONINTERP_FOUND)
46 message ( STATUS "Using Python version ${PYTHON_VERSION}" )
48 find_package ( Qt4 COMPONENTS QtCore QtGui REQUIRED )
49 include( ${QT_USE_FILE} )
53 execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\"import PyQt4\""
55 OUTPUT_VARIABLE _trashout
56 ERROR_VARIABLE _trasherr
59 message ( STATUS "Looking for Python package PyQt4 - found" )
60 set ( PYQT4_FOUND 1 CACHE INTERNAL "True if Python package PyQt4 is here" )
62 message ( STATUS "Looking for Python package PyQt4 - not found" )
63 set ( PYQT4_FOUND 0 CACHE INTERNAL "True if Python package PyQt4 is here" )
65 endif (NOT PYQT4_FOUND)
68 message ( FATAL_ERROR "Python package PyQt4 is REQUIRED" )
69 endif (NOT PYQT4_FOUND)
72 find_program ( PYUIC4 NAMES pyuic4
73 DOC "Path to the pyuic4 compilation tool"
76 message ( FATAL_ERROR "pyuic4 tool is REQUIRED" )
79 # Definition des options de CMake
80 option ( WITH_ALL_PACKAGES "Install all package files" OFF )
81 option ( WITH_SALOME_MECA "Install OT, Aster and SEP files" OFF )
82 option ( WITH_OPENTURNS "Install Open TURNS files" OFF )
83 option ( WITH_ASTER "Install Aster files" OFF )
84 option ( WITH_MAP "Install MAP files" OFF )
85 option ( WITH_CARMEL "Install CARMEL files" OFF )
86 option ( WITH_SEP "Install SEP files" OFF )
87 option ( WITH_ZCRACKS "Install ZCRACKS files" OFF )
88 option ( IN_SALOME_CONTEXT "Configure Eficas for use in Salome" OFF )
98 set ( _SALOME_MECA_LIST
106 if (WITH_ALL_PACKAGES)
107 foreach ( _opt ${_OPTIONLIST} )
110 endif (WITH_ALL_PACKAGES)
112 if (WITH_SALOME_MECA)
113 foreach ( _opt ${_SALOME_MECA_LIST} )
116 endif (WITH_SALOME_MECA)
118 # Verification: au moins une option doit etre selectionnee
119 set ( _VALIDOPT FALSE )
120 foreach ( _opt ${_OPTIONLIST} )
122 set ( _VALIDOPT TRUE )
123 string ( REPLACE WITH_ "" _opt2 ${_opt} )
124 message ( STATUS "Will install package ${_opt2}" )
127 if ( NOT ${_VALIDOPT} )
128 message ( FATAL_ERROR "At least one option within ${_OPTIONLIST} must be selected" )
129 endif ( NOT ${_VALIDOPT} )
131 # Detection des prerequis lies aux options
133 if (IN_SALOME_CONTEXT)
134 SET(OpenTURNS_PYTHON_MODULE_DIR "")
135 else (IN_SALOME_CONTEXT)
136 find_package ( OpenTURNS REQUIRED )
137 endif (IN_SALOME_CONTEXT)
138 endif (WITH_OPENTURNS)
141 # find_package ( Aster REQUIRED )
145 # find_package ( MAP REQUIRED )
149 # Parcours recursif des sous-repertoires
150 add_subdirectory ( Accas )
151 add_subdirectory ( Aide )
152 add_subdirectory ( Editeur )
153 add_subdirectory ( Extensions )
154 add_subdirectory ( Ihm )
155 install ( DIRECTORY InterfaceQT4 DESTINATION ${CMAKE_INSTALL_PREFIX} )
156 add_subdirectory ( Noyau )
157 add_subdirectory ( UiQT4 )
158 add_subdirectory ( Validation )
159 add_subdirectory ( convert )
160 add_subdirectory ( generator )
161 add_subdirectory ( Traducteur )
163 # Installation des fichiers : Open TURNS
165 add_subdirectory ( Openturns_Study )
166 add_subdirectory ( Openturns_Wrapper )
167 endif (WITH_OPENTURNS)
169 # Installation des fichiers : Aster
171 add_subdirectory ( Aster )
175 add_subdirectory ( InterfaceTK )
176 add_subdirectory ( Pmw )
177 add_subdirectory ( Tools )
178 add_subdirectory ( Misc )
179 add_subdirectory ( AIDE )
182 # Installation des fichiers : MAP
184 add_subdirectory ( MAP )
187 # Installation des fichiers : CARMEL
189 add_subdirectory ( Carmel3D )
190 add_subdirectory ( CarmelCND )
191 add_subdirectory ( CarmelCS )
194 # Installation des fichiers : Sep
196 add_subdirectory ( Sep )
199 # Installation des fichiers : ZCracks
201 add_subdirectory ( ZCracks )
205 add_subdirectory ( Doc )