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.
This commit is contained in:
parent
fcc9287897
commit
4959f3413c
|
@ -60,6 +60,11 @@ cmSourceFileLocation
|
||||||
this->AmbiguousDirectory = !cmSystemTools::FileIsFullPath(name.c_str());
|
this->AmbiguousDirectory = !cmSystemTools::FileIsFullPath(name.c_str());
|
||||||
this->AmbiguousExtension = true;
|
this->AmbiguousExtension = true;
|
||||||
this->Directory = cmSystemTools::GetFilenamePath(name);
|
this->Directory = cmSystemTools::GetFilenamePath(name);
|
||||||
|
if (cmSystemTools::FileIsFullPath(this->Directory.c_str()))
|
||||||
|
{
|
||||||
|
this->Directory
|
||||||
|
= cmSystemTools::CollapseFullPath(this->Directory.c_str());
|
||||||
|
}
|
||||||
this->Name = cmSystemTools::GetFilenameName(name);
|
this->Name = cmSystemTools::GetFilenameName(name);
|
||||||
this->UpdateExtension(name);
|
this->UpdateExtension(name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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 ADVANCED "${expect_ADVANCED}")
|
||||||
set_property(CACHE SOME_ENTRY PROPERTY STRINGS "${expect_STRINGS}")
|
set_property(CACHE SOME_ENTRY PROPERTY STRINGS "${expect_STRINGS}")
|
||||||
check_cache_props()
|
check_cache_props()
|
||||||
|
|
||||||
|
add_subdirectory(SubDir2)
|
||||||
|
|
|
@ -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")
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
#ifndef SUBDIR_TEST
|
||||||
|
#error Expected SUBDIR_TEST
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int main(int, char**)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue