summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-08 15:32:55 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-02-08 15:32:55 (GMT)
commit08e53620044c1ac5ff29adb695a7c6bdde480fb4 (patch)
treeda88cc17846ac711b1ac4d7a2b84804c808c63e1 /Tests/RunCMake
parent037738ac194a7e50c92ffda60eaca707bb35bac9 (diff)
parent497cad7c883dc401b4d78109c3a057fb38745d9e (diff)
downloadCMake-08e53620044c1ac5ff29adb695a7c6bdde480fb4.zip
CMake-08e53620044c1ac5ff29adb695a7c6bdde480fb4.tar.gz
CMake-08e53620044c1ac5ff29adb695a7c6bdde480fb4.tar.bz2
Merge topic 'error-multiple-targets'
497cad7c cmake: Teach --build to reject multiple --target options 886acd80 Help: Fix reference to `cmake --build` in cmake(1) manual
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt1
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt3
-rw-r--r--Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/CommandLine/RunCMakeTest.cmake2
4 files changed, 8 insertions, 0 deletions
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt
new file mode 100644
index 0000000..f2cbaa6
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/BuildDir--build-multiple-targets-stderr.txt
@@ -0,0 +1,3 @@
+^'--target' may not be specified more than once\.
++
+Usage: cmake --build <dir> \[options\] \[-- \[native-options\]\]
diff --git a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
index 20df108..d2a2831 100644
--- a/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
+++ b/Tests/RunCMake/CommandLine/BuildDir/CMakeLists.txt
@@ -3,3 +3,5 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E echo CustomCommand > output.txt
)
add_custom_target(CustomTarget ALL DEPENDS output.txt)
+add_custom_target(CustomTarget2 ALL DEPENDS output.txt)
+add_custom_target(CustomTarget3 ALL DEPENDS output.txt)
diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
index e3b73ff..a07bbbe 100644
--- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake
@@ -51,6 +51,8 @@ function(run_BuildDir)
run_cmake(BuildDir)
run_cmake_command(BuildDir--build ${CMAKE_COMMAND} -E chdir ..
${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget)
+ run_cmake_command(BuildDir--build-multiple-targets ${CMAKE_COMMAND} -E chdir ..
+ ${CMAKE_COMMAND} --build BuildDir-build --target CustomTarget2 --target CustomTarget3)
endfunction()
run_BuildDir()