-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (33 loc) · 1.26 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.17)
project(cpp-multiarch)
#---------------------------------------------------------------------------------------
# compiler config
#---------------------------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_compile_options("-Wall")
add_compile_options("-Wextra")
add_compile_options("-Wconversion")
add_compile_options("-pedantic")
add_compile_options("-Wfatal-errors")
endif()
# fmt library dependency
find_package(fmt CONFIG REQUIRED)
# spdlog library dependency
find_package(spdlog CONFIG REQUIRED)
# yaml-cpp library dependency
find_package(yaml-cpp 0.6.2 REQUIRED)
# Threads
find_package(Threads)
message("Building cpp-app for ${CMAKE_SYSTEM_PROCESSOR}")
# Build the bin path for the install target by mapping CMAKE_SYSTEM_PROCESSOR
# (x86_64 or aarch64) to the docker builx TARGETPLATFORM (linux/amd64 or
# linux/arm64)
if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64")
set(BIN_PATH "linux/amd64")
elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64")
set(BIN_PATH "linux/arm64")
endif()
add_subdirectory(src)