-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
37 lines (27 loc) · 903 Bytes
/
CMakeLists.txt
File metadata and controls
37 lines (27 loc) · 903 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
27
28
29
30
31
32
33
34
35
36
37
cmake_minimum_required(VERSION 3.20)
project(chalk VERSION 0.1.0 LANGUAGES CXX)
add_library(chalk INTERFACE)
add_library(chalk::chalk ALIAS chalk)
target_compile_features(chalk INTERFACE cxx_std_20)
target_include_directories(chalk
INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
if(MSVC)
target_compile_options(chalk INTERFACE /W4 /permissive-)
else()
target_compile_options(chalk INTERFACE -Wall -Wextra -Wpedantic)
endif()
option(CHALK_BUILD_TESTS "Build chalk tests" OFF)
option(CHALK_BUILD_EXAMPLES "Build chalk examples" OFF)
include(CTest)
if(CHALK_BUILD_TESTS)
enable_testing()
add_executable(chalk_test_basic tests/test_basic.cpp)
target_link_libraries(chalk_test_basic PRIVATE chalk::chalk)
add_test(NAME chalk.basic COMMAND chalk_test_basic)
endif()
if(CHALK_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()