12.1.3 : Le CMakeLists.txt



1
2
project(FullCalibrationBench)
cmake_minimum_required(VERSION 3.0)


Pour l'exemple en C++20, le compilateur va appeler TBB (Threading Bounding Block, la bibliothèque de parallélisation d'Intel) pour gérer les exécutions std::execution::par_unseq et std::execution::par . Si vous l'oubliez, vous aurez une erreur de linkage :
1
find_package(TBB COMPONENTS tbb REQUIRED)


On utiliser notre ensemble de scripts cmake de fainéant :
1
add_subdirectory(cmake)


On définit notre projet :
1
2
3
phoenix_base_project("FullCalibrationBench" "1.0.0"
		"Set of calibration performance tests"
		"")


On utilise une bibliothèque de benchmark pour faire nos tests plus proprement :
1
pull_extra_module("MicroBenchmark" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS/MicroBenchmark.git")


On inclue le dossier src :
1
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)


On ajoute le dossier src :
1
2
3
add_subdirectory(src)

set(PHOENIX_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src;${PHOENIX_INCLUDE_DIRS}" CACHE INTERNAL "list of Phoenix include dirs")


Le fichier CMakeLists.txt complet :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
project(FullCalibrationBench)
cmake_minimum_required(VERSION 3.0)

find_package(TBB COMPONENTS tbb REQUIRED)

add_subdirectory(cmake)

phoenix_base_project("FullCalibrationBench" "1.0.0"
		"Set of calibration performance tests"
		"")
pull_extra_module("MicroBenchmark" "https://gitlab.in2p3.fr/CTA-LAPP/PHOENIX_LIBS/MicroBenchmark.git")

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)

add_subdirectory(src)

set(PHOENIX_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src;${PHOENIX_INCLUDE_DIRS}" CACHE INTERNAL "list of Phoenix include dirs")
Le fichier CMakeLists.txt est disponible ici.