Skip to content

Commit 6f6613a

Browse files
committed
- workaround for CMake < 3.18 ALIAS target limitation to not point to non-GLOBAL IMPORTED target
1 parent 37ce902 commit 6f6613a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jsoncppConfig.cmake.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ cmake_policy(VERSION 3.0)
66
include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-targets.cmake" )
77

88
if(TARGET jsoncpp_static)
9-
add_library(JsonCpp::JsonCpp ALIAS jsoncpp_static)
9+
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED )
10+
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_static")
1011
elseif(TARGET jsoncpp_lib)
11-
add_library(JsonCpp::JsonCpp ALIAS jsoncpp_lib)
12+
add_library(JsonCpp::JsonCpp INTERFACE IMPORTED )
13+
set_target_properties(JsonCpp::JsonCpp PROPERTIES INTERFACE_LINK_LIBRARIES "jsoncpp_lib")
1214
endif()
1315

1416
check_required_components(JsonCpp)

0 commit comments

Comments
 (0)