View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005436CMakeCMakepublic2007-07-31 06:582016-06-10 14:30
ReporterYegor Yefremov 
Assigned ToBill Hoffman 
PrioritylowSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005436: ADD_CUSTOM_COMMAND unused custom commands are not reported to the user
DescriptionIf add_custom_command is placed before the target itself, there is no warning or error message, when executing "cmake .". The custom target will not created, when executing make. As soon as add_custom_target is placed after the target itself, the custom target will be created.

The following CMakeLists.txt was used to test this behavior (test.c is also attached):

project (TEST)

# sources
set (SRCS test.c)

#custom target
add_custom_command (TARGET test POST_BUILD COMMENT "Creating tags" COMMAND mkdir tags WORKING_DIRECTORY ${TEST_SOURCE_DIR})

# executables
add_executable (test ${SRCS})
Additional InformationFrom Brad King:

In cmMakefile::AddCustomCommandToTarget, this code appears:

  // Find the target to which to add the custom command.
  cmTargets::iterator ti = this->Targets.find(target);
  if(ti != this->Targets.end())
    {
    ...
    }

There is no else block. There should be an else block that uses
IssueMessage to complain that the target doesn't exist. You'll have to
create a policy to make this an error.
TagsNo tags attached.
Attached Filesc file icon test.c [^] (95 bytes) 1969-12-31 19:00

 Relationships

  Notes
(0041378)
Kitware Robot (administrator)
2016-06-10 14:27

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2008-10-10 10:36 Bill Hoffman Summary ADD_CUSTOM_COMMAND no dependencies check => ADD_CUSTOM_COMMAND unused custom commands are not reported to the user
2008-10-10 10:36 Bill Hoffman Additional Information Updated
2016-06-10 14:27 Kitware Robot Note Added: 0041378
2016-06-10 14:27 Kitware Robot Status assigned => resolved
2016-06-10 14:27 Kitware Robot Resolution open => moved
2016-06-10 14:30 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team