-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (30 loc) · 868 Bytes
/
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
# Require CMAKE 3.1 or higher
cmake_minimum_required(VERSION 3.1)
# Project name
project(pa3)
# Build for C++14
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Turn on any compiler-specific flags
if (WIN32)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
else()
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
if ("$ENV{RELEASE}" STREQUAL "ON")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2")
endif()
if ("$ENV{SANITIZE}" STREQUAL "ON")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
endif()
endif()
# Any source files in this directory
set(SOURCE_FILES Main.cpp)
# Where any include files are
include_directories(src)
# Subdirectories to build
add_subdirectory(src)
add_subdirectory(tests)
# Name of executable
add_executable(main ${SOURCE_FILES})
# Link main vs the source library
target_link_libraries(main src)