summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-03-27 21:56:36 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-03-31 21:18:43 (GMT)
commit4959f3413c83f38dd222dced11d7a3933e145ae4 (patch)
treeebf654540e8324b215b6e5c88df9635e33d4420b /Tests
parentfcc9287897dd9b378c2f87329346c2f23becd54f (diff)
downloadCMake-4959f3413c83f38dd222dced11d7a3933e145ae4.zip
CMake-4959f3413c83f38dd222dced11d7a3933e145ae4.tar.gz
CMake-4959f3413c83f38dd222dced11d7a3933e145ae4.tar.bz2
cmSourceFileLocation: Collapse full path for directory comparisons.
Otherwise Matches() ends up doing a comparison of the directories /path/to/dir/subdir/.. and /path/to/dir as strings and not matching where it should.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/Properties/CMakeLists.txt2
-rw-r--r--Tests/Properties/SubDir2/CMakeLists.txt5
-rw-r--r--Tests/Properties/subdirtest.cxx9
3 files changed, 16 insertions, 0 deletions
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt
index 285d596..11fca45 100644
--- a/Tests/Properties/CMakeLists.txt
+++ b/Tests/Properties/CMakeLists.txt
@@ -143,3 +143,5 @@ set_property(CACHE SOME_ENTRY PROPERTY VALUE "${expect_VALUE}")
set_property(CACHE SOME_ENTRY PROPERTY ADVANCED "${expect_ADVANCED}")
set_property(CACHE SOME_ENTRY PROPERTY STRINGS "${expect_STRINGS}")
check_cache_props()
+
+add_subdirectory(SubDir2)
diff --git a/Tests/Properties/SubDir2/CMakeLists.txt b/Tests/Properties/SubDir2/CMakeLists.txt
new file mode 100644
index 0000000..377dc83
--- /dev/null
+++ b/Tests/Properties/SubDir2/CMakeLists.txt
@@ -0,0 +1,5 @@
+
+set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx"
+ PROPERTIES COMPILE_DEFINITIONS SUBDIR_TEST)
+
+add_executable(subdirtest "${CMAKE_CURRENT_SOURCE_DIR}/../subdirtest.cxx")
diff --git a/Tests/Properties/subdirtest.cxx b/Tests/Properties/subdirtest.cxx
new file mode 100644
index 0000000..02d8f3d
--- /dev/null
+++ b/Tests/Properties/subdirtest.cxx
@@ -0,0 +1,9 @@
+
+#ifndef SUBDIR_TEST
+#error Expected SUBDIR_TEST
+#endif
+
+int main(int, char**)
+{
+ return 0;
+}