1
0
mirror of https://github.com/raspberrypi/pico-sdk.git synced 2025-08-07 17:02:52 +03:00

Prevent the literal string DEBUG from being appended to some messages in CMake < 3.15 (#433)

Fixes issue #422
This commit is contained in:
Jonathan Reichelt Gjertsen
2021-05-26 00:10:55 +02:00
committed by GitHub
parent 6994a3858d
commit a531123080
4 changed files with 15 additions and 6 deletions

View File

@@ -18,6 +18,15 @@ if (NOT TARGET _pico_sdk_pre_init_marker)
endif()
endfunction()
function(pico_message_debug MESSAGE)
# The log-level system was added in CMake 3.15.
if(${CMAKE_VERSION} VERSION_LESS "3.15.0")
message(${MESSAGE})
else()
message(DEBUG ${MESSAGE})
endif()
endfunction()
if (NOT PICO_SDK_PATH)
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR})
endif ()
@@ -49,14 +58,14 @@ if (NOT TARGET _pico_sdk_pre_init_marker)
macro(add_sub_list_dirs var)
foreach(LIST_DIR IN LISTS ${var})
get_filename_component(SHORT_NAME "${LIST_DIR}" NAME)
message(DEBUG "Including custom CMakeLists.txt ${SHORT_NAME}")
pico_message_debug("Including custom CMakeLists.txt ${SHORT_NAME}")
add_subdirectory(${LIST_DIR} ${SHORT_NAME})
endforeach()
endmacro()
macro(add_sub_list_files var)
foreach(LIST_FILE IN LISTS ${var})
message(DEBUG "Including custom CMake file ${LIST_FILE}")
pico_message_debug("Including custom CMake file ${LIST_FILE}")
include(${LIST_FILE})
endforeach()
endmacro()