View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015467CMakeCMakepublic2015-03-21 22:042015-11-02 09:13
ReporterZhihao Yuan 
Assigned To 
PriorityhighSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSFreeBSDOS Version
Product VersionCMake 3.1.3 
Target VersionFixed in Version 
Summary0015467: add_custom_target ALL option regression
DescriptionIt seems that the ALL option is not making the target to run before other targets after cmake 3.1.

The cmake file is here:

  https://github.com/lichray/nvi2/blob/master/build/CMakeLists.txt#L49 [^]

I'm generating header files with add_custom_commend and using add_custom_target to run those commands.
Steps To ReproduceSee https://github.com/lichray/nvi2/issues/29 [^]
TagsNo tags attached.
Attached Files

 Relationships
related to 0015366closedBrad King set_source_files_properties OBJECT_DEPENDS broken after normalization 
related to 0015470closedKitware Robot Clarify behavior for relative paths in custom command DEPENDS 

  Notes
(0038275)
Brad King (manager)
2015-03-23 09:39

The ALL option just means that "make" with no other arguments will build the custom target even if it is not a dependency of anything else. No order of custom targets is defined with respect to other targets. You need to use

 add_dependencies(target-that-needs-custom-target custom-target)

to specify target ordering dependencies.
(0038279)
Zhihao Yuan (reporter)
2015-03-23 11:56

I tried

  add_dependencies(nvi headers)

where nvi is the executable target, headers is the custom target depends on headers generated by custom commands, still doesn't work.
(0038281)
Brad King (manager)
2015-03-23 13:06

The project in question uses lots of relative paths in its DEPENDS options. It looks like our documentation fails to specify that DEPENDS must be either absolute paths or target names.

Likely relative DEPENDS values resolve differently after this change in CMake 3.1:

 add_custom_command: Normalize OUTPUT and DEPENDS paths.
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c4af46b4 [^]
(0038282)
Brad King (manager)
2015-03-23 13:13

I've opened 0015470 to track the fact that we've never documented well-defined behavior for relative paths in DEPENDS.
(0039744)
Robert Maynard (manager)
2015-11-02 09:13

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

 Issue History
Date Modified Username Field Change
2015-03-21 22:04 Zhihao Yuan New Issue
2015-03-23 09:39 Brad King Note Added: 0038275
2015-03-23 09:39 Brad King Status new => resolved
2015-03-23 09:39 Brad King Resolution open => no change required
2015-03-23 11:56 Zhihao Yuan Note Added: 0038279
2015-03-23 13:01 Brad King Relationship added related to 0015366
2015-03-23 13:06 Brad King Note Added: 0038281
2015-03-23 13:12 Brad King Relationship added related to 0015470
2015-03-23 13:13 Brad King Note Added: 0038282
2015-11-02 09:13 Robert Maynard Note Added: 0039744
2015-11-02 09:13 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team