-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
36 lines (27 loc) · 1.04 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
cmake_minimum_required(VERSION 3.10)
project(cpp_project LANGUAGES CXX)
########## General Settings for the whole project ############################
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if (MSVC)
# Set warning level (CMAKE adds /W3 and msvc produces a warning, when we would just add /W4 )
STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
add_compile_options(
/permissive-
)
else()
add_compile_options(-Wall -Wextra)
endif()
########## Lookup libraries ##################################################
find_package(cxxopts REQUIRED)
# add_subdirectory( <libs/libname>)
########## Generate Executable ##############################################
add_subdirectory( src )
########## Testing ###########################################################
option(cpp_project_INCLUDE_TESTS "Generate targets in test directory" OFF)
if( cpp_project_INCLUDE_TESTS )
enable_testing()
add_subdirectory( tests )
endif()