Notes |
|
(0031561)
|
Brad King
|
2012-11-15 10:56
|
|
For the IDE generator CMake never generates any project file settings to change the .obj extension, for an OBJECT library or otherwise. This would be a new general-purpose feature, no? Since the VS IDE does not present any interface treating object files as first-class entities (it calls them "intermediate" files), what difference does the extension make?
Note that OBJECT libraries have no packaged library file. The ".lib" built by the IDE is hidden away and not used and only exists because we can't stop the IDE from running its librarian. When the OBJECT library is referenced in another target then CMake directly adds the .obj files to the link line for that target. They will be included among the .obj files compiled from sources in that other (real) target when linking. Those will also always have ".obj" as their extension.
The CMAKE_C_OUTPUT_EXTENSION variables are only used for non-IDE generators IIRC. |
|
|
(0031562)
|
Mike Smith
|
2012-11-15 11:14
|
|
The problem I am facing has come about because I am building using Visual Studio but with a non-Win32 cl.exe which creates .o object files, not .obj files. In the project files created by cmake it is .obj files listed but these can never be found during the build as the compiler produces .o files. The only work-around I have found so far is to manually hack the .vcxproj files after cmake has created them which isn't ideal.
> This would be a new general-purpose feature, no?
Yes, I guess so. |
|
|
(0031563)
|
Brad King
|
2012-11-15 11:27
|
|
|
|
(0031608)
|
Mike Smith
|
2012-11-19 10:03
|
|
I tried your suggestion with CMAKE_C_OUTPUT_EXTENSION but it still always comes out as ".obj" (or NULL). Where would this value get set? I can take a look to see what is happening there. |
|
|
(0031609)
|
Brad King
|
2012-11-19 10:09
|
|
|
|
(0039297)
|
Bastien Schatt
|
2015-08-18 10:26
|
|
I attached a patch based on your suggestion (i.e. using the value of CMAKE_C_OUTPUT_EXTENSION). |
|
|
(0039298)
|
Brad King
|
2015-08-18 10:42
|
|
Thanks. The proper extension can be obtained from cmGlobalGenerator::GetLanguageOutputExtension, just like cmLocalGenerator::GetObjectFileNameWithoutTarget does. Please revise to use that instead. Otherwise this will only work when C is enabled. |
|
|
(0039299)
|
Bastien Schatt
|
2015-08-18 11:20
|
|
Thank you for the review. I didn't know about GetLanguageOutputExtension.
I attached a new patch (0001-Fixed-issue-0013685-using-GetLanguageOutputExtension.patch). |
|
|
(0039304)
|
Brad King
|
2015-08-20 09:41
|
|
|
|
(0040117)
|
Robert Maynard
|
2016-01-04 11:52
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|