Skip to content

Commit

Permalink
Fix cmake build when cjson not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
ralight committed Dec 2, 2020
1 parent 8f0bdd5 commit 550c547
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ endif (WITH_DLT)
FIND_PACKAGE(cJSON)
if (CJSON_FOUND)
message(STATUS ${CJSON_FOUND})
add_definitions("-DWITH_CJSON")
else (CJSON_FOUND)
message(STATUS "Optional dependency cJSON not found. Some features will be disabled.")
endif(CJSON_FOUND)
Expand Down
1 change: 1 addition & 0 deletions apps/mosquitto_ctrl/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if (WITH_TLS AND CJSON_FOUND)
add_definitions("-DWITH_CJSON")

include_directories(${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/include
${mosquitto_SOURCE_DIR}/lib ${mosquitto_SOURCE_DIR}/src
Expand Down
1 change: 1 addition & 0 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set( CLIENT_INC ${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/include
set( CLIENT_DIR ${mosquitto_BINARY_DIR}/lib)

if (CJSON_FOUND)
add_definitions("-DWITH_CJSON")
set( CLIENT_DIR "${CLIENT_DIR} ${CJSON_DIR}" )
set( CLIENT_INC "${CLIENT_INC};${CJSON_INCLUDE_DIRS}" )
endif()
Expand Down
2 changes: 2 additions & 0 deletions plugins/dynamic-security/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
if (CJSON_FOUND AND WITH_TLS)
add_definitions("-DWITH_CJSON")

set( CLIENT_INC ${mosquitto_SOURCE_DIR} ${mosquitto_SOURCE_DIR}/include
${STDBOOL_H_PATH} ${STDINT_H_PATH} ${PTHREAD_INCLUDE_DIR}
${OPENSSL_INCLUDE_DIR} ${mosquitto_SOURCE_DIR}/deps
Expand Down

0 comments on commit 550c547

Please sign in to comment.