-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
26 lines (19 loc) · 865 Bytes
/
Copy pathCMakeLists.txt
File metadata and controls
26 lines (19 loc) · 865 Bytes
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
cmake_minimum_required(VERSION 2.8)
project(aima_cpp_cmake_travis)
include(gtest.cmake)
SET(COVERAGE OFF CACHE BOOL "Coverage")
add_executable(tests test-suite/unittests.cpp)
find_package(Threads)
target_link_libraries(tests gtest ${CMAKE_THREAD_LIBS_INIT})
if (MSVC)
target_compile_options(tests PRIVATE /std:c++17 /W4 /WX)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od")
add_definitions(-DGTEST_HAS_TR1_TUPLE=0)
else ()
target_compile_options(tests PRIVATE -std=c++14 -g -Wall -Werror -Wextra -Wpedantic -Wconversion -Wswitch-default -Wswitch-enum -Wunreachable-code -Wwrite-strings -Wcast-align -Wshadow -Wundef)
if (COVERAGE)
target_compile_options(tests PRIVATE --coverage)
target_link_libraries(tests PRIVATE --coverage)
endif()
endif()