aboutsummaryrefslogtreecommitdiff
path: root/cmake/Findspdlog.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Findspdlog.cmake')
-rw-r--r--cmake/Findspdlog.cmake19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/Findspdlog.cmake b/cmake/Findspdlog.cmake
new file mode 100644
index 0000000..e54e374
--- /dev/null
+++ b/cmake/Findspdlog.cmake
@@ -0,0 +1,19 @@
+### Get same spdlog as Northstar
+
+if (spdlog_FOUND)
+ return()
+endif()
+
+find_package(NorthstarPluginABI REQUIRED)
+find_package(Threads REQUIRED)
+
+check_init_submodule(${NS_LAUNCHER_DIR}/thirdparty/spdlog)
+
+add_library(spdlog_header_only INTERFACE)
+add_library(spdlog::spdlog_header_only ALIAS spdlog_header_only)
+target_include_directories(spdlog_header_only INTERFACE "${NS_LAUNCHER_DIR}/thirdparty")
+target_include_directories(spdlog_header_only INTERFACE "${NS_LAUNCHER_DIR}/thirdparty/spdlog")
+target_link_libraries(spdlog_header_only INTERFACE Threads::Threads)
+
+set(spdlog_FOUND 1)
+