diff options
| author | Felix Morgner <felix.morgner@gmail.com> | 2024-05-17 17:58:38 +0200 |
|---|---|---|
| committer | Felix Morgner <felix.morgner@gmail.com> | 2024-05-17 17:58:38 +0200 |
| commit | 577fc0845718ed8ad5bebf02a277c0579a817f77 (patch) | |
| tree | 3d1cdc53c426a0ba60a7996619a7b787850bb3b3 /source/lib/CMakeLists.txt | |
| parent | de5bf7ca3b7a2bf6be35b86486b00dc6a071b950 (diff) | |
| download | wanda-develop.tar.xz wanda-develop.zip | |
Diffstat (limited to 'source/lib/CMakeLists.txt')
| -rw-r--r-- | source/lib/CMakeLists.txt | 76 |
1 files changed, 67 insertions, 9 deletions
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 + "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>" +) + +target_include_directories("wanda" SYSTEM PUBLIC + "$<INSTALL_INTERFACE:include>" +) + +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 +) |
