-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
46 lines (36 loc) · 1.12 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
45
46
cmake_minimum_required(VERSION 3.10)
project(SurgeProtector)
# Output targets
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Boost
find_package(Boost REQUIRED COMPONENTS program_options)
link_libraries(Boost::program_options)
# Libconfig
find_library(LIBCONFIG config)
find_library(LIBCONFIGPP config++)
if(NOT LIBCONFIG OR NOT LIBCONFIGPP)
message(FATAL_ERROR "libconfig not found")
else()
message(STATUS "Found libconfig: " ${LIBCONFIG})
message(STATUS "Found libconfig++: " ${LIBCONFIGPP})
endif()
link_libraries(${LIBCONFIG})
link_libraries(${LIBCONFIGPP})
# C++ STD version
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# C STD version
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED True)
set(CMAKE_C_EXTENSIONS True)
# CXX flags
add_compile_options(-m64 -O3 -march=native -g
-pedantic-errors -Wall -Wextra -Werror)
# Headers
include_directories(.)
# Sources
add_subdirectory(common)
add_subdirectory(scheduler)
add_subdirectory(simulator)