summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-09-08 14:24:36 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-09-08 14:24:36 (GMT)
commit4da3315db365f3c80ce5202047955f0f2ec9312f (patch)
tree0446f74abab8d3a7a15996e27747d45f1a884c05 /Tests
parent20b7e79d211589eed2668474966e77d00025eb37 (diff)
parent8ea7611bc3650c75c86d22a3127cb117dbcaa9be (diff)
downloadCMake-4da3315db365f3c80ce5202047955f0f2ec9312f.zip
CMake-4da3315db365f3c80ce5202047955f0f2ec9312f.tar.gz
CMake-4da3315db365f3c80ce5202047955f0f2ec9312f.tar.bz2
Merge topic 'find_program-NAMES_PER_DIR'
8ea7611b find_program: Optionally consider all names in each directory fc1990c9 cmFindProgramCommand: Re-implement search using more flexible approach fdbfc9f6 Tests: Add explicit testing for find_program 907a919b cmSystemTools: Drop unused StringEndsWith method ed4de3c9 cmFindProgramCommand: Use Names member instead of passing it bf32b95e cmFindLibraryCommand: Avoid repeating search for the same name
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rwxr-xr-xTests/RunCMake/find_program/A/testA1
-rwxr-xr-xTests/RunCMake/find_program/B/testB1
-rw-r--r--Tests/RunCMake/find_program/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/find_program/DirsPerName-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/DirsPerName.cmake6
-rw-r--r--Tests/RunCMake/find_program/NamesPerDir-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/NamesPerDir.cmake6
-rw-r--r--Tests/RunCMake/find_program/RunCMakeTest.cmake9
-rwxr-xr-xTests/RunCMake/find_program/Win/testCom.com0
-rwxr-xr-xTests/RunCMake/find_program/Win/testCom.exe0
-rwxr-xr-xTests/RunCMake/find_program/Win/testExe.exe0
-rw-r--r--Tests/RunCMake/find_program/WindowsCom-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/WindowsCom.cmake6
-rw-r--r--Tests/RunCMake/find_program/WindowsExe-stdout.txt1
-rw-r--r--Tests/RunCMake/find_program/WindowsExe.cmake6
16 files changed, 43 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 4d96866..241cf90 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -184,6 +184,7 @@ add_RunCMake_test(find_file)
add_RunCMake_test(find_library)
add_RunCMake_test(find_package)
add_RunCMake_test(find_path)
+add_RunCMake_test(find_program -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME})
add_RunCMake_test(get_filename_component)
add_RunCMake_test(get_property)
add_RunCMake_test(if)
diff --git a/Tests/RunCMake/find_program/A/testA b/Tests/RunCMake/find_program/A/testA
new file mode 100755
index 0000000..1a24852
--- /dev/null
+++ b/Tests/RunCMake/find_program/A/testA
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/Tests/RunCMake/find_program/B/testB b/Tests/RunCMake/find_program/B/testB
new file mode 100755
index 0000000..1a24852
--- /dev/null
+++ b/Tests/RunCMake/find_program/B/testB
@@ -0,0 +1 @@
+#!/bin/sh
diff --git a/Tests/RunCMake/find_program/CMakeLists.txt b/Tests/RunCMake/find_program/CMakeLists.txt
new file mode 100644
index 0000000..74b3ff8
--- /dev/null
+++ b/Tests/RunCMake/find_program/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 3.3)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/find_program/DirsPerName-stdout.txt b/Tests/RunCMake/find_program/DirsPerName-stdout.txt
new file mode 100644
index 0000000..f763bb0
--- /dev/null
+++ b/Tests/RunCMake/find_program/DirsPerName-stdout.txt
@@ -0,0 +1 @@
+-- PROG='[^']*/Tests/RunCMake/find_program/B/testB'
diff --git a/Tests/RunCMake/find_program/DirsPerName.cmake b/Tests/RunCMake/find_program/DirsPerName.cmake
new file mode 100644
index 0000000..54db6dd
--- /dev/null
+++ b/Tests/RunCMake/find_program/DirsPerName.cmake
@@ -0,0 +1,6 @@
+find_program(PROG
+ NAMES testB testA
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
+ NO_DEFAULT_PATH
+ )
+message(STATUS "PROG='${PROG}'")
diff --git a/Tests/RunCMake/find_program/NamesPerDir-stdout.txt b/Tests/RunCMake/find_program/NamesPerDir-stdout.txt
new file mode 100644
index 0000000..964e259
--- /dev/null
+++ b/Tests/RunCMake/find_program/NamesPerDir-stdout.txt
@@ -0,0 +1 @@
+-- PROG='[^']*/Tests/RunCMake/find_program/A/testA'
diff --git a/Tests/RunCMake/find_program/NamesPerDir.cmake b/Tests/RunCMake/find_program/NamesPerDir.cmake
new file mode 100644
index 0000000..49ce49d
--- /dev/null
+++ b/Tests/RunCMake/find_program/NamesPerDir.cmake
@@ -0,0 +1,6 @@
+find_program(PROG
+ NAMES testB testA NAMES_PER_DIR
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/A ${CMAKE_CURRENT_SOURCE_DIR}/B
+ NO_DEFAULT_PATH
+ )
+message(STATUS "PROG='${PROG}'")
diff --git a/Tests/RunCMake/find_program/RunCMakeTest.cmake b/Tests/RunCMake/find_program/RunCMakeTest.cmake
new file mode 100644
index 0000000..2adec11
--- /dev/null
+++ b/Tests/RunCMake/find_program/RunCMakeTest.cmake
@@ -0,0 +1,9 @@
+include(RunCMake)
+
+run_cmake(DirsPerName)
+run_cmake(NamesPerDir)
+
+if(CMAKE_SYSTEM_NAME MATCHES "^(Windows|CYGWIN)$")
+ run_cmake(WindowsCom)
+ run_cmake(WindowsExe)
+endif()
diff --git a/Tests/RunCMake/find_program/Win/testCom.com b/Tests/RunCMake/find_program/Win/testCom.com
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_program/Win/testCom.com
diff --git a/Tests/RunCMake/find_program/Win/testCom.exe b/Tests/RunCMake/find_program/Win/testCom.exe
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_program/Win/testCom.exe
diff --git a/Tests/RunCMake/find_program/Win/testExe.exe b/Tests/RunCMake/find_program/Win/testExe.exe
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/find_program/Win/testExe.exe
diff --git a/Tests/RunCMake/find_program/WindowsCom-stdout.txt b/Tests/RunCMake/find_program/WindowsCom-stdout.txt
new file mode 100644
index 0000000..e386fce
--- /dev/null
+++ b/Tests/RunCMake/find_program/WindowsCom-stdout.txt
@@ -0,0 +1 @@
+-- PROG='[^']*/Tests/RunCMake/find_program/Win/testCom.com'
diff --git a/Tests/RunCMake/find_program/WindowsCom.cmake b/Tests/RunCMake/find_program/WindowsCom.cmake
new file mode 100644
index 0000000..b32d9e8
--- /dev/null
+++ b/Tests/RunCMake/find_program/WindowsCom.cmake
@@ -0,0 +1,6 @@
+find_program(PROG
+ NAMES testCom
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Win
+ NO_DEFAULT_PATH
+ )
+message(STATUS "PROG='${PROG}'")
diff --git a/Tests/RunCMake/find_program/WindowsExe-stdout.txt b/Tests/RunCMake/find_program/WindowsExe-stdout.txt
new file mode 100644
index 0000000..bdf48aa
--- /dev/null
+++ b/Tests/RunCMake/find_program/WindowsExe-stdout.txt
@@ -0,0 +1 @@
+-- PROG='[^']*/Tests/RunCMake/find_program/Win/testExe.exe'
diff --git a/Tests/RunCMake/find_program/WindowsExe.cmake b/Tests/RunCMake/find_program/WindowsExe.cmake
new file mode 100644
index 0000000..3a336ec
--- /dev/null
+++ b/Tests/RunCMake/find_program/WindowsExe.cmake
@@ -0,0 +1,6 @@
+find_program(PROG
+ NAMES testExe
+ PATHS ${CMAKE_CURRENT_SOURCE_DIR}/Win
+ NO_DEFAULT_PATH
+ )
+message(STATUS "PROG='${PROG}'")