1if(NOT trout_JSONCPP_ROOT_DIR) 2 set(trout_JSONCPP_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/jsoncpp) 3endif() 4 5if(EXISTS "${trout_JSONCPP_ROOT_DIR}/CMakeLists.txt") 6 set(trout_JSONCPP_INCLUDE_DIRS "${trout_JSONCPP_ROOT_DIR}/include") 7 set(trout_JSONCPP_LIBRARIES "jsoncpp_static") 8 if (NOT TARGET ${trout_JSONCPP_LIBRARIES}) 9 add_subdirectory(${trout_JSONCPP_ROOT_DIR} third_party/jsoncpp) 10 endif() 11else() 12 message(FATAL_ERROR "${trout_JSONCPP_ROOT_DIR}/CMakeLists.txt not found") 13endif() 14