1- cmake_minimum_required (VERSION 3.10.2)
2-
3- if (${CMAKE_VERSION} VERSION_LESS 3.11)
4- cmake_policy (VERSION ${CMAKE_MAJOR_VERSION} .${CMAKE_MINOR_VERSION} )
5- else ()
6- cmake_policy (VERSION 3.11)
7- endif ()
1+ cmake_minimum_required (VERSION 3.10.2...3.28)
82
93# Add cmake dir to module path, so Find*.cmake can be found
104set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR} /cmake" ${CMAKE_MODULE_PATH} )
@@ -27,11 +21,12 @@ option(hueplusplus_NO_EXTERNAL_LIBRARIES "Do not try to use external libraries"
2721
2822# Try to find installed packages
2923if (NOT hueplusplus_NO_EXTERNAL_LIBRARIES)
30- find_package (MbedTLS)
31- find_package (nlohmann_json)
24+ # Suppress warnings if libraries are not found, they will be built from submodules
25+ find_package (MbedTLS QUIET )
26+ find_package (nlohmann_json QUIET )
3227endif ()
3328
34- set (NEED_SUBMODULES NOT (${mbedtls_FOUND } AND ${nlohmann_json_FOUND} ))
29+ set (NEED_SUBMODULES NOT (${MbedTLS_FOUND } AND ${nlohmann_json_FOUND} ))
3530
3631option (CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF )
3732find_program (CLANG_TIDY_EXE NAMES "clang-tidy" DOC "Path to clang-tidy executable" )
@@ -92,8 +87,9 @@ if (1 AND APPLE)
9287 set (CMAKE_MACOSX_RPATH 1)
9388endif ()
9489
95- if (NOT mbedtls_FOUND )
90+ if (NOT MbedTLS_FOUND )
9691 # Build mbedtls if not installed
92+ message (STATUS "MbedTLS was not found, the submodule is used." )
9793 set (USE_STATIC_MBEDTLS_LIBRARY ON )
9894 set (USE_SHARED_MBEDTLS_LIBRARY OFF )
9995 add_subdirectory ("lib/mbedtls" EXCLUDE_FROM_ALL )
@@ -112,6 +108,7 @@ endif()
112108
113109if (NOT nlohmann_json_FOUND)
114110 # Use embedded json
111+ message (STATUS "nlohmann_json was not found, the submodule is used." )
115112 # disable tests for json
116113 set (JSON_BuildTests OFF CACHE INTERNAL "" )
117114 add_subdirectory ("lib/json" EXCLUDE_FROM_ALL )
0 commit comments