|
| 1 | +cmake_minimum_required(VERSION 3.11) |
| 2 | + |
| 3 | +# ---------------------------------------------------------------------------- |
| 4 | +# Indique que le projet n'a pas de language |
| 5 | +# Cela est indispensable pour que CMake ne recherche pas les |
| 6 | +# compilateurs avant d'avoir inclus les fichiers de configuration. |
| 7 | +Project(ArcaneFramework LANGUAGES NONE) |
| 8 | + |
| 9 | +# ---------------------------------------------------------------------------- |
| 10 | +# Macro pour positionner la variable 'var_name' dans le cache |
| 11 | +# avec sa valeur actuelle ou la valeur 'var_value' si elle n'a |
| 12 | +# pas de valeur. |
| 13 | +macro(arcane_set_if_unset var_name var_value var_type description) |
| 14 | + if (NOT DEFINED ${var_name}) |
| 15 | + set(${var_name} ${var_value}) |
| 16 | + endif() |
| 17 | + set(${var_name} ${${var_name}} CACHE ${var_type} "${description}" FORCE) |
| 18 | + option(${var_name} "${description}") |
| 19 | +endmacro() |
| 20 | + |
| 21 | +# ---------------------------------------------------------------------------- |
| 22 | +# ---------------------------------------------------------------------------- |
| 23 | + |
| 24 | +arcane_set_if_unset(ARCANE_WANT_NUMERICS TRUE BOOL "Compile numerical library") |
| 25 | +arcane_set_if_unset(ARCANE_WANT_TOTALVIEW TRUE BOOL "Compile total view display") |
| 26 | +arcane_set_if_unset(ARCANE_DEFAULT_PARTITIONER Metis STRING "Default partitioner") |
| 27 | + |
| 28 | +arcane_set_if_unset(ARCANE_BUILD_TYPE Release STRING "Arcane build type") |
| 29 | +arcane_set_if_unset(ARCANE_WANT_LIBXML2 TRUE BOOL "Use libxml2") |
| 30 | +arcane_set_if_unset(ARCANE_WANT_LEGACY_CONNECTIVITY FALSE BOOL "Use legacy item connectivity accessor") |
| 31 | +arcane_set_if_unset(ARCANE_WANT_CHECK FALSE BOOL "Compilation with additional check (array bounds, ...)") |
| 32 | + |
| 33 | +# Force l'utilisation de bibliothèques dynamiques |
| 34 | +set(BUILD_SHARED_LIBS TRUE) |
| 35 | + |
| 36 | +set(ARCFRAMEWORK_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) |
| 37 | + |
| 38 | +arcane_set_if_unset(Arccon_ROOT ${ARCFRAMEWORK_ROOT}/arccon PATH "Arccon root path") |
| 39 | +arcane_set_if_unset(AXLSTAR_ROOT ${ARCFRAMEWORK_ROOT}/axlstar PATH "Axlstar root") |
| 40 | +arcane_set_if_unset(Arccore_ROOT ${ARCFRAMEWORK_ROOT}/arccore PATH "Arccore root") |
| 41 | +arcane_set_if_unset(ARCDEPENDENCIES_ROOT ${ARCFRAMEWORK_ROOT}/dependencies PATH "Arcdependencies root") |
| 42 | + |
| 43 | +# Si on compile avec Spack, on ne surcharge pas les Find*.cmake |
| 44 | +# des dépendences Arcane |
| 45 | +if (NOT ARCANE_BUILD_WITH_SPACK) |
| 46 | + list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) |
| 47 | +endif() |
| 48 | + |
| 49 | +enable_testing() |
| 50 | + |
| 51 | +configure_file(nuget.config.in ${CMAKE_BINARY_DIR}/nuget.config @ONLY) |
| 52 | + |
| 53 | +add_subdirectory(${ARCFRAMEWORK_ROOT}/arcane arcane) |
| 54 | + |
| 55 | +# ---------------------------------------------------------------------------- |
| 56 | +# Recopie les packages nuget de 'dependencies' dans le répertoire |
| 57 | +# contenant les exemples. On recopie les packages nécessaires pour |
| 58 | +# 'netstandard2.0'. |
| 59 | +# |
| 60 | +set(DEPENDENCIES_NUGET ${ARCDEPENDENCIES_ROOT}/nuget_fallback) |
| 61 | +set(SAMPLES_NUGET_DIR ${CMAKE_INSTALL_PREFIX}/samples/_nuget_fallback) |
| 62 | +install(FILES ${DEPENDENCIES_NUGET}/microsoft.netcore.platforms.1.1.0.nupkg DESTINATION ${SAMPLES_NUGET_DIR}) |
| 63 | +install(FILES ${DEPENDENCIES_NUGET}/netstandard.library.2.0.3.nupkg DESTINATION ${SAMPLES_NUGET_DIR}) |
| 64 | + |
| 65 | +# ---------------------------------------------------------------------------- |
| 66 | +# Local Variables: |
| 67 | +# tab-width: 2 |
| 68 | +# indent-tabs-mode: nil |
| 69 | +# coding: utf-8-with-signature |
| 70 | +# End: |
0 commit comments