forked from hellozee/errors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
44 lines (28 loc) · 1.18 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
42
43
cmake_minimum_required(VERSION 3.0)
# Initial Setup ============================================
set(PROJECT_NAME errors)
project(${PROJECT_NAME})
set(CMAKE_BUILD_TYPE Debug)
set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
# using clang
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Weverything")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
# using gcc
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
endif()
set(CMAKE_CXX_STANDARD 14)
# Building the executable ===================================
include_directories(include/)
# Building the examples =====================================
add_subdirectory(examples)
# Building the tests ========================================
add_subdirectory(external/gtest)
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
include( cmake/CodeCoverage.cmake )
SET(CMAKE_CXX_FLAGS "-g -O0 --coverage -fprofile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS "-g -O0 --coverage -fprofile-arcs -ftest-coverage")
add_subdirectory(tests)