-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
32 lines (25 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
cmake_minimum_required(VERSION 3.26)
# Notes: project must be at the top of this file, otherwise the following error is generated:
#CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
#Missing variable is:
#CMAKE_FIND_LIBRARY_PREFIXES
project( CppFeatures )
# Output all libraries and executables in the same directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin
CACHE PATH "Single directory for all libraries.")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin
CACHE PATH "Single directory for all executables.")
mark_as_advanced( LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH )
enable_testing()
macro(UseCompilationWarningAsError)
if ( MSVC )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX ")
endif( MSVC )
endmacro()
if ( MSVC )
# Force parallel compilation
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP4")
# DO NOT truncate "callstack" on constexpr compilation error
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /constexpr:backtrace10000")
endif( MSVC )
add_subdirectory( test )