diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 67fa0342..2582129a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -271,14 +271,22 @@ if (USE_SYSTEM_JSONCPP) endif () if (NOT JSONCPP_FOUND AND NOT DISABLE_BUNDLED_JSONCPP) - message(STATUS "Using embedded JsonCpp (not found or USE_SYSTEM_JSONCPP disabled)") + message(STATUS "Using embedded JsonCpp (not found or USE_SYSTEM_JSONCPP disabled)") if (NOT TARGET jsoncpp_lib) add_library(jsoncpp_lib INTERFACE) target_include_directories(jsoncpp_lib INTERFACE "${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp") - target_sources(jsoncpp_lib INTERFACE "${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp/jsoncpp.cpp") + target_sources(jsoncpp_lib INTERFACE "${PROJECT_SOURCE_DIR}/thirdparty/jsoncpp/jsoncpp.cpp") + # Because this satisfies the requirement, an installed JsonCpp is optional + set_package_properties(JsonCpp PROPERTIES TYPE OPTIONAL) endif () - add_feature_info("JsonCpp (embedded)" TRUE "JsonCpp will be compiled from the bundled sources") + add_feature_info("JsonCpp (embedded)" TRUE "JsonCpp will be compiled from the bundled sources") +endif () + +if (JSONCPP_FOUND) + # JsonCpp is actually required, even though we probe for it optionally + # (This tells feature_summary() to bail if it's not found, later) + set_package_properties(JsonCpp PROPERTIES TYPE REQUIRED) endif () # If we found any usable JsonCpp, use it. Otherwise, bail. @@ -286,10 +294,6 @@ if (TARGET jsoncpp_lib) target_link_libraries(openshot PUBLIC jsoncpp_lib) endif () -# JsonCpp is actually required, even though we probe for it optionally -# (This tells feature_summary() to bail if it's not found, later) -set_package_properties(JsonCpp PROPERTIES TYPE REQUIRED) - ############### LINK LIBRARY ################# SET ( REQUIRED_LIBRARIES ${LIBOPENSHOT_AUDIO_LIBRARIES}