aboutsummaryrefslogtreecommitdiff
path: root/source/lib/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/CMakeLists.txt')
-rw-r--r--source/lib/CMakeLists.txt76
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
+)