From 577fc0845718ed8ad5bebf02a277c0579a817f77 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 17 May 2024 17:58:38 +0200 Subject: wanda: restructure source layout --- source/lib/CMakeLists.txt | 76 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 9 deletions(-) (limited to 'source/lib/CMakeLists.txt') diff --git a/source/lib/CMakeLists.txt b/source/lib/CMakeLists.txt index b9cafe7..f8f2bdb 100644 --- a/source/lib/CMakeLists.txt +++ b/source/lib/CMakeLists.txt @@ -1,9 +1,67 @@ -if(WANDA_APPLICATIONS_ONLY) - set(WANDA_LIBRARY_TYPE OBJECT) -endif() - -add_subdirectory("control") -add_subdirectory("meta") -add_subdirectory("proto") -add_subdirectory("std_ext") -add_subdirectory("system") +file(GLOB_RECURSE HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "include/*.hpp") +file(GLOB_RECURSE SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" CONFIGURE_DEPENDS "src/*.cpp") + +find_package("JPEG" REQUIRED) +find_package("PNG" REQUIRED) +find_package("PkgConfig" REQUIRED) + +pkg_check_modules("GIO" + REQUIRED + IMPORTED_TARGET + GLOBAL + "gio-2.0" +) + +pkg_check_modules("libmagic" + REQUIRED + IMPORTED_TARGET + GLOBAL + "libmagic" +) + +add_library("wanda" + ${SOURCES} +) + +target_sources("wanda" INTERFACE + FILE_SET HEADERS + FILES ${HEADERS} + BASE_DIRS "include" +) + +target_include_directories("wanda" PUBLIC + "$" +) + +target_include_directories("wanda" SYSTEM PUBLIC + "$" +) + +target_compile_features("wanda" PUBLIC + "cxx_std_20" +) + +target_link_libraries("wanda" PUBLIC + "Boost::headers" + "JPEG::JPEG" + "PNG::PNG" + "spdlog::spdlog_header_only" + + "PkgConfig::libmagic" + "PkgConfig::GIO" +) + +add_executable("wanda-tests" + "tests/xdg.cpp" +) + +target_link_libraries("wanda-tests" PRIVATE + "wanda" + "Catch2::Catch2WithMain" +) + +catch_discover_tests("wanda-tests") + +install(TARGETS "wanda" + FILE_SET HEADERS +) -- cgit v1.2.3