MantisBT - CMake
View Issue Details
0011006CMakeCMakepublic2010-07-17 10:572016-06-10 14:31
Jens Weggemann 
Bill Hoffman 
normalminoralways
closedmoved 
CMake-2-8 
 
0011006: Visual Studio 10 generator ignores SOURCES of a custom target
Defining a custom target like this:
ADD_CUSTOM_TARGET( foo SOURCES a.cpp b.h )
does not add the 2 source files to the generated Visual Studio 10 project.
The problem seems to be the following lines in cmVisualStudio10TargetGenerator.cxx:

void cmVisualStudio10TargetGenerator::WriteCLSources()
{
  if(this->Target->GetType() > cmTarget::MODULE_LIBRARY)
    {
    return;
    }

This seems wrong as utility targets may have sources.
Replacing cmTarget::MODULE_LIBRARY with cmTarget::UTILITY fixes this for me.
No tags attached.
related to 0010654closed Bill Hoffman Adding sources to ALL_BUILD project doesn't work in VS2010 
Issue History
2010-07-17 10:57Jens WeggemannNew Issue
2010-07-17 10:59Jens WeggemannNote Added: 0021417
2010-12-15 10:42David ColeRelationship addedrelated to 0010654
2010-12-15 10:44David ColeAssigned To => Bill Hoffman
2010-12-15 10:44David ColeStatusnew => assigned
2016-06-10 14:28Kitware RobotNote Added: 0041730
2016-06-10 14:28Kitware RobotStatusassigned => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0021417)
Jens Weggemann   
2010-07-17 10:59   
Bug 0010654 reads like it may have the same cause.
(0041730)
Kitware Robot   
2016-06-10 14:28   
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.