735
|
1 if (STATIC_BUILD OR NOT USE_SYSTEM_JSONCPP)
|
|
2 set(JSONCPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/jsoncpp-src-0.6.0-rc2)
|
|
3 DownloadPackage(
|
|
4 "363e2f4cbd3aeb63bf4e571f377400fb"
|
|
5 "http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/jsoncpp-src-0.6.0-rc2.tar.gz"
|
|
6 "${JSONCPP_SOURCES_DIR}")
|
|
7
|
|
8 list(APPEND THIRD_PARTY_SOURCES
|
|
9 ${JSONCPP_SOURCES_DIR}/src/lib_json/json_reader.cpp
|
|
10 ${JSONCPP_SOURCES_DIR}/src/lib_json/json_value.cpp
|
|
11 ${JSONCPP_SOURCES_DIR}/src/lib_json/json_writer.cpp
|
|
12 )
|
|
13
|
|
14 include_directories(
|
|
15 ${JSONCPP_SOURCES_DIR}/include
|
|
16 )
|
|
17
|
|
18 source_group(ThirdParty\\JsonCpp REGULAR_EXPRESSION ${JSONCPP_SOURCES_DIR}/.*)
|
|
19
|
|
20 else()
|
|
21 CHECK_INCLUDE_FILE_CXX(jsoncpp/json/reader.h HAVE_JSONCPP_H)
|
|
22 if (NOT HAVE_JSONCPP_H)
|
|
23 message(FATAL_ERROR "Please install the libjsoncpp-dev package")
|
|
24 endif()
|
|
25
|
1344
|
26 find_path(JSONCPP_INCLUDE_DIR json/reader.h
|
|
27 /usr/include/jsoncpp
|
|
28 /usr/local/include/jsoncpp
|
|
29 )
|
|
30
|
|
31 message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}")
|
|
32 include_directories(${JSONCPP_INCLUDE_DIR})
|
735
|
33 link_libraries(jsoncpp)
|
|
34
|
|
35 endif()
|