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
--

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

Reply via email to