Skip to content
Snippets Groups Projects
Commit 5a049f89 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

cmake: find Jsoncpp using pkgconfig

parent 65e88f2f
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ if (NOT OPENDHT_ARGON2)
endif ()
if (OPENDHT_PROXY_SERVER OR OPENDHT_PROXY_CLIENT)
find_package(Restbed REQUIRED)
find_package(Jsoncpp REQUIRED)
pkg_search_module(Jsoncpp jsoncpp)
endif()
# Build flags
......@@ -84,10 +84,14 @@ endif ()
if (Nettle_INCLUDE_DIRS)
include_directories (SYSTEM "${Nettle_INCLUDE_DIRS}")
endif ()
if (RESTBED_INCLUDE)
include_directories (SYSTEM "${RESTBED_INCLUDE}")
endif ()
if (Jsoncpp_INCLUDE_DIRS)
include_directories (SYSTEM "${Jsoncpp_INCLUDE_DIRS}")
endif ()
link_directories (${Nettle_LIBRARY_DIRS})
link_directories (${Jsoncpp_LIBRARY_DIRS})
include_directories (
./
include/
......
find_path (JSONCPP_INCLUDE jsoncpp
HINTS
"/usr/include"
"/usr/local/include"
"/opt/local/include"
)
if (JSONCPP_INCLUDE)
message(STATUS "${green}Found Jsoncpp: ${JSONCPP_INCLUDE}")
else()
message(FATAL_ERROR "${red}Failed to locate Jsoncpp.}")
endif()
if (JSONCPP_INCLUDE)
set(JSONCPP_FOUND TRUE)
set(Jsoncpp_LIBRARIES jsoncpp)
set(Jsoncpp_INCLUDE_DIRS ${JSONCPP_INCLUDE}/jsoncpp)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment