aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-16 00:53:28 +0200
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-10-16 01:22:12 +0200
commit280d400877c8c4c3d14a68f3ffe28b6d7a1b99bf (patch)
tree6a26dcaa29e759f387c520ee65b0ceb885700339 /cmake
parent584de479cb87e3c63f00e6148aa4c623c3c4b0fd (diff)
downloadlibweb-280d400877c8c4c3d14a68f3ffe28b6d7a1b99bf.tar.gz
CMake: Use in-tree dynstr if not availablev0.1.0-rc4
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Finddynstr.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/Finddynstr.cmake b/cmake/Finddynstr.cmake
new file mode 100644
index 0000000..8d785b2
--- /dev/null
+++ b/cmake/Finddynstr.cmake
@@ -0,0 +1,15 @@
+mark_as_advanced(DYNSTR_LIBRARY DYNSTR_INCLUDE_DIR)
+find_library(DYNSTR_LIBRARY NAMES dynstr)
+find_path(DYNSTR_INCLUDE_DIR NAMES dynstr PATH_SUFFIXES include)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(dynstr
+ DEFAULT_MSG DYNSTR_LIBRARY DYNSTR_INCLUDE_DIR)
+
+if(DYNSTR_FOUND)
+ if(NOT TARGET dynstr)
+ add_library(dynstr UNKNOWN IMPORTED)
+ set_target_properties(dynstr PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${DYNSTR_INCLUDE_DIR}"
+ IMPORTED_LOCATION "${DYNSTR_LIBRARY}")
+ endif()
+endif()