Salome HOME
.gitignore: test hook.
[tools/eficas.git] / CMakeLists.txt
index 702e1fbfd233669be30f510fefbd3bd845171c87..164af95d68d0c9e91b7548e56594bdc61f1d7678 100644 (file)
@@ -27,14 +27,14 @@ project ( Eficas CXX C )
 set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMakeModules" )
 
 # Detection de Python
-find_package ( PythonInterp 2.4 REQUIRED )
+find_package ( PythonInterp  REQUIRED )
 if (PYTHONINTERP_FOUND)
   string ( RANDOM tmpPyScript )
   set ( tmpPyScript "${tmpPyScript}.py" )
   file ( WRITE  ${tmpPyScript}
 "# Automaticaly generated by CMake. Do NOT edit. Changes will be lost
 import sys
-print '%d.%d' % ( sys.version_info[0], sys.version_info[1] )
+print ('%d.%d' % ( sys.version_info[0], sys.version_info[1] ))
 " )
   get_source_file_property ( PYSCRIPT_LOC ${tmpPyScript} LOCATION )
   execute_process ( COMMAND ${PYTHON_EXECUTABLE} ${PYSCRIPT_LOC}
@@ -81,13 +81,17 @@ endif (NOT PYUIC5)
 
 # Definition des options de CMake
 option ( WITH_ALL_PACKAGES "Install all package 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_CARMEL
+  WITH_TELEMAC_CATA
+  )
+
 if (WITH_ALL_PACKAGES)
   foreach ( _opt ${_OPTIONLIST} )
     set ( ${_opt} ON )
@@ -95,29 +99,36 @@ if (WITH_ALL_PACKAGES)
 endif (WITH_ALL_PACKAGES)
 
 
+# Verification: au moins une option doit etre selectionnee
+set ( _VALIDOPT FALSE )
+foreach ( _opt ${_OPTIONLIST} )
+  if ( ${_opt} )
+    set ( _VALIDOPT TRUE )
+    string ( REPLACE WITH_ "" _opt2 ${_opt} )
+    message ( STATUS "Will install package ${_opt2}" )
+  endif ( ${_opt} )
+endforeach ( _opt )
+if ( NOT ${_VALIDOPT} )
+  message ( FATAL_ERROR "At least one option within ${_OPTIONLIST} must be selected" )
+endif ( NOT ${_VALIDOPT} )
+
 
 
 # Parcours recursif des sous-repertoires
-if ( NOT WITH_TELEMAC_CATA )
-  add_subdirectory ( Accas )
-  add_subdirectory ( Aide )
-  add_subdirectory ( Editeur )
-  add_subdirectory ( Extensions )
-  add_subdirectory ( Ihm )
-  install ( DIRECTORY InterfaceQT4 DESTINATION ${CMAKE_INSTALL_PREFIX} )
-  add_subdirectory ( Noyau )
-  add_subdirectory ( UiQT5 )
-  add_subdirectory ( Validation )
-  add_subdirectory ( convert )
-  add_subdirectory ( generator )
-  add_subdirectory ( Traducteur )
-endif ( NOT WITH_TELEMAC_CATA )
-
-
-# Installation des fichiers : MAP
-if (WITH_MAP)
-  add_subdirectory ( MAP )
-endif (WITH_MAP)
+add_subdirectory ( Accas )
+add_subdirectory ( Aide )
+add_subdirectory ( Editeur )
+add_subdirectory ( Efi2Xsd )
+add_subdirectory ( Extensions )
+add_subdirectory ( Ihm )
+install ( DIRECTORY InterfaceQT4 DESTINATION ${CMAKE_INSTALL_PREFIX} )
+add_subdirectory ( Noyau )
+add_subdirectory ( UiQT5 )
+add_subdirectory ( Validation )
+add_subdirectory ( convert )
+add_subdirectory ( generator )
+add_subdirectory ( Traducteur )
+
 
 # Installation des fichiers : CARMEL
 if (WITH_CARMEL)
@@ -126,10 +137,6 @@ if (WITH_CARMEL)
   add_subdirectory ( CarmelCS )
 endif (WITH_CARMEL)
 
-# Installation des fichiers : Sep
-if (WITH_SEP)
-  add_subdirectory ( Sep )
-endif (WITH_SEP)
 
 # Installation des fichiers : ZCracks
 if (WITH_ZCRACKS)