Salome HOME
optim eciture
[tools/eficas.git] / CMakeLists.txt
index 0f2d52b875f53264e8ba56811e07ad5286e3fb30..be6811fd0f855d1bb045cc423d51f2c181aaf519 100644 (file)
@@ -44,59 +44,52 @@ print '%d.%d' % ( sys.version_info[0], sys.version_info[1] )
   file ( REMOVE ${tmpPyScript} )
 endif (PYTHONINTERP_FOUND)
 message ( STATUS "Using Python version ${PYTHON_VERSION}" )
-# Detection de QT4
-find_package ( Qt4 COMPONENTS QtCore QtGui REQUIRED )
-include( ${QT_USE_FILE} )
+# Detection de QT5
+find_package ( Qt5 COMPONENTS Core REQUIRED )
 
-# Detection de PyQt4
-if (NOT PYQT4_FOUND)
-  execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\"import PyQt4\""
+FIND_PACKAGE(Qt5LinguistTools)
+GET_TARGET_PROPERTY(QT_LRELEASE_EXECUTABLE Qt5::lrelease LOCATION)
+MARK_AS_ADVANCED(QT_LRELEASE_EXECUTABLE)
+
+# Detection de PyQt5
+if (NOT PYQT5_FOUND)
+  execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "\"import PyQt5\""
                     RESULT_VARIABLE _res
                    OUTPUT_VARIABLE _trashout
                    ERROR_VARIABLE  _trasherr
                   )
   if (NOT _res)
-    message ( STATUS "Looking for Python package PyQt4 - found" )
-    set ( PYQT4_FOUND 1 CACHE INTERNAL "True if Python package PyQt4 is here" )
+    message ( STATUS "Looking for Python package PyQt5 - found" )
+    set ( PYQT5_FOUND 1 CACHE INTERNAL "True if Python package PyQt5 is here" )
   else (NOT _res)
-    message ( STATUS "Looking for Python package PyQt4 - not found" )
-    set ( PYQT4_FOUND 0 CACHE INTERNAL "True if Python package PyQt4 is here" )
+    message ( STATUS "Looking for Python package PyQt5 - not found" )
+    set ( PYQT5_FOUND 0 CACHE INTERNAL "True if Python package PyQt5 is here" )
   endif (NOT _res)
-endif (NOT PYQT4_FOUND)
+endif (NOT PYQT5_FOUND)
 
-if (NOT PYQT4_FOUND)
-  message ( FATAL_ERROR "Python package PyQt4 is REQUIRED" )
-endif (NOT PYQT4_FOUND)
+if (NOT PYQT5_FOUND)
+  message ( FATAL_ERROR "Python package PyQt5 is REQUIRED" )
+endif (NOT PYQT5_FOUND)
 
