-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
26 lines (20 loc) · 785 Bytes
/
CMakeLists.txt
File metadata and controls
26 lines (20 loc) · 785 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
# We require at least cmake 2.8
cmake_minimum_required (VERSION 2.8)
# Name our project
project (cpp11fun)
# We set a variable like so (this "creates" the variable if it doesn't exist)
# sort of like those creepy "dynamic" languages . . . sigh.
set(UNIVERSAL_FLAGS "-Werror -Wall -Wpedantic -O2")
set(IS_CLANG FALSE)
set(IS_GCC FALSE)
# Check for the compiler being used and set some variables accordingly
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
message("It seems that you're using clang")
set(IS_CLANG TRUE)
set(CMAKE_CXX_FLAGS "${UNIVERSAL_FLAGS} -std=c++11 -stdlib=libc++")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(IS_GCC TRUE)
set(CMAKE_CXX_FLAGS "${UNIVERSAL_FLAGS} -std=c++11")
endif()
# Recurse into the source directory
add_subdirectory(src)