[CMake] Incorrect object file name on cmake compilation

Petr Kmoch petr.kmoch at gmail.com
Thu Sep 11 02:41:08 EDT 2014


Hi Ravi.

In what sense is the name "incorrect?" There is no correct/incorrect way to
name object files in relation to the source file name; it can be arbitrary,
as long as it's correctly passed on to the linker. I believe CMake chooses
to append ".obj" to the whole file name if there is more than one file with
the same base name. But why should this be a problem?

Petr

On Thu, Sep 11, 2014 at 7:59 AM, Ravi Raman <ravi.raman at xoriant.com> wrote:

>  Hi,
>
>
>
> We are working on a cmake project.
>
>
>
> The issue is that the cmake build is successful but after the execution of
> cmake build step, the name of the object file is incorrect. On compilation
> of the source file main.cpp, the name of the object file is coming
> incorrectly as main.cpp.obj instead of main.obj
>
>
>
> To simulate the problem, please find attached herewith a zip file that
> contains
>
> CMakeLists.txt
>
> main.cpp
>
> main.rc
>
> The source list contains “main.cpp” and the resource file “main.rc”
>
>
>
> Please note the following:
>
> 1.       This problem occurs only when the resource file main.rc is
> present in the list.
>
> 2.       This problem does not occur when the resource file main.rc is
> excluded from the list OR if the resource file has a name other than main.rc
>
>
>
> Thanks & Regards
>
>
>
> *Ravi Raman *
>
> *Xoriant Solutions Pvt. Ltd*
>
> 4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076,
> INDIA.
>
> Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98
> Voip Extn:1178| Fax: +91 22 30511111
>
> ravi.raman at xoriant.com <ram.singh at xoriant.com>| http://www.xoriant.com
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140911/487af9ec/attachment.html>


More information about the CMake mailing list