-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (30 loc) · 1.39 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
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.5.0)
project(elephant-logger)
if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
message(FATAL_ERROR "in-source build not allowed. You should create a 'build' directory then cmake from there. `mkdir build && cd build`")
endif()
# ------------------------------------------------------------------------------
# Compiler flags
# ------------------------------------------------------------------------------
message(STATUS "Detected Operating System: ${CMAKE_SYSTEM_NAME}")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "No BUILD_TYPE set: uses Release")
message(STATUS "Available build types: Debug Release RelWithDebInfo MinSizeRel")
set(CMAKE_BUILD_TYPE Release)
else()
message(STATUS "BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif(NOT CMAKE_BUILD_TYPE)
# ------------------------------------------------------------------------------
# Utils
# ------------------------------------------------------------------------------
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
# ------------------------------------------------------------------------------
# Examples
# ------------------------------------------------------------------------------
option(elephant_examples "Generate all examples" OFF)
if(elephant_examples)
message(STATUS "Generate examples")
add_subdirectory("examples")
endif()