-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
38 lines (28 loc) · 988 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
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(c-iterplus LANGUAGES C)
##################################################
# Configure some universal settings
# Disable non standard extensions
set(CMAKE_C_EXTENSIONS OFF)
# Don't skimp on warnings
if(MSVC)
add_compile_options(/W4 /WX)
else()
add_compile_options(-Wall -Wextra -Werror -pedantic)
endif()
if(WIN32)
# But ignore the Microsoft "Use *_s functions" warning
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
##################################################
# Configure target for building the library
# Set library name
set(LIBNAME iterplus)
# Add the interface library target
add_library(${LIBNAME} INTERFACE)
# Add the headers to the library interface
target_include_directories(${LIBNAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR})
# Set standard to C99
target_compile_features(${LIBNAME} INTERFACE c_std_99)
add_subdirectory(tests)
add_subdirectory(samples)