Tests: Cover set_property for buildsystem directory properties

Extend the RunCMake.set_property test with cases covering buildsystem
directory properties:

* COMPILE_DEFINITIONS
* COMPILE_OPTIONS
* INCLUDE_DIRECTORIES

Also test a non-buildsystem property to document the equivalence
in behavior.
This commit is contained in:
Brad King 2015-09-02 16:38:19 -04:00 committed by Stephen Kelly
parent fb45c37160
commit ed258d606b
9 changed files with 22 additions and 0 deletions

View File

@ -1 +1,2 @@
-- Target COMPILE_DEFINITIONS is 'a;b;c;d;;e'
-- Directory COMPILE_DEFINITIONS is 'a;b;c;d;;e'

View File

@ -1,2 +1,3 @@
include(Common.cmake)
test_target_property(COMPILE_DEFINITIONS)
test_directory_property(COMPILE_DEFINITIONS)

View File

@ -1 +1,2 @@
-- Target COMPILE_OPTIONS is 'a;b;c;d;;e'
-- Directory COMPILE_OPTIONS is 'a;b;c;d;;e'

View File

@ -1,2 +1,3 @@
include(Common.cmake)
test_target_property(COMPILE_OPTIONS)
test_directory_property(COMPILE_OPTIONS)

View File

@ -12,3 +12,17 @@ macro(test_target_property PROP)
message(STATUS "Target ${PROP} is '${val}'")
set_property(TARGET CustomTarget PROPERTY ${PROP})
endmacro()
macro(test_directory_property PROP)
set_property(DIRECTORY PROPERTY ${PROP} x)
set_property(DIRECTORY PROPERTY ${PROP})
set_property(DIRECTORY APPEND PROPERTY ${PROP})
set_property(DIRECTORY PROPERTY ${PROP} a)
set_property(DIRECTORY APPEND PROPERTY ${PROP} "")
set_property(DIRECTORY APPEND PROPERTY ${PROP} b c)
set_property(DIRECTORY APPEND PROPERTY ${PROP})
set_property(DIRECTORY APPEND PROPERTY ${PROP} "d;;e")
get_property(val DIRECTORY PROPERTY ${PROP})
message(STATUS "Directory ${PROP} is '${val}'")
set_property(DIRECTORY PROPERTY ${PROP})
endmacro()

View File

@ -1 +1,2 @@
-- Target INCLUDE_DIRECTORIES is 'a;b;c;d;;e'
-- Directory INCLUDE_DIRECTORIES is 'a;b;c;d;;e'

View File

@ -1,2 +1,3 @@
include(Common.cmake)
test_target_property(INCLUDE_DIRECTORIES)
test_directory_property(INCLUDE_DIRECTORIES)

View File

@ -1 +1,2 @@
-- Target USER_PROP is 'a;b;c;d;;e'
-- Directory USER_PROP is 'a;b;c;d;;e'

View File

@ -1,2 +1,3 @@
include(Common.cmake)
test_target_property(USER_PROP)
test_directory_property(USER_PROP)