-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
51 lines (43 loc) · 1.75 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
44
45
46
47
48
49
50
51
cmake_minimum_required(VERSION 3.10)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(cdatastructures LANGUAGES C CXX VERSION 0.1.0)
include(GNUInstallDirs)
################################################################################
# Compiler settings
################################################################################
option(CODE_COVERAGE "Enable coverage reporting" OFF)
if (CODE_COVERAGE AND CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
include(CodeCov)
endif ()
option(IWYU "Run include-what-you-use with the compiler" OFF)
if (IWYU)
find_program(IWYU_COMMAND NAMES include-what-you-use iwyu)
if (NOT IWYU_COMMAND)
message(FATAL_ERROR "CMAKE_IWYU is ON but include-what-you-use is not found!")
endif ()
set(CMAKE_C_INCLUDE_WHAT_YOU_USE "${IWYU_COMMAND};-Xiwyu")
endif ()
################################################################################
# Dependencies
################################################################################
enable_testing()
################################################################################
# Main library
################################################################################
add_library(cdatastructures
src/list.c
src/map.c
src/queue.c
src/stack.c
src/vector.c
)
target_include_directories(cdatastructures
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src)
################################################################################
# Subdirectories
################################################################################
add_subdirectory(test)