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 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 ( Qt5 COMPONENTS Core REQUIRED )
50 FIND_PACKAGE(Qt5LinguistTools)
51 GET_TARGET_PROPERTY(QT_LRELEASE_EXECUTABLE Qt5::lrelease LOCATION)
52 MARK_AS_ADVANCED(QT_LRELEASE_EXECUTABLE)
56 execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\"import PyQt5\""
58 OUTPUT_VARIABLE _trashout
59 ERROR_VARIABLE _trasherr
62 message ( STATUS "Looking for Python package PyQt5 - found" )
63 set ( PYQT5_FOUND 1 CACHE INTERNAL "True if Python package PyQt5 is here" )
65 message ( STATUS "Looking for Python package PyQt5 - not found" )
66 set ( PYQT5_FOUND 0 CACHE INTERNAL "True if Python package PyQt5 is here" )
68 endif (NOT PYQT5_FOUND)
71 message ( FATAL_ERROR "Python package PyQt5 is REQUIRED" )
72 endif (NOT PYQT5_FOUND)
75 find_program ( PYUIC5 NAMES pyuic5
76 DOC "Path to the pyuic5 compilation tool"
79 message ( FATAL_ERROR "pyuic5 tool is REQUIRED" )
82 # Definition des options de CMake
83 option ( WITH_ALL_PACKAGES "Install all package files" OFF )
84 option ( WITH_CARMEL "Install CARMEL files" OFF )
85 option ( WITH_SEP "Install SEP files" OFF )
86 option ( WITH_ZCRACKS "Install ZCRACKS files" OFF )
87 option ( WITH_TELEMAC_CATA "Install TELEMAC files" OFF )
88 option ( IN_SALOME_CONTEXT "Configure Eficas for use in Salome" OFF )
95 if (WITH_ALL_PACKAGES)
96 foreach ( _opt ${_OPTIONLIST} )
99 endif (WITH_ALL_PACKAGES)
102 # Verification: au moins une option doit etre selectionnee
103 set ( _VALIDOPT FALSE )
104 foreach ( _opt ${_OPTIONLIST} )
106 set ( _VALIDOPT TRUE )
107 string ( REPLACE WITH_ "" _opt2 ${_opt} )
108 message ( STATUS "Will install package ${_opt2}" )
111 if ( NOT ${_VALIDOPT} )
112 message ( FATAL_ERROR "At least one option within ${_OPTIONLIST} must be selected" )
113 endif ( NOT ${_VALIDOPT} )
117 # Parcours recursif des sous-repertoires
118 add_subdirectory ( Accas )
119 add_subdirectory ( Aide )
120 add_subdirectory ( Editeur )
121 add_subdirectory ( Efi2Xsd )
122 add_subdirectory ( Extensions )
123 add_subdirectory ( Ihm )
124 install ( DIRECTORY InterfaceQT4 DESTINATION ${CMAKE_INSTALL_PREFIX} )
125 add_subdirectory ( Noyau )
126 add_subdirectory ( UiQT5 )
127 add_subdirectory ( Validation )
128 add_subdirectory ( convert )
129 add_subdirectory ( generator )
130 add_subdirectory ( Traducteur )
133 # Installation des fichiers : CARMEL
135 add_subdirectory ( Carmel3D )
136 add_subdirectory ( CarmelCND )
137 add_subdirectory ( CarmelCS )
141 # Installation des fichiers : ZCracks
143 add_subdirectory ( ZCracks )
146 # Installation des fichiers : Telemac
147 if (WITH_TELEMAC_CATA)
148 add_subdirectory ( Telemac )
149 endif (WITH_TELEMAC_CATA)
152 add_subdirectory ( Doc )