summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/CompileDefinitions/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt1
-rw-r--r--Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt3
-rw-r--r--Tests/RunCMake/CompileDefinitions/SetEmpty.cmake12
6 files changed, 23 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 7ff1889..607e799 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -143,6 +143,7 @@ add_RunCMake_test(Swift)
add_RunCMake_test(TargetObjects)
add_RunCMake_test(TargetSources)
add_RunCMake_test(find_dependency)
+add_RunCMake_test(CompileDefinitions)
add_RunCMake_test(CompileFeatures)
add_RunCMake_test(WriteCompilerDetectionHeader)
if(NOT WIN32)
diff --git a/Tests/RunCMake/CompileDefinitions/CMakeLists.txt b/Tests/RunCMake/CompileDefinitions/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake b/Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake
new file mode 100644
index 0000000..233fe34
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(SetEmpty)
diff --git a/Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt b/Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/SetEmpty-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt b/Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt
new file mode 100644
index 0000000..ace6656
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/SetEmpty-stderr.txt
@@ -0,0 +1,3 @@
+RESULT1=A;;B
+RESULT2=
+RESULT3=-DBAR
diff --git a/Tests/RunCMake/CompileDefinitions/SetEmpty.cmake b/Tests/RunCMake/CompileDefinitions/SetEmpty.cmake
new file mode 100644
index 0000000..15cb4e9
--- /dev/null
+++ b/Tests/RunCMake/CompileDefinitions/SetEmpty.cmake
@@ -0,0 +1,12 @@
+
+set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS A "" B)
+get_property(result DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+message("RESULT1=${result}")
+
+set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+get_property(result DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+message("RESULT2=${result}")
+
+set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS -DBAR)
+get_property(result DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+message("RESULT3=${result}")