[CMake] Where are object files located, and how do I change the default extension?

Carlson Daniel daniel.c.carlson at gmail.com
Wed Mar 25 13:58:47 EDT 2009


Thank you Alexander!

Although this was not the answers I wanted to hear...

1: I believe it is quite stupid to edit the platform files, right? If I do
that I have to remember to edit the platform files in the future when I e.g.
update the CMake environment to a newer version... I will have a look at the
toolchain files if this can solve my problems. (must RTFM...)

2: About the path to the object file: Is this not a quit nice feature to
implement in the next release of Cmake? :-) This can also be used to create
dependencies if any file depends on an object file (E.g. if you want to run
Lint when an object file is updated, or some post compile test, etc.)

Regards
Daniel Carlson

2009/3/25 Alexander Neundorf <a.neundorf-work at gmx.net>

> On Wednesday 25 March 2009, Carlson Daniel wrote:
> > Best CMake users,
> >
> > I am using CMake in some smaller embedded projects which we have
> converted
> > from traditional make scripts. After all c-files has been compiled we
> want
> > to perform some tests on the generated object-files. The tests we are
> > running demands that the object files are denoted myFile.o and not
> > myFile.c.obj which is the default when running CMake for MinGw.
> >
> > My questions:
> >
> > 1. How can I change the default extension of an object file? I have tried
> > to use the CMake variable CMAKE_C_OUTPUT_EXTENSION and set it to e.g.
> ".o"
> > but the extension is still ".obj". In the Cmake module
> > "CMakeCXXInformation.cmake" this variable is set depending on the
> variabele
> > "UNIX" and when I test to set the extension in this CMake module to
> ".foo"
> > the extension is changed to ".foo". Is it not possible to change the
> > default extension from my main CMakeList-file?
>
> I think trying to set it from a CMakeLists.txt is too late.
> You should be able to set it from a toolchain- or platform file.
>
> > 2. Is there a way to get the path of an object file? What I want to do is
> > to retreive the output path of an obcject file from a c-file
> > e.g.appl/CMakeFiles/appl.dir/smhd/ if my c-file resides in appl/smhd/
>
> I think currently not.
>
> Alex
> _______________________________________________
> 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://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090325/4334136e/attachment.htm>


More information about the CMake mailing list