Skip to content

Commit 2f42199

Browse files
[config] Ajoute dans le sous-répertoire '_common/build_all' la configuration nécessaire pour compiler toutes les composantes.
Cela correspond à ce que faisait le dépot 'arcframework'.
1 parent 72031c1 commit 2f42199

File tree

7 files changed

+122
-0
lines changed

7 files changed

+122
-0
lines changed

_common/build_all/CMakeLists.txt

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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:
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if (NOT ARCDEPENDENCIES_ROOT)
2+
message(FATAL_ERROR "Variable 'ARCDEPENDENCIES_ROOT' is not set")
3+
endif()
4+
add_subdirectory(${ARCDEPENDENCIES_ROOT} dependencies)
5+
set(ArcDependencies_FOUND YES)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
if (NOT Arccon_ROOT)
2+
# Pour compatibilité
3+
set(Arccon_ROOT "${ARCCON_ROOT}")
4+
endif()
5+
if (NOT Arccon_ROOT)
6+
message(FATAL_ERROR "Variable 'Arccon_ROOT' is not set")
7+
endif()
8+
if (NOT ARCCON_EXPORT_TARGET)
9+
set(ARCCON_EXPORT_TARGET ${ARCCORE_EXPORT_TARGET})
10+
endif()
11+
set(ARCCON_CMAKE_COMMANDS ${Arccon_ROOT}/Arccon.cmake)
12+
add_subdirectory(${Arccon_ROOT} arccon)
13+
set(Arccon_FOUND YES)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
if (NOT Arccore_ROOT)
2+
# Pour compatibilité
3+
set(Arccore_ROOT "${ARCCORE_ROOT}")
4+
endif()
5+
if (NOT Arccore_ROOT)
6+
message(FATAL_ERROR "Variable 'Arccore_ROOT' is not set")
7+
endif()
8+
if (NOT ARCCORE_EXPORT_TARGET)
9+
# Indique qu'on souhaite exporter dans 'ArcaneTargets' les cibles des
10+
# packages définies dans 'Arccon'.
11+
set(ARCCON_EXPORT_TARGET ArcaneTargets)
12+
endif()
13+
14+
add_subdirectory(${Arccore_ROOT} arccore)
15+
set(Arccore_FOUND YES)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
if (NOT AXLSTAR_ROOT)
2+
message(FATAL_ERROR "Variable 'AXLSTAR_ROOT' is not set")
3+
endif()
4+
add_subdirectory(${AXLSTAR_ROOT} axlstar)
5+
set(Axlstar_FOUND YES)

_common/build_all/nuget.config.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="build_local_fallback" value="@ARCFRAMEWORK_ROOT@/dependencies/nuget_fallback" />
6+
</packageSources>
7+
</configuration>

nuget.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="local_fallback" value="./dependencies/nuget_fallback" />
6+
</packageSources>
7+
</configuration>

0 commit comments

Comments
 (0)