View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014050CMakeCMakepublic2013-03-29 14:302013-10-07 10:04
ReporterDave Abrahams 
Assigned ToBrad King 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformMacOSOS XOS Version10.8
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0014050: add_dependencies error message does not distinguish target-level and file-level dependencies
DescriptionCMake Error at CMakeLists.txt:10 (add_dependencies):
  add_dependencies Adding dependency to non-existent target: foo

This is very surprising and non-uniform.
Steps To Reproducecmake_minimum_required(VERSION 2.8)
add_custom_command(
  OUTPUT foo
  COMMAND ${CMAKE_COMMAND} -E touch foo)

add_custom_command(
  OUTPUT bar
  COMMAND ${CMAKE_COMMAND} -E touch bar)

add_dependencies(foo bar)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0032726)
Brad King (manager)
2013-03-29 15:07

I don't think the command documentation can be any clearer that it is meant only for top-level logical target names, not files:

 http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:add_dependencies [^]

However, the error message can be greatly improved:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=de13d68d [^]
(0032727)
Dave Abrahams (reporter)
2013-03-29 15:31

IMO the limitation should be considered a bug. Having facilities that work “over here” but not “over there” kills usability. Uniformity, please!
(0032728)
Brad King (manager)
2013-03-29 15:38

I don't consider it a bug. The command should perhaps have been called target_add_dependencies but it will create more confusion to change it now IMO.
(0034021)
Robert Maynard (manager)
2013-10-07 10:04

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-03-29 14:30 Dave Abrahams New Issue
2013-03-29 15:07 Brad King Note Added: 0032726
2013-03-29 15:07 Brad King Assigned To => Brad King
2013-03-29 15:07 Brad King Status new => resolved
2013-03-29 15:07 Brad King Resolution open => fixed
2013-03-29 15:07 Brad King Summary add_dependencies refuses to work on some targets => add_dependencies error message does not distinguish target-level and file-level dependencies
2013-03-29 15:31 Dave Abrahams Note Added: 0032727
2013-03-29 15:31 Dave Abrahams Status resolved => feedback
2013-03-29 15:31 Dave Abrahams Resolution fixed => reopened
2013-03-29 15:38 Brad King Note Added: 0032728
2013-03-29 15:38 Brad King Status feedback => resolved
2013-03-29 15:38 Brad King Resolution reopened => fixed
2013-10-07 10:04 Robert Maynard Note Added: 0034021
2013-10-07 10:04 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team