From 280d400877c8c4c3d14a68f3ffe28b6d7a1b99bf Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 16 Oct 2023 00:53:28 +0200 Subject: CMake: Use in-tree dynstr if not available --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a8bf44..c89fa03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,14 @@ add_library(${PROJECT_NAME} http.c server.c wildcard_cmp.c) -add_subdirectory(dynstr) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake) +find_package(dynstr 0.1.0) + +if(NOT DYNSTR_FOUND) + message(STATUS "Using in-tree dynstr") + add_subdirectory(dynstr) +endif() + target_include_directories(${PROJECT_NAME} PUBLIC include) target_link_libraries(${PROJECT_NAME} PUBLIC dynstr) install(TARGETS ${PROJECT_NAME}) -- cgit v1.2.3