summaryrefslogtreecommitdiffstats
path: root/Tests/Complex/Executable
diff options
context:
space:
mode:
authorSylvain Joubert <joubert.sy@gmail.com>2017-07-04 10:00:02 (GMT)
committerSylvain Joubert <joubert.sy@gmail.com>2017-07-04 10:00:02 (GMT)
commit58f47448210bf3fd3121bf91f74eb893ba9d034c (patch)
tree9b4a81430dda42f630fb03351332b4551aafde24 /Tests/Complex/Executable
parent74112c8da16ea5f2a4940d196d178da684626f92 (diff)
downloadCMake-58f47448210bf3fd3121bf91f74eb893ba9d034c.zip
CMake-58f47448210bf3fd3121bf91f74eb893ba9d034c.tar.gz
CMake-58f47448210bf3fd3121bf91f74eb893ba9d034c.tar.bz2
configure_file: Add support for indented cmakedefine
Optional spaces and/or tabs are now understood between the '#' character and the 'cmakedefine'/'cmakedefine01' words. This indentation is preserved in the output lines. Fixes: #13037
Diffstat (limited to 'Tests/Complex/Executable')
-rw-r--r--Tests/Complex/Executable/complex.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx
index 3b09229..ca39870 100644
--- a/Tests/Complex/Executable/complex.cxx
+++ b/Tests/Complex/Executable/complex.cxx
@@ -261,6 +261,12 @@ int main()
cmPassed("ONE_VAR is defined.");
#endif
+#ifndef ONE_VAR_AND_INDENTED
+ cmFailed("cmakedefine is broken, ONE_VAR_AND_INDENTED is not defined.");
+#else
+ cmPassed("ONE_VAR_AND_INDENTED is defined.");
+#endif
+
#ifndef ONE_VAR_IS_DEFINED
cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, "
"ONE_VAR_IS_DEFINED is not defined.");
@@ -274,6 +280,12 @@ int main()
cmPassed("ZERO_VAR is not defined.");
#endif
+#ifdef ZERO_VAR_AND_INDENTED
+ cmFailed("cmakedefine is broken, ZERO_VAR_AND_INDENTED is defined.");
+#else
+ cmPassed("ZERO_VAR_AND_INDENTED is not defined.");
+#endif
+
#ifndef STRING_VAR
cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined.");
#else
@@ -1030,6 +1042,16 @@ int main()
} else {
cmFailed("cmakedefine01 is not working for 1");
}
+ if (SHOULD_BE_ZERO_AND_INDENTED == 0) {
+ cmPassed("cmakedefine01 is working for 0 and indented");
+ } else {
+ cmFailed("cmakedefine01 is not working for 0 and indented");
+ }
+ if (SHOULD_BE_ONE_AND_INDENTED == 1) {
+ cmPassed("cmakedefine01 is working for 1 and indented");
+ } else {
+ cmFailed("cmakedefine01 is not working for 1 and indented");
+ }
#ifdef FORCE_TEST
cmFailed("CMake SET CACHE FORCE");
#else