find_path: Fix location of <dir/header.h> in a framework on OS X
After finding it in `foo.Framework/Headers/dir/header.h`, we should report the `foo.Framework/Headers` directory, not `foo.Framework/Headers/dir`, because the former is what actually contains the path the caller wishes to include.
This commit is contained in:
parent
eeac8430bf
commit
188baef00c
|
@ -117,7 +117,7 @@ std::string cmFindPathCommand::FindHeaderInFramework(std::string const& file,
|
||||||
if (this->IncludeFileInPath) {
|
if (this->IncludeFileInPath) {
|
||||||
return fheader;
|
return fheader;
|
||||||
}
|
}
|
||||||
fheader = cmSystemTools::GetFilenamePath(fheader);
|
fheader.resize(fheader.size() - file.size());
|
||||||
return fheader;
|
return fheader;
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
-- SOME_INCLUDE_DIR='[^']*Tests/RunCMake/find_path/Frameworks/Foo.framework/Headers'
|
|
@ -0,0 +1,3 @@
|
||||||
|
set(CMAKE_FRAMEWORK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Frameworks")
|
||||||
|
find_path(SOME_INCLUDE_DIR "Some/Dir/Header.h")
|
||||||
|
message(STATUS "SOME_INCLUDE_DIR='${SOME_INCLUDE_DIR}'")
|
|
@ -3,3 +3,7 @@ include(RunCMake)
|
||||||
if(WIN32 OR CYGWIN)
|
if(WIN32 OR CYGWIN)
|
||||||
run_cmake(PrefixInPATH)
|
run_cmake(PrefixInPATH)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
run_cmake(FrameworksWithSubdirs)
|
||||||
|
endif()
|
||||||
|
|
Loading…
Reference in New Issue