From ae47cf29bbd90f7c65a3b2cc7bcee80eb9599d90 Mon Sep 17 00:00:00 2001 From: Abe Tomoaki Date: Thu, 21 Nov 2024 17:56:34 +0900 Subject: [PATCH] Make: Include submodule header files (#538) For use in a C++ project, we configured CMakeLists.txt to fetch and build USearch. For example, the following configuration: ``` fetchcontent_declare( usearch GIT_REPOSITORY "https://github.com/unum-cloud/usearch.git" GIT_TAG "v2.16.5" GIT_SUBMODULES ...) fetchcontent_makeavailable(usearch) ``` Then it cannot find the header file for the submodule and an error occurs. For example, the following errors: ``` .../_deps/usearch-src/include/usearch/index_plugins.hpp:37:10: fatal error: fp16/fp16.h: No such file or directory 37 | #include ``` So we added a header file to be included in target_include_directories(). --- CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e1fa4c16..6dba6210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,18 @@ target_include_directories( ${USEARCH_TARGET_NAME} ${USEARCH_SYSTEM_INCLUDE} INTERFACE $ $ ) +if (USEARCH_USE_FP16LIB) + target_include_directories( + ${USEARCH_TARGET_NAME} ${USEARCH_SYSTEM_INCLUDE} INTERFACE $ + $ + ) +endif() +if (USEARCH_USE_SIMSIMD) + target_include_directories( + ${USEARCH_TARGET_NAME} ${USEARCH_SYSTEM_INCLUDE} INTERFACE $ + $ + ) +endif() # Install a pkg-config file, so other tools can find this configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkg-config.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc")