aboutsummaryrefslogtreecommitdiff
path: root/cmake/Findweb.cmake
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi92@disroot.org>2025-09-22 17:32:44 +0200
committerXavier Del Campo Romero <xavi92@disroot.org>2026-02-13 09:57:39 +0100
commit78bf2fe4a5bf37514f6dfd203ef969da0bf40c2e (patch)
tree33f9440b8ee0fa7a3b3ad033616d722d2101bb4d /cmake/Findweb.cmake
parent107a2e43d54f9a42fb85b00b83cb0d9abb194680 (diff)
Setup project skeletonHEADmaster
Diffstat (limited to 'cmake/Findweb.cmake')
-rw-r--r--cmake/Findweb.cmake24
1 files changed, 24 insertions, 0 deletions
diff --git a/cmake/Findweb.cmake b/cmake/Findweb.cmake
new file mode 100644
index 0000000..a5d1d68
--- /dev/null
+++ b/cmake/Findweb.cmake
@@ -0,0 +1,24 @@
+mark_as_advanced(WEB_LIBRARY WEB_INCLUDE_DIR)
+find_library(WEB_LIBRARY NAMES libweb web)
+
+find_path(WEB_INCLUDE_DIR
+ NAMES
+ handler.h
+ html.h
+ http.h
+ server.h
+ wildcard_cmp.h
+ PATH_SUFFIXES libweb include/libweb)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(web
+ DEFAULT_MSG WEB_LIBRARY WEB_INCLUDE_DIR)
+
+if(WEB_FOUND)
+ if(NOT TARGET web)
+ add_library(web UNKNOWN IMPORTED)
+ set_target_properties(web PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${WEB_INCLUDE_DIR}"
+ IMPORTED_LOCATION "${WEB_LIBRARY}")
+ endif()
+endif()