aboutsummaryrefslogtreecommitdiff
path: root/source/lib/proto/CMakeLists.txt
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2023-08-17 12:32:50 +0200
committerFelix Morgner <felix.morgner@gmail.com>2023-08-17 12:32:50 +0200
commit375799fa79d1af76f33299acc20a11a167a021f8 (patch)
tree8f91b982ec96225c33a2f4871730ababffe5cab0 /source/lib/proto/CMakeLists.txt
parentaf471b9b780869915d3217b228e24d025892de47 (diff)
downloadwanda-375799fa79d1af76f33299acc20a11a167a021f8.tar.xz
wanda-375799fa79d1af76f33299acc20a11a167a021f8.zip
project: restructure libraries and build env
Diffstat (limited to 'source/lib/proto/CMakeLists.txt')
-rw-r--r--source/lib/proto/CMakeLists.txt38
1 files changed, 38 insertions, 0 deletions
diff --git a/source/lib/proto/CMakeLists.txt b/source/lib/proto/CMakeLists.txt
new file mode 100644
index 0000000..9967a95
--- /dev/null
+++ b/source/lib/proto/CMakeLists.txt
@@ -0,0 +1,38 @@
+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("fmt" 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
+ "fmt::fmt"
+)
+
+install(TARGETS "wanda-${LIB_NAME}"
+ FILE_SET HEADERS
+)
+
+add_library("wanda::${LIB_NAME}" ALIAS "wanda-${LIB_NAME}")