From 3727cb2f62bd4da9363be21fea37e392c0807fcc Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Sat, 23 Sep 2023 13:28:57 -0600 Subject: [PATCH] fix cmake syntax for finding credentials.cmake When building this project from another cmake project, I get an error even though I have credentials.cmake (this is on Debian Bookworm using cmake 3.25): CMake Warning at pico-w-webserver-example/CMakeLists.txt:24 (message): Credentials file not found, using default values! Per the cmake docs, `if EXISTS` requires full/absolute paths; relative paths do not have well-defined behavior: --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9856d5d..6dd59c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ set(PICO_SDK_FETCH_FROM_GIT on) include(cmake/pico_sdk_import.cmake) -if(EXISTS cmake/credentials.cmake) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/credentials.cmake) # copy it over from cmake/credentials.cmake.example include(cmake/credentials.cmake) else()