summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/find_path
diff options
context:
space:
mode:
authorHarry Mallon <harry@codexdigital.com>2016-05-25 17:18:47 (GMT)
committerBrad King <brad.king@kitware.com>2016-06-07 13:04:35 (GMT)
commit188baef00c3b19c6ee6ed8c3735817bae50f110e (patch)
tree420aad8b892720ef8049ea18493f39c3f73330c9 /Tests/RunCMake/find_path
parenteeac8430bf014b4813f2326c9824acacdc0ea49a (diff)
downloadCMake-188baef00c3b19c6ee6ed8c3735817bae50f110e.zip
CMake-188baef00c3b19c6ee6ed8c3735817bae50f110e.tar.gz
CMake-188baef00c3b19c6ee6ed8c3735817bae50f110e.tar.bz2
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.
Diffstat (limited to 'Tests/RunCMake/find_path')
-rw-r--r--Tests/RunCMake/find_path/Frameworks/Foo.framework/Headers/Some/Dir/Header.h0
-rw-r--r--Tests/RunCMake/find_path/FrameworksWithSubdirs-stdout.txt1
-rw-r--r--Tests/RunCMake/find_path/FrameworksWithSubdirs.cmake3
-rw-r--r--Tests/RunCMake/find_path/RunCMakeTest.cmake4
4 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_path/Frameworks/Foo.framework/Headers/Some/Dir/Header.h b/Tests/RunCMake/find_path/Frameworks/Foo.framework/Headers/Some/Dir/Header.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_path/Frameworks/Foo.framework/Headers/Some/Dir/Header.h
diff --git a/Tests/RunCMake/find_path/FrameworksWithSubdirs-stdout.txt b/Tests/RunCMake/find_path/FrameworksWithSubdirs-stdout.txt
new file mode 100644
index 0000000..001a3e9
--- /dev/null
+++ b/Tests/RunCMake/find_path/FrameworksWithSubdirs-stdout.txt
@@ -0,0 +1 @@
+-- SOME_INCLUDE_DIR='[^']*Tests/RunCMake/find_path/Frameworks/Foo.framework/Headers'
diff --git a/Tests/RunCMake/find_path/FrameworksWithSubdirs.cmake b/Tests/RunCMake/find_path/FrameworksWithSubdirs.cmake
new file mode 100644
index 0000000..b286021
--- /dev/null
+++ b/Tests/RunCMake/find_path/FrameworksWithSubdirs.cmake
@@ -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}'")
diff --git a/Tests/RunCMake/find_path/RunCMakeTest.cmake b/Tests/RunCMake/find_path/RunCMakeTest.cmake
index 5ce96e0..bf0fa89 100644
--- a/Tests/RunCMake/find_path/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_path/RunCMakeTest.cmake
@@ -3,3 +3,7 @@ include(RunCMake)
if(WIN32 OR CYGWIN)
run_cmake(PrefixInPATH)
endif()
+
+if(APPLE)
+ run_cmake(FrameworksWithSubdirs)
+endif()