Support externally installed cJSON.

Using an external cJSON installed under /usr/include was not possible before
as the cJSON headers within opm were still used due to relative paths.
With this commit move the copied cJSON source to external/cjson and
thus prevent them to be found if an externally installed cJSON is there.
This commit is contained in:
Markus Blatt
2016-11-02 19:29:01 +01:00
parent 49a6166340
commit e20f521151
5 changed files with 3 additions and 2 deletions

View File

@@ -1,8 +1,9 @@
set( json_source JsonObject.cpp )
set( json_headers JsonObject.hpp )
if (NOT HAVE_CJSON)
list(APPEND json_source cjson/cJSON.c)
set( CJSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
list(APPEND json_source ${PROJECT_SOURCE_DIR}/external/cjson/cJSON.c)
set( CJSON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/external )
include_directories(${CJSON_INCLUDE_DIR})
set(CJSON_LIBRARY "")
endif()
add_library(opmjson ${json_source})