diff options
author | Brad King <brad.king@kitware.com> | 2013-03-29 18:53:36 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-03-29 19:00:33 (GMT) |
commit | de13d68d11b9f8f08c67b8cbcdd0f957d5bae6e1 (patch) | |
tree | fc2627f441f17a82542faef7891815732e294b76 /Tests/RunCMake/add_dependencies | |
parent | 1f16bd24ee00bfdb5d50e24eaa46da2cdfa1b129 (diff) | |
download | CMake-de13d68d11b9f8f08c67b8cbcdd0f957d5bae6e1.zip CMake-de13d68d11b9f8f08c67b8cbcdd0f957d5bae6e1.tar.gz CMake-de13d68d11b9f8f08c67b8cbcdd0f957d5bae6e1.tar.bz2 |
add_dependencies: Distinguish target v. file dependencies in error (#14050)
When called with a non-existent LHS target name the user may be trying
to add file-level dependencies. Clarify the error message to explain
the difference between target-level and file-level dependencies. Point
the reader at the commands and options needed for the latter.
Diffstat (limited to 'Tests/RunCMake/add_dependencies')
5 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/add_dependencies/CMakeLists.txt b/Tests/RunCMake/add_dependencies/CMakeLists.txt new file mode 100644 index 0000000..e8db6b0 --- /dev/null +++ b/Tests/RunCMake/add_dependencies/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/add_dependencies/NoTarget-result.txt b/Tests/RunCMake/add_dependencies/NoTarget-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/add_dependencies/NoTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_dependencies/NoTarget-stderr.txt b/Tests/RunCMake/add_dependencies/NoTarget-stderr.txt new file mode 100644 index 0000000..6af2707 --- /dev/null +++ b/Tests/RunCMake/add_dependencies/NoTarget-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at NoTarget.cmake:1 \(add_dependencies\): + Cannot add target-level dependencies to non-existent target "foo". + + The add_dependencies works for top-level logical targets created by the + add_executable, add_library, or add_custom_target commands. If you want to + add file-level dependencies see the DEPENDS option of the add_custom_target + and add_custom_command commands. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/add_dependencies/NoTarget.cmake b/Tests/RunCMake/add_dependencies/NoTarget.cmake new file mode 100644 index 0000000..9037694 --- /dev/null +++ b/Tests/RunCMake/add_dependencies/NoTarget.cmake @@ -0,0 +1 @@ +add_dependencies(foo bar) diff --git a/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake b/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake new file mode 100644 index 0000000..30b7e67 --- /dev/null +++ b/Tests/RunCMake/add_dependencies/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(NoTarget) |