mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-27 11:21:02 +08:00
- 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
This commit is contained in:
parent
b640795571
commit
62f3e03475
@ -5,6 +5,12 @@ cmake_policy(VERSION 3.0)
|
|||||||
|
|
||||||
include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-targets.cmake" )
|
include ( "${CMAKE_CURRENT_LIST_DIR}/jsoncpp-targets.cmake" )
|
||||||
|
|
||||||
|
if(TARGET jsoncpp_static)
|
||||||
|
add_library(JsonCpp::JsonCpp ALIAS jsoncpp_static)
|
||||||
|
elseif(TARGET jsoncpp_lib)
|
||||||
|
add_library(JsonCpp::JsonCpp ALIAS jsoncpp_lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_required_components(JsonCpp)
|
check_required_components(JsonCpp)
|
||||||
|
|
||||||
cmake_policy(POP)
|
cmake_policy(POP)
|
Loading…
x
Reference in New Issue
Block a user