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:
@@ -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})
|
||||
|
||||
Reference in New Issue
Block a user