From 375799fa79d1af76f33299acc20a11a167a021f8 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Thu, 17 Aug 2023 12:32:50 +0200 Subject: project: restructure libraries and build env --- source/lib/control/CMakeLists.txt | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 source/lib/control/CMakeLists.txt (limited to 'source/lib/control/CMakeLists.txt') diff --git a/source/lib/control/CMakeLists.txt b/source/lib/control/CMakeLists.txt new file mode 100644 index 0000000..3236cf8 --- /dev/null +++ b/source/lib/control/CMakeLists.txt @@ -0,0 +1,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 + "$" +) + +target_include_directories("wanda-${LIB_NAME}" SYSTEM PUBLIC + "$" +) + +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" +) + +install(TARGETS "wanda-${LIB_NAME}" + FILE_SET HEADERS +) + +add_library("wanda::${LIB_NAME}" ALIAS "wanda-${LIB_NAME}") \ No newline at end of file -- cgit v1.2.3