From 1fbd7f944dda3fba9b04f20c19320d0cf11dd501 Mon Sep 17 00:00:00 2001 From: Adrien Valiente Date: Thu, 17 Oct 2024 13:25:41 +0200 Subject: [PATCH] Prefix PUBLIC_HEADER with CMAKE_CURRENT_SOURCE_DIR This is required to install the project when using cmake FetchContent, or it will complain about the file json-schema.hpp not found (because it will use a relative path to the project that called FetchContent instead of json-schema-validator path --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7848554..f35c92c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,7 +12,7 @@ target_include_directories(nlohmann_json_schema_validator PUBLIC ) set_target_properties(nlohmann_json_schema_validator PROPERTIES - PUBLIC_HEADER nlohmann/json-schema.hpp) + PUBLIC_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/nlohmann/json-schema.hpp) # TODO: Why would this need to be if guarded? if (JSON_VALIDATOR_SHARED_LIBS)