CompileDefinitions: Add unit test for setting empty content.

This commit is contained in:
Stephen Kelly 2015-07-21 22:52:44 +02:00
parent 8d336875b3
commit c1bf1a59ff
6 changed files with 23 additions and 0 deletions

View File

@ -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)

View File

@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.3)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)

View File

@ -0,0 +1,3 @@
include(RunCMake)
run_cmake(SetEmpty)

View File

@ -0,0 +1 @@
0

View File

@ -0,0 +1,3 @@
RESULT1=A;;B
RESULT2=
RESULT3=-DBAR

View File

@ -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}")