summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-15 13:36:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-15 13:36:22 (GMT)
commit148a5c2d42059289f2af3376b844ba53b5e12f13 (patch)
treea0d0a9f1a8b8fc3bcf220b6653d9090627e7e2f9 /Tests
parent29e9b46ca5b50c6342b6e59ded8041cf1251094d (diff)
parentd3fd518c0316b15e4680c32808788935bf8c5c3d (diff)
downloadCMake-148a5c2d42059289f2af3376b844ba53b5e12f13.zip
CMake-148a5c2d42059289f2af3376b844ba53b5e12f13.tar.gz
CMake-148a5c2d42059289f2af3376b844ba53b5e12f13.tar.bz2
Merge topic 'bundle-exe-space-in-name'
d3fd518c03 find_program: Properly decode URL for bundle exe name with spaces Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4891
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/BundleSpaceInName.cmake8
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake4
3 files changed, 13 insertions, 0 deletions
diff --git a/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt
new file mode 100644
index 0000000..331d465
--- /dev/null
+++ b/Tests/RunCMake/find_program/BundleSpaceInName-stdout.txt
@@ -0,0 +1 @@
+-- FakeApp_EXECUTABLE='.*/Tests/RunCMake/find_program/BundleSpaceInName-build/Fake app.app/Contents/MacOS/Fake app'
diff --git a/Tests/RunCMake/find_program/BundleSpaceInName.cmake b/Tests/RunCMake/find_program/BundleSpaceInName.cmake
new file mode 100644
index 0000000..9152d5b
--- /dev/null
+++ b/Tests/RunCMake/find_program/BundleSpaceInName.cmake
@@ -0,0 +1,8 @@
+set(fakeApp "${CMAKE_CURRENT_BINARY_DIR}/Fake app.app/Contents/MacOS/Fake app")
+file(WRITE "${fakeApp}" "#!/bin/sh\n")
+execute_process(COMMAND chmod a+rx "${fakeApp}")
+
+find_program(FakeApp_EXECUTABLE NAMES "Fake app" NO_DEFAULT_PATH
+ PATHS "${CMAKE_CURRENT_BINARY_DIR}"
+)
+message(STATUS "FakeApp_EXECUTABLE='${FakeApp_EXECUTABLE}'")
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
index 2bb777b..0a732ee 100644
--- a/Tests/RunCMake/find_program/RunCMakeTest.cmake
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -20,3 +20,7 @@ else()
run_cmake(ExeNoRead)
endif()
endif()
+
+if(APPLE)
+ run_cmake(BundleSpaceInName)
+endif()