summaryrefslogtreecommitdiffstats
path: root/Tests/Properties/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Properties/CMakeLists.txt')
-rw-r--r--Tests/Properties/CMakeLists.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt
index 162a178..a1158c6 100644
--- a/Tests/Properties/CMakeLists.txt
+++ b/Tests/Properties/CMakeLists.txt
@@ -165,6 +165,34 @@ add_library(maindirtest SHARED)
generate_file_for_set_property_test(32 maindirtest)
generate_file_for_set_property_test(33 maindirtest)
+# Set/get properties by binary directory path.
+add_subdirectory(SubDir SubDirA)
+get_property(dir_prop_top DIRECTORY PROPERTY dir_prop_top)
+if(NOT dir_prop_top STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirA")
+ message(SEND_ERROR "dir_prop_top unexpected value after SubDirA:\n ${dir_prop_top}")
+endif()
+add_subdirectory(SubDir SubDirB)
+get_property(dir_prop_top DIRECTORY PROPERTY dir_prop_top)
+if(NOT dir_prop_top STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirB")
+ message(SEND_ERROR "dir_prop_top unexpected value after SubDirB:\n ${dir_prop_top}")
+endif()
+get_property(dir_prop_subA DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirA PROPERTY dir_prop_sub)
+if(NOT dir_prop_subA STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirA")
+ message(SEND_ERROR "SubDirA property dir_prop_sub incorrect:\n ${dir_prop_subA}")
+endif()
+get_property(dir_prop_subB DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirB PROPERTY dir_prop_sub)
+if(NOT dir_prop_subB STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirB")
+ message(SEND_ERROR "SubDirB property dir_prop_sub incorrect:\n ${dir_prop_subB}")
+endif()
+get_directory_property(dir_prop_subA DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirA dir_prop_sub)
+if(NOT dir_prop_subA STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirA")
+ message(SEND_ERROR "SubDirA property dir_prop_sub incorrect:\n ${dir_prop_subA}")
+endif()
+get_directory_property(dir_prop_subB DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/SubDirB dir_prop_sub)
+if(NOT dir_prop_subB STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/SubDirB")
+ message(SEND_ERROR "SubDirB property dir_prop_sub incorrect:\n ${dir_prop_subB}")
+endif()
+
add_subdirectory(SubDir2)
set(src_prefix "${CMAKE_CURRENT_BINARY_DIR}/SubDir2/")