[cmake-developers] [CMake 0011891]: Visual Studio 2010 Generator adds .obj as "not part of this build" to projects

Mantis Bug Tracker mantis at public.kitware.com
Thu Feb 24 03:21:34 EST 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=11891 
====================================================================== 
Reported By:                jfbos2
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   11891
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-02-24 03:21 EST
Last Modified:              2011-02-24 03:21 EST
====================================================================== 
Summary:                    Visual Studio 2010 Generator adds .obj as "not part
of this build" to projects
Description: 
When 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 Reproduce: 
1) 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

====================================================================== 

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                    
======================================================================




More information about the cmake-developers mailing list