The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=13047 ====================================================================== Reported By: Petr Pospíšil Assigned To: ====================================================================== Project: CMake Issue ID: 13047 Category: CMake Reproducibility: always Severity: major Priority: normal Status: new ====================================================================== Date Submitted: 2012-03-17 08:11 EDT Last Modified: 2012-03-17 08:11 EDT ====================================================================== Summary: Visual Studio 2010 Generator and "PROPERTIES GENERATED 1" 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/PETR2/Desktop/bug/build/aaaa.obj" /> </ItemGroup> ... Instead it should read: <ItemGroup> <Object Include="C:/Users/PETR2/Desktop/bug/build/aaaa.obj" /> </ItemGroup> Steps to Reproduce: 1) Use the following CMakeLists.txt: ------------------------------------ cmake_minimum_required(VERSION 2.8) project(bug CXX) set( obj_file aaaa.obj ) set_source_files_properties( ${obj_file} PROPERTIES GENERATED 1) add_executable(main main.cpp ${obj_file}) ------------------------------------- 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 ====================================================================== 2012-03-17 08:11 Petr Pospíšil New Issue ====================================================================== -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers