-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
49 lines (36 loc) · 1.46 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
# CMake 3.15 or newer is requried because of CMP0091.
cmake_minimum_required(VERSION "3.15")
# The CMake compatibility flag for MSVC runtime library flag. New in 3.15. Must set "NEW"
cmake_policy(SET CMP0091 "NEW")
# Enforce the /MT or /MTd as link option for MS Visual Studio C++
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
#----------------------------------------------------------------------------
# Parameters inside project
project("template_application")
# Compiler option
# GoogleTest requirest C++11 or later
set(CMAKE_CXX_STANDARD "11")
set(CMAKE_CXX_STANDARD_REQUIRED "ON")
set(CMAKE_CXX_EXTENSIONS "OFF")
#----------------------------------------------------------------------------
# Do not edit the lines below
# Executable name
set(EXECUTABLE_NAME ${PROJECT_NAME})
# Test executable and library name
set(TEST_EXECUTABLE_NAME "test_${PROJECT_NAME}")
set(TEST_LIBRARY_NAME "${PROJECT_NAME}_for_test")
# Enable CTest
# This command automatically run the enable_test() command.
# And the CMake specification requires to place the enable_test() at the
# root of the project, to run the ctest correctly.
# Thus, place this command at the root of project.
include("CTest")
# Using thread inside application
find_package("Threads" REQUIRED)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include("CPack")
# Subdirectories
add_subdirectory("src")
add_subdirectory("test")
add_subdirectory("doc")