]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: add debug function to dump all variables
authorViktor Szakats <commit@vsz.me>
Wed, 7 Aug 2024 12:46:17 +0000 (14:46 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 7 Aug 2024 13:10:52 +0000 (15:10 +0200)
Place a `curl_dumpvars()` call anywhere in the CMake code to use it.

Closes #14439

CMakeLists.txt

index 7427516898574fd62341552733063675fb3be23e..03038a9eeb2be9292cabe2b37fdfb2a1db404e09 100644 (file)
@@ -82,6 +82,13 @@ endif()
 message(STATUS "CMake platform flags:${_flags}")
 set(_flags)
 
+function(curl_dumpvars)  # Dump all defined variables with their values
+  get_cmake_property(_vars VARIABLES)
+  foreach(_var ${_vars})
+    message("${_var} = ${${_var}}")
+  endforeach()
+endfunction()
+
 file(STRINGS ${CURL_SOURCE_DIR}/include/curl/curlver.h _curl_version_h_contents REGEX "#define LIBCURL_VERSION( |_NUM )")
 string(REGEX MATCH "#define LIBCURL_VERSION \"[^\"]*"
   CURL_VERSION ${_curl_version_h_contents})