blob: 6e95456519e2d861f2d3b95962e6d30a30c064eb (
plain)
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
|
cmake_path(GET CMAKE_CURRENT_SOURCE_DIR STEM LIB_NAME)
file(GLOB_RECURSE LIB_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.hpp")
file(GLOB_RECURSE LIB_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "**/*.cpp")
find_package("asio" REQUIRED)
find_package("spdlog" REQUIRED)
add_library("wanda-${LIB_NAME}"
${LIB_SOURCES}
)
target_sources("wanda-${LIB_NAME}" INTERFACE
FILE_SET HEADERS
FILES ${LIB_HEADERS}
BASE_DIRS "include"
)
target_include_directories("wanda-${LIB_NAME}" PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
)
target_include_directories("wanda-${LIB_NAME}" SYSTEM PUBLIC
"$<INSTALL_INTERFACE:include>"
)
target_compile_features("wanda-${LIB_NAME}" PUBLIC
"cxx_std_20"
)
target_link_libraries("wanda-${LIB_NAME}" PUBLIC
"wanda::meta"
"wanda::proto"
"wanda::system"
"asio::asio"
"spdlog::spdlog_header_only"
)
install(TARGETS "wanda-${LIB_NAME}"
FILE_SET HEADERS
)
add_library("wanda::${LIB_NAME}" ALIAS "wanda-${LIB_NAME}")
|