Skip to content

Commit 8b98d95

Browse files
committed
- declare namespaced export target to simplify the library usage
When the static libary is available use it as exported alias, otherwise use shared library. Cmake takes care about import library when Windows platform DLL is used
1 parent b220de4 commit 8b98d95

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jsoncppConfig.cmake.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ cmake_policy(VERSION 3.0)
55

66
include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-targets.cmake" )
77

8+
if(TARGET jsoncpp_static)
9+
add_library(JsonCpp::JsonCpp ALIAS jsoncpp_static)
10+
elseif(TARGET jsoncpp_lib)
11+
add_library(JsonCpp::JsonCpp ALIAS jsoncpp_lib)
12+
endif()
13+
814
check_required_components(JsonCpp)
915

1016
cmake_policy(POP)

0 commit comments

Comments
 (0)