-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (36 loc) · 1.3 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
# SPDX-FileCopyrightText: 2023 J0R0U <https://github.com/J0R0U>
# SPDX-License-Identifier: MIT
# Required cmake version
cmake_minimum_required(VERSION 3.12.0)
# Define current project
project(
fun_with_template
VERSION 0.0.1
LANGUAGES CXX
)
# Set the project description
set(PROJECT_DESCRIPTION "\
A small project showing how C++ templates can be used. For more detailed \
description have a look at the README.md file.\
")
# Set options to treat warnings as errors
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(FUN_TEMPLATE_WARNING_OPTION "-Wall" "-Wextra" "-Wpedantic" "-Werror")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(FUN_TEMPLATE_WARNING_OPTION "-Wall" "-Wextra" "-Wpedantic" "-Weverything" "-Werror")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(FUN_TEMPLATE_WARNING_OPTION "/W4" "/WX")
endif()
# Check if current project is the main project
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# Disable extensions, only the standart should be allowed
set(CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# include CTest to run default executable
include(CTest)
endif()
# Add subfolders with the different project
add_subdirectory(00_preprocessor)
add_subdirectory(01_basics)
add_subdirectory(02_metaprogramming)
add_subdirectory(03_concepts)