From f376690822cbc2d17044e626be5df21f7d91ca8f Mon Sep 17 00:00:00 2001 From: Matteo Settenvini Date: Mon, 30 Mar 2020 04:29:56 +0200 Subject: [PATCH] Add a target to RapidJSONConfig.cmake.in (#1350) This way, users can call target_link_libraries against the imported target, which is the recommended way of doing things. --- RapidJSONConfig.cmake.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RapidJSONConfig.cmake.in b/RapidJSONConfig.cmake.in index e3c65a5..8c5ca5f 100644 --- a/RapidJSONConfig.cmake.in +++ b/RapidJSONConfig.cmake.in @@ -13,3 +13,9 @@ get_filename_component(RapidJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) set( RapidJSON_INCLUDE_DIR "@RapidJSON_INCLUDE_DIR@" ) set( RapidJSON_INCLUDE_DIRS "@RapidJSON_INCLUDE_DIR@" ) message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}") + +if(NOT TARGET rapidjson) + add_library(rapidjson INTERFACE IMPORTED) + set_property(TARGET rapidjson PROPERTY + INTERFACE_INCLUDE_DIRECTORIES ${RapidJSON_INCLUDE_DIRS}) +endif()