summaryrefslogtreecommitdiff
blob: 95546b6daaa256665d50f6815fe95ca3f43b5685 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From c95a70bfeae25ba11fbe50fe759a6cdb29388e44 Mon Sep 17 00:00:00 2001
From: Milan Crha <mcrha@redhat.com>
Date: Wed, 14 Apr 2021 16:58:08 +0200
Subject: [PATCH] PrintableOptions.cmake: Correct variable name comparison

CMake 3.20.1 errors out with:

CMake Error at cmake/modules/PrintableOptions.cmake:38 (message):
   variable name cannot be empty
 Call Stack (most recent call first):
   CMakeLists.txt:152 (add_printable_variable)

Change how the parameter value is compared, to fix it.
---
 cmake/modules/PrintableOptions.cmake | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/cmake/modules/PrintableOptions.cmake b/cmake/modules/PrintableOptions.cmake
index ba1c9d0b7..339f1da4b 100644
--- a/cmake/modules/PrintableOptions.cmake
+++ b/cmake/modules/PrintableOptions.cmake
@@ -19,40 +19,40 @@
 #    prints all the build options previously added with the above functions
 
 macro(add_printable_variable_bare _name)
-	if(_name STREQUAL "")
+	if("${_name}" STREQUAL "")
 		message(FATAL_ERROR "variable name cannot be empty")
-	endif(_name STREQUAL "")
+	endif("${_name}" STREQUAL "")
 	list(APPEND _printable_options ${_name})
 endmacro()
 
 macro(add_printable_option _name _description _default_value)
-	if(_name STREQUAL "")
+	if("${_name}" STREQUAL "")
 		message(FATAL_ERROR "option name cannot be empty")
-	endif(_name STREQUAL "")
+	endif("${_name}" STREQUAL "")
 	option(${_name} ${_description} ${_default_value})
 	add_printable_variable_bare(${_name})
 endmacro()
 
 macro(add_printable_variable _name _description _default_value)
-	if(_name STREQUAL "")
+	if("${_name}" STREQUAL "")
 		message(FATAL_ERROR "variable name cannot be empty")
-	endif(_name STREQUAL "")
+	endif("${_name}" STREQUAL "")
 	set(${_name} ${_default_value} CACHE STRING ${_description})
 	add_printable_variable_bare(${_name})
 endmacro()
 
 macro(add_printable_variable_path _name _description _default_value)
-	if(_name STREQUAL "")
+	if("${_name}" STREQUAL "")
 		message(FATAL_ERROR "path variable name cannot be empty")
-	endif(_name STREQUAL "")
+	endif("${_name}" STREQUAL "")
 	set(${_name} ${_default_value} CACHE PATH ${_description})
 	add_printable_variable_bare(${_name})
 endmacro()
 
 macro(add_printable_variable_filepath _name _description _default_value)
-	if(_name STREQUAL "")
+	if("${_name}" STREQUAL "")
 		message(FATAL_ERROR "filepath variable name cannot be empty")
-	endif(_name STREQUAL "")
+	endif("${_name}" STREQUAL "")
 	set(${_name} ${_default_value} CACHE FILEPATH ${_description})
 	add_printable_variable_bare(${_name})
 endmacro()
-- 
2.26.3