-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
49 lines (35 loc) · 1.46 KB
/
CMakeLists.txt
File metadata and controls
49 lines (35 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
cmake_minimum_required(VERSION 3.22)
project(Distribution_Example VERSION 0.0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# create cmake options - USE_ARMPL
option(USE_APL "Whether to build using Arm Performance libraries or not (default = off)" OFF)
option(BUILD_TESTS "Whether to build the helper tests, to sweep through values and generate visualizations" OFF)
set(ARMPL_DIR "$ENV{ARMPL_DIR}" CACHE PATH "Path to Arm Performance Libraries root")
# set variables
set(MAIN_EXECUTABLE main)
set(SWEEP_TEST_EXECUTABLE sweep_microbench_baseline)
set(GENERATE_VISUALIZATION_EXECUTABLE generate_visualization_baseline)
set(CORE_LIBRARY core_library)
# Just need to build the CORE LIBRARY with Arm Performance Library Support
if(USE_APL)
if(NOT ARMPL_DIR)
message(FATAL_ERROR
"USE_APL=ON but ARMPL_DIR is not set. "
"run module load <armpl> or pass -DARMPL_DIR=/path/to/armpl")
endif()
message(STATUS "using Arm Performance Libraries")
set(MAIN_EXECUTABLE main_with_apl)
set(SWEEP_TEST_EXECUTABLE sweep_microbench_with_apl)
set(GENERATE_VISUALIZATION_EXECUTABLE generate_visualization_with_apl)
add_subdirectory(src)
else()
message(STATUS "NOT using Arm Performance Libraries")
add_subdirectory(src)
endif()
# add subdirectories (src needs to go before include)
add_subdirectory(include)
if(BUILD_TESTS)
add_subdirectory(tests)
endif()