-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
29 lines (22 loc) · 887 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
cmake_minimum_required(VERSION 3.25)
project(endian LANGUAGES CXX VERSION 1.0.3)
option(ENDIAN_BUILD_TESTS "Configure unit tests target" OFF)
option(ENDIAN_BUILD_EXAMPLES "Configure examples target" OFF)
option(ENDIAN_BUILD_INSTALL "Configure install target" ON)
add_library(endian INTERFACE)
target_include_directories(
endian INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
target_compile_features(endian INTERFACE cxx_std_20)
add_library(ecpp::endian ALIAS endian)
if (PROJECT_IS_TOP_LEVEL OR ENDIAN_BUILD_INSTALL)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/install.cmake)
endif ()
if (PROJECT_IS_TOP_LEVEL OR ENDIAN_BUILD_EXAMPLES)
add_subdirectory(examples EXCLUDE_FROM_ALL)
endif ()
if (PROJECT_IS_TOP_LEVEL OR ENDIAN_BUILD_TESTS)
enable_testing()
add_subdirectory(tests EXCLUDE_FROM_ALL)
endif ()