Skip to content

Commit

Permalink
Merge pull request #2027 from madhat1/bugfix/fix_cjson_cmake
Browse files Browse the repository at this point in the history
Fix cmake not building correctly when WITH_CJSON=OFF
  • Loading branch information
ralight committed Jan 19, 2021
2 parents e2ebddf + c16514c commit e6aa1e8
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
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 e6aa1e8

Please sign in to comment.