# HG changeset patch # User jodogne # Date 1433166050 -7200 # Node ID dae2e28951c643f86503b132054e7bfa625d0fd4 # Parent 8a330b2584910a31f559c86bf89ec1c754a9ffba fix freebsd build diff -r 8a330b258491 -r dae2e28951c6 Plugins/Samples/Common/OrthancPlugins.cmake --- a/Plugins/Samples/Common/OrthancPlugins.cmake Mon Jun 01 14:16:43 2015 +0200 +++ b/Plugins/Samples/Common/OrthancPlugins.cmake Mon Jun 01 15:40:50 2015 +0200 @@ -1,4 +1,5 @@ include(CheckLibraryExists) +include(${ORTHANC_ROOT}/Resources/CMake/Compiler.cmake) if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") diff -r 8a330b258491 -r dae2e28951c6 Resources/CMake/Compiler.cmake --- a/Resources/CMake/Compiler.cmake Mon Jun 01 14:16:43 2015 +0200 +++ b/Resources/CMake/Compiler.cmake Mon Jun 01 15:40:50 2015 +0200 @@ -101,7 +101,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") # In FreeBSD, the "/usr/local/" folder contains the ports and need to be imported SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include") - SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include -I/usr/local/include/jsoncpp") + SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L/usr/local/lib") endif() diff -r 8a330b258491 -r dae2e28951c6 Resources/CMake/JsonCppConfiguration.cmake --- a/Resources/CMake/JsonCppConfiguration.cmake Mon Jun 01 14:16:43 2015 +0200 +++ b/Resources/CMake/JsonCppConfiguration.cmake Mon Jun 01 15:40:50 2015 +0200 @@ -18,11 +18,6 @@ source_group(ThirdParty\\JsonCpp REGULAR_EXPRESSION ${JSONCPP_SOURCES_DIR}/.*) else() - CHECK_INCLUDE_FILE_CXX(jsoncpp/json/reader.h HAVE_JSONCPP_H) - if (NOT HAVE_JSONCPP_H) - message(FATAL_ERROR "Please install the libjsoncpp-dev package") - endif() - find_path(JSONCPP_INCLUDE_DIR json/reader.h /usr/include/jsoncpp /usr/local/include/jsoncpp @@ -32,4 +27,9 @@ include_directories(${JSONCPP_INCLUDE_DIR}) link_libraries(jsoncpp) + CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H) + if (NOT HAVE_JSONCPP_H) + message(FATAL_ERROR "Please install the libjsoncpp-dev package") + endif() + endif()