View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014532CMakeCMakepublic2013-10-31 11:102014-06-02 08:37
ReporterSteve Wolak 
Assigned ToBrad King 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformWindowsOSWindowsOS Version7 x64
Product VersionCMake 2.8.12 
Target VersionCMake 2.8.12.1Fixed in VersionCMake 2.8.12.1 
Summary0014532: CMake internal error: cmTarget::GetOutputInfo
DescriptionI created an object library and then attempted to reference the target in a custom command using $<TARGET_FILE:tgt>. This caused the following:

cmTarget::GetOutputInfo called for my_obj which has type OBJECT_LIBRARY



This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
System error 768.
Steps To ReproduceUsing CMake for Win32 on Windows 7 x64

Create an object target:

add_library(my_obj OBJECT my_src.cpp)

Use the object target in a shared library:

add_library(my_lib SHARED $<TARGET_OBJECTS:sc_lo_obj> my_lib.rc)

Attempt to copy the object target using a custom command (a post build command on the library):

add_custom_command (TARGET my_lib
                POST_BUILD
                COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:my_obj> ${OUTPUT_DIR}/my_obj_renamed.obj
                )
Additional InformationI was looking for a way to copy an object file from the intermediate directory to a directory of our choosing. Seeing the OBJECT library option, I figured I'd give this a shot to see what would happen.

TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0034304)
Brad King (manager)
2013-11-01 10:30

Thanks for the report.

Crash replaced with error message and test case added:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d9605897 [^]

The $<TARGET_FILE:...> generator expression does not make sense for object libraries because there is no "library" file and there can be many object files.

As for your original objective, to copy an object file, that will require a new CMake feature to do portably. It may be tricky when it comes features like CMAKE_OSX_ARCHITECTURES that end up with more than one object file per source file (one per architecture per source). Currently object files are not first-class objects in IDE build tools (VS, Xcode) so it is hard to make them first-class objects for CMake. Anyway, this feature is beyond the scope of this issue tracker entry.
(0036002)
Robert Maynard (manager)
2014-06-02 08:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-10-31 11:10 Steve Wolak New Issue
2013-11-01 10:30 Brad King Note Added: 0034304
2013-11-01 10:30 Brad King Assigned To => Brad King
2013-11-01 10:30 Brad King Status new => resolved
2013-11-01 10:30 Brad King Resolution open => fixed
2013-11-01 10:30 Brad King Fixed in Version => CMake 3.0
2013-11-01 10:30 Brad King Target Version => CMake 3.0
2013-11-05 07:45 Brad King Fixed in Version CMake 3.0 => CMake 2.8.12.1
2013-11-05 07:45 Brad King Target Version CMake 3.0 => CMake 2.8.12.1
2014-06-02 08:37 Robert Maynard Note Added: 0036002
2014-06-02 08:37 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team