-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
43 lines (34 loc) · 979 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
39
40
41
42
43
# Requirements
cmake_minimum_required(VERSION 3.14)
################################
## Section 1: Declare project ##
################################
project(catify CXX)
set(libname "lib${PROJECT_NAME}")
include("${CMAKE_CURRENT_SOURCE_DIR}/helper.cmake")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
###################################
## Section 2: Project CMake code ##
###################################
# Add library and register compile options
add_library(${libname} INTERFACE)
target_compile_features(
${libname}
INTERFACE
cxx_std_20
)
target_include_directories(
${libname}
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:include>
)
install(
DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION include
)
if(PROJECT_IS_TOP_LEVEL)
find_or_fetch(fmt "https://github.com/fmtlib/fmt.git" master)
FetchContent_MakeAvailable(${remote_dependencies})
add_source_dir(src ${libname} fmt)
endif()