aboutsummaryrefslogtreecommitdiff
path: root/modules/ECMPrintVariables.cmake
blob: f1ae479610f9f40feebcf5af59f86597123a9b7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# - Convenience macro for printing the values of cmake variables, useful e.g. while debugging.
#
# ECM_PRINT_VARIABLES(var1 var2 .. varN)
#
# This macro will print the name of each variable followed by its value.
# Example:
#   ecm_print_variables(CMAKE_C_COMPILER CMAKE_MAJOR_VERSION THIS_ONE_DOES_NOT_EXIST)
# Gives:
#   -- CMAKE_C_COMPILER="/usr/bin/gcc" ; CMAKE_MAJOR_VERSION="2" ; THIS_ONE_DOES_NOT_EXIST=""

# Copyright 2011 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.

function(ECM_PRINT_VARIABLES)
   set(msg "")
   foreach(var ${ARGN})
      if(msg)
         set(msg "${msg} ; ")
      endif()
      set(msg "${msg}${var}=\"${${var}}\"")
   endforeach()
   message(STATUS "${msg}")
endfunction()