[CMake] cmake output file naming

Sumit Adhikari sumit.adhikari at gmail.com
Fri Aug 17 09:44:42 EDT 2012


Dear Brad,

Thanks for the info. I will try and I find any issues then will report.

*.cpp was just symbolic.

Regards,
Sumit

On Fri, Aug 17, 2012 at 3:22 PM, Brad King <brad.king at kitware.com> wrote:

> On 8/17/2012 5:03 AM, Sumit Adhikari wrote:
> > I have particular problem with the cmake generated output file naming
> > conventions (like myfile.cpp.o, myfile.cpp.gcno, ....).
>
> Object file names are computed in a deterministic manner
> based only on the source file name and location.  The
> object name must not conflict with that computed from any
> other source file.  In order to handle
>
>  add_executable(foo foo.c foo.cpp)
>
> the object name must include the source extension.
>
> The implementation is here:
>
>
> http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalGenerator.cxx;hb=v2.8.9#l2857
>
> If you really want to avoid the extension you can set the
> undocumented internal implementation detail variable:
>
>  set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
>  set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
>
> some time after the project() command call that enables
> the C and CXX languages.  As the variables are internal
> details this will not be guaranteed to work in the future.
>
> > These naming conventions creating trouble for me to run gcov *.cpp
> > properly with my -o /objdir option
>
> How does "*.cpp" match ".cpp.o"?
>
> -Brad
>



-- 
Sumit Adhikari,
Institute of Computer Technology,
Faculty of Electrical Engineering,
Vienna University of Technology,
Gußhausstraße 27-29,1040 Vienna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120817/cb24ff68/attachment.htm>


More information about the CMake mailing list