-# Detection de pyuic4
-find_program ( PYUIC4 NAMES pyuic4
-               DOC  "Path to the pyuic4 compilation tool"
+# Detection de PYUIC5
+find_program ( PYUIC5 NAMES pyuic5
+               DOC  "Path to the pyuic5 compilation tool"
              )
-if (NOT PYUIC4)
-  message ( FATAL_ERROR "pyuic4 tool is REQUIRED" )
-endif (NOT PYUIC4)
+if (NOT PYUIC5)
+  message ( FATAL_ERROR "pyuic5 tool is REQUIRED" )
+endif (NOT PYUIC5)
 
 # Definition des options de CMake
 option ( WITH_ALL_PACKAGES "Install all package files" OFF )
-option ( WITH_SALOME_MECA  "Install OT, Aster and SEP files" OFF )
-option ( WITH_OPENTURNS    "Install Open TURNS files"  OFF )
-option ( WITH_ASTER        "Install Aster files"       OFF )
-option ( WITH_MAP          "Install MAP files"         OFF )
+option ( WITH_CARMEL       "Install CARMEL files"      OFF )
 option ( WITH_SEP          "Install SEP files"         OFF )
+option ( WITH_ZCRACKS      "Install ZCRACKS files"     OFF )
+option ( WITH_TELEMAC_CATA "Install TELEMAC files"     OFF )
+option ( IN_SALOME_CONTEXT "Configure Eficas for use in Salome" OFF )
 
 set ( _OPTIONLIST
-  WITH_OPENTURNS 
-  WITH_ASTER
-  WITH_MAP
-  WITH_SEP
-  WITH_TK
-  WITH_SALOME_MECA
-  )
-
-set ( _SALOME_MECA_LIST
-  WITH_OPENTURNS 
-  WITH_ASTER
-  WITH_SEP
+  WITH_CARMEL
+  WITH_TELEMAC_CATA
   )
 
 if (WITH_ALL_PACKAGES)
@@ -105,11 +98,6 @@ if (WITH_ALL_PACKAGES)
   endforeach ( _opt )
 endif (WITH_ALL_PACKAGES)
 
-if (WITH_SALOME_MECA)
-  foreach ( _opt ${_SALOME_MECA_LIST} )
-    set ( ${_opt} ON )
-  endforeach ( _opt )
-endif (WITH_SALOME_MECA)
 
 # Verification: au moins une option doit etre selectionnee
 set ( _VALIDOPT FALSE )
@@ -124,18 +112,6 @@ if ( NOT ${_VALIDOPT} )
   message ( FATAL_ERROR "At least one option within ${_OPTIONLIST} must be selected" )
 endif ( NOT ${_VALIDOPT} )
 
-# Detection des prerequis lies aux options
-if (WITH_OPENTURNS)
-  find_package ( OpenTURNS REQUIRED )
-endif (WITH_OPENTURNS)
-
-#if (WITH_ASTER)
-#  find_package ( Aster REQUIRED )
-#endif (WITH_ASTER)
-
-#if (WITH_MAP)
-#  find_package ( MAP REQUIRED )
-#endif (WITH_MAP)
 
 
 # Parcours recursif des sous-repertoires
@@ -144,42 +120,36 @@ add_subdirectory ( Aide )
 add_subdirectory ( Editeur )
 add_subdirectory ( Extensions )
 add_subdirectory ( Ihm )
-add_subdirectory ( InterfaceQT4 )
+install ( DIRECTORY InterfaceQT4 DESTINATION ${CMAKE_INSTALL_PREFIX} )
 add_subdirectory ( Noyau )
-add_subdirectory ( UiQT4 )
+add_subdirectory ( UiQT5 )
 add_subdirectory ( Validation )
 add_subdirectory ( convert )
 add_subdirectory ( generator )
+add_subdirectory ( Traducteur )
+
+
+# Installation des fichiers : CARMEL
+if (WITH_CARMEL)
+  add_subdirectory ( Carmel3D )
+  add_subdirectory ( CarmelCND )
+  add_subdirectory ( CarmelCS )
+endif (WITH_CARMEL)
+
+
+# Installation des fichiers : ZCracks
+if (WITH_ZCRACKS)
+  add_subdirectory ( ZCracks )
+endif (WITH_ZCRACKS)
+
+# Installation des fichiers : Telemac
+if (WITH_TELEMAC_CATA)
+  add_subdirectory ( Telemac )
+endif (WITH_TELEMAC_CATA)
 
-# Installation des fichiers : Open TURNS
-if (WITH_OPENTURNS)
-  add_subdirectory ( Openturns_Study )
-  add_subdirectory ( Openturns_Wrapper )
-endif (WITH_OPENTURNS)
-
-# Installation des fichiers : Aster
-if (WITH_ASTER)
-  add_subdirectory ( Aster )
-  add_subdirectory ( Traducteur )
-endif (WITH_ASTER)
-
-if (WITH_TK)
-  add_subdirectory ( InterfaceTK )
-  add_subdirectory ( Pmw )
-  add_subdirectory ( Tools )
-  add_subdirectory ( Misc )
-  add_subdirectory ( AIDE )
-endif (WITH_TK)
-
-# Installation des fichiers : MAP
-if (WITH_MAP)
-  add_subdirectory ( Map )
-endif (WITH_MAP)
-
-# Installation des fichiers : Sep
-if (WITH_SEP)
-  add_subdirectory ( Sep )
-endif (WITH_SEP)
+if (BUILD_DOC)
+  add_subdirectory ( Doc )
+endif (BUILD_DOC)
 
 ### Local Variables:
 ### mode: cmake