Skip to content

Commit f376690

Browse files
authored
Add a target to RapidJSONConfig.cmake.in (Tencent#1350)
This way, users can call target_link_libraries against the imported target, which is the recommended way of doing things.
1 parent 234ff04 commit f376690

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

RapidJSONConfig.cmake.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ get_filename_component(RapidJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
1313
set( RapidJSON_INCLUDE_DIR "@RapidJSON_INCLUDE_DIR@" )
1414
set( RapidJSON_INCLUDE_DIRS "@RapidJSON_INCLUDE_DIR@" )
1515
message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}")
16+
17+
if(NOT TARGET rapidjson)
18+
add_library(rapidjson INTERFACE IMPORTED)
19+
set_property(TARGET rapidjson PROPERTY
20+
INTERFACE_INCLUDE_DIRECTORIES ${RapidJSON_INCLUDE_DIRS})
21+
endif()

0 commit comments

Comments
 (0)