-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
35 lines (25 loc) · 933 Bytes
/
CMakeLists.txt
File metadata and controls
35 lines (25 loc) · 933 Bytes
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
cmake_minimum_required(VERSION 3.2)
project({{__NAME__}} C CXX)
set(CXX_STANDARD 20)
set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "-std=c++20")
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
include_directories(src/)
add_executable({{__NAME__}}_test test/main.cpp)
target_link_libraries({{__NAME__}}_test gtest_main)
include(GoogleTest)
gtest_discover_tests({{__NAME__}}_test)
find_package(Boost 1.76.0 COMPONENTS program_options REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
include_directories(include/)
aux_source_directory(src/ SRC)
add_executable({{__NAME__}} ${SRC})
target_include_directories({{__NAME__}} PUBLIC include/)
target_include_directories({{__NAME__}} PUBLIC ${Boost_LIBRARIES})