View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011891CMakeCMakepublic2011-02-24 03:212013-01-04 08:54
Reporterjfbos2 
Assigned ToBill Hoffman 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
PlatformWindowsOSOS Version
Product VersionCMake 2.8.4 
Target VersionCMake 2.8.5Fixed in VersionCMake 2.8.5 
Summary0011891: Visual Studio 2010 Generator adds .obj as "not part of this build" to projects
DescriptionWhen you add .obj files that already exist and want to add them
to the executable or library sources, the Visual Studio 2010 Generator
add the file to the Project but it is marked as "not part of this build"
and not linked with the executable or library.

If you look in the .vxproj file is says..:
...
  <ItemGroup>
    <None Include="C:/Users/Test/Projects/CMake2010Bug/stack.obj" />
  </ItemGroup>
...

Instead it should read:
  <ItemGroup>
    <Object Include="C:/Users/Test/Projects/CMake2010Bug/stack.obj" />
  </ItemGroup>
Steps To Reproduce1) Use the following CMakeLists.txt:
------------------------------------
cmake_minimum_required(VERSION 2.6)
project(testProj CXX)
add_executable(test main.cpp stack.obj)
# the following doesn't seem to affect anything, at least with VS2010 Generator
set_source_files_properties( stack.obj PROPERTIES EXTERNAL_OBJECT TRUE )
-------------------------------------

with simple main.cpp and any .obj file,

2) run cmake with Visual Studio 2010 Generator
3) Open solution -> stack.obj is added as "Not part of this build"
   and the object file is not linked with the executable or library
Tagsvisual studio 2010
Attached Filestxt file icon CMakeLists.txt [^] (272 bytes) 2011-02-24 03:21 [Show Content]

 Relationships
duplicate of 0011896closedBill Hoffman ".obj" or ".o" listed in ADD_LIBRARY does not get included in Visual Studio project, NMake build works 
related to 0013047closedBrad King Visual Studio 2010 Generator and "PROPERTIES GENERATED 1" adds .obj as "not part of this build" to projects 
related to 0013831closedBrad King VS 2012 generator doesn't always respect the EXTERNAL_OBJECT propery 

  Notes
(0026002)
Bill Hoffman (manager)
2011-03-31 18:08

The odd thing is that our test for this is passing. Something must be wrong with the test... It is called ExternalObj, it builds a .o with a try-compile, then uses that as part of the main project. For some reason it works. But the example in the bug that is a duplicate of this one does not...
(0026088)
Bill Hoffman (manager)
2011-04-04 17:28

This if fixed in git next.

 Issue History
Date Modified Username Field Change
2011-02-24 03:21 jfbos2 New Issue
2011-02-24 03:21 jfbos2 File Added: CMakeLists.txt
2011-02-24 03:26 jfbos2 Tag Attached: visual studio 2010
2011-03-31 18:06 Bill Hoffman Relationship added duplicate of 0011896
2011-03-31 18:08 Bill Hoffman Note Added: 0026002
2011-04-04 17:28 Bill Hoffman Note Added: 0026088
2011-04-04 17:28 Bill Hoffman Status new => closed
2011-04-04 17:28 Bill Hoffman Assigned To => Bill Hoffman
2011-04-04 17:28 Bill Hoffman Resolution open => fixed
2011-04-14 14:39 David Cole Fixed in Version => CMake 2.8.5
2011-04-14 14:39 David Cole Target Version => CMake 2.8.5
2012-03-19 08:47 Brad King Relationship added related to 0013047
2013-01-04 08:54 Brad King Relationship added related to 0013831


Copyright © 2000 - 2018 MantisBT Team