File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -187,10 +187,19 @@ if(TARGET std::filesystem)
187187 endif ()
188188endif ()
189189
190-
191190# jsoncpp
192- find_package (Jsoncpp REQUIRED )
193- target_link_libraries (${PROJECT_NAME } PUBLIC Jsoncpp_lib )
191+ find_package (jsoncpp QUIET CONFIG )
192+ if (jsoncpp_FOUND)
193+ message (STATUS "jsoncpp found by config" )
194+ if (USE_STATIC_LIBS_ONLY)
195+ target_link_libraries (${PROJECT_NAME } PUBLIC jsoncpp_static )
196+ else ()
197+ target_link_libraries (${PROJECT_NAME } PUBLIC jsoncpp_lib )
198+ endif ()
199+ else ()
200+ find_package (Jsoncpp REQUIRED MODULE )
201+ target_link_libraries (${PROJECT_NAME } PUBLIC Jsoncpp_lib )
202+ endif ()
194203list (APPEND INCLUDE_DIRS_FOR_DYNAMIC_VIEW ${JSONCPP_INCLUDE_DIRS} )
195204
196205# yamlcpp
Original file line number Diff line number Diff line change 1212include (CMakeFindDependencyMacro )
1313list (APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR } )
1414
15- find_dependency (Jsoncpp REQUIRED )
15+ find_package (jsoncpp QUIET CONFIG )
16+ if (NOT jsoncpp_FOUND)
17+ find_dependency (Jsoncpp MODULE REQUIRED )
18+ endif ()
19+
1620find_dependency (Trantor REQUIRED )
1721if (NOT ${CMAKE_SYSTEM_NAME } STREQUAL "FreeBSD" AND NOT ${CMAKE_SYSTEM_NAME } STREQUAL "OpenBSD" AND NOT WIN32 )
1822find_dependency (UUID REQUIRED )
You can’t perform that action at this time.
0 commit comments