-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
68 lines (56 loc) · 2.65 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.12)
#-------------------------------------------------------------------------------
# Project name and version
#-------------------------------------------------------------------------------
set(NUM_VERSION_MAJOR "3")
set(NUM_VERSION_MINOR "0")
set(NUM_VERSION_PATCH "3")
set(NUM_VERSION "${NUM_VERSION_MAJOR}.${NUM_VERSION_MINOR}.${NUM_VERSION_PATCH}"
CACHE INTERNAL "Software version number")
project(TNT VERSION ${NUM_VERSION}
DESCRIPTION "Template Numerical Kit"
LANGUAGES CXX)
#-----------------------------------------------------------------------------
# C++17 Support
# Require C++17 and disable compiler-specific extensions
#-----------------------------------------------------------------------------
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
#-----------------------------------------------------------------------------
# INNER BUILD
#-----------------------------------------------------------------------------
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(SOURCE_DIR ${PROJECT_SOURCE_DIR}/src)
set(DOC_DIR ${PROJECT_SOURCE_DIR}/doc)
#-----------------------------------------------------------------------------
# Add the cmake folder so the FindSphinx module is found
#-----------------------------------------------------------------------------
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
#-----------------------------------------------------------------------------
# Define the target : executable
#-----------------------------------------------------------------------------
set(EXE_TARGET ${PROJECT_NAME})
if (MSVC)
# MSVC creates a folder for each build type
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_LIST_DIR}/Bin")
else()
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_LIST_DIR}/Bin/${CMAKE_BUILD_TYPE}")
endif()
#Creates the executable target
add_executable(${EXE_TARGET} "")
#-----------------------------------------------------------------------------
# Add Source code from subdirectories
#-----------------------------------------------------------------------------
add_subdirectory(${SOURCE_DIR})
#-----------------------------------------------------------------------------
# Enable testing using googletest
#-----------------------------------------------------------------------------
enable_testing()
add_subdirectory(${PROJECT_SOURCE_DIR}/test)
#-----------------------------------------------------------------------------
# Add source for doc generation
#-----------------------------------------------------------------------------
if(1)
add_subdirectory(${DOC_DIR})
endif()