-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
60 lines (48 loc) · 1.6 KB
/
CMakeLists.txt
File metadata and controls
60 lines (48 loc) · 1.6 KB
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
project(StatePointer)
cmake_minimum_required(VERSION 3.2.2)
#==============================================================================
# Setup for compiler toolchain.
#==============================================================================
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
set(COMPILING_WITH_CLANG true)
set(COMPILING_WITH_GNULIKE true)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(COMPILING_WITH_GXX true)
set(COMPILING_WITH_GNULIKE true)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(COMPILING_WITH_MSVC true)
set(COMPILING_WITH_GNULIKE false)
else()
message(WARNING "Unknown compiler ${CMAKE_CXX_COMPILER_ID}, compiling with default parameters.")
endif()
#==============================================================================
# Definitions for the various supported compilers.
#==============================================================================
if(COMPILING_WITH_GNULIKE)
add_definitions(
-std=c++14
# -O0
# -Wall
# -Wextra
# -Wpedantic
# -Wconversion
# -Wsign-conversion
# -pedantic-errors
)
endif()
if(COMPILING_WITH_CLANG)
# Nothing to do, yet.
endif()
if(COMPILING_WITH_GCC)
# Nothing to do, yet.
endif()
if(COMPILING_WITH_MSVC)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_definitions(/EHsc)
endif()
#==============================================================================
# Setup and enable testing.
#==============================================================================
add_subdirectory(lib/googletest)
enable_testing()
add_subdirectory(testsrc)