Skip to content

Commit

Permalink
perform cjson discovery only if WITH_CJSON=ON
Browse files Browse the repository at this point in the history
When using cmake to build the project, cJson discovery
should only be performed if WITH_CJSON=ON.

Closes eclipse#2026.

Signed-off-by: Boris Feinstein <[email protected]>
  • Loading branch information
madhat1 committed Jan 17, 2021
1 parent e2ebddf commit c16514c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Expand Up @@ -99,12 +99,14 @@ if (WITH_DLT)
add_definitions("-DWITH_DLT")
endif (WITH_DLT)

FIND_PACKAGE(cJSON)
if (CJSON_FOUND)
message(STATUS ${CJSON_FOUND})
else (CJSON_FOUND)
message(STATUS "Optional dependency cJSON not found. Some features will be disabled.")
endif(CJSON_FOUND)
if (WITH_CJSON)
FIND_PACKAGE(cJSON)
if (CJSON_FOUND)
message(STATUS ${CJSON_FOUND})
else (CJSON_FOUND)
message(STATUS "Optional dependency cJSON not found. Some features will be disabled.")
endif(CJSON_FOUND)
endif()

# ========================================
# Include projects
Expand Down

0 comments on commit c16514c

Please sign in to comment.