MantisBT - CMake
View Issue Details
0014994CMakeCMakepublic2014-06-26 09:002015-01-05 08:38
Emmanuel Blot 
 
normalfeaturealways
closedduplicate 
OS X 10.9.3 / eCos 3.0
CMake 3.0 
 
0014994: Add an option to change the object file name
Currently, it does not seem possible to (re)name an object file which CMake computes from the source file.

When building an application with static libraries, from multiple third party libraries, some library use the same name for a source file.

For example libcurl and a crypto library (PolarSSL, WolfSSL) use the same filenames for a crypto algorithm. There is no issue at compilation time since each source file is built within its dedicated CMAKE_CURRENT_BINARY_DIR.

However it is not possible to combine both object files within the same archive, as both libs end up with the same object file name.

It would be very helpful to provide a way to add a prefix to the generated object filenames so that no collision could occur.
I did not find any way to circumvent this limitation, but renaming the source files.

This is not really an option as merging upstream updates quickly become a nightmare if the file-to-be-merged has been renamed.

No tags attached.
duplicate of 0014874closed Brad King Static library can miss some object files 
Issue History
2014-06-26 09:00Emmanuel BlotNew Issue
2014-06-26 09:16Nils GladitzRelationship addedduplicate of 0014874
2014-06-27 09:22Brad KingNote Added: 0036263
2014-06-27 09:22Brad KingStatusnew => resolved
2014-06-27 09:22Brad KingResolutionopen => duplicate
2014-06-27 09:23Brad KingNote Added: 0036264
2015-01-05 08:38Robert MaynardNote Added: 0037572
2015-01-05 08:38Robert MaynardStatusresolved => closed

Notes
(0036263)
Brad King   
2014-06-27 09:22   
Issue 0014874 explains how the archive should be constructed to deal with the duplicate object names. CMake 3.1 will do this.
(0036264)
Brad King   
2014-06-27 09:23   
It is also possible to change the name of an object file by using a source file with a different name that #include-s the original source file.
(0037572)
Robert Maynard   
2015-01-05 08:38   
Closing resolved issues that have not been updated in more than 4 months.