[CMake] Incorrect object file name on cmake compilation

Ravi Raman ravi.raman at Xoriant.Com
Thu Sep 11 04:25:27 EDT 2014


Actually, in our project, the names of the object files matter because these object files go as an input to a object file comparison tool that compares object file names. So, there are 2 sets of object files, one coming from cmake build and one from Visual Studio build.
The set coming from cmake build was having this object file naming with extension .cpp.obj.
That was the reason for looking into this issue.

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<mailto:ram.singh at xoriant.com>| http://www.xoriant.com<http://www.xoriant.com/>

From: Petr Kmoch [mailto:petr.kmoch at gmail.com]
Sent: Thursday, September 11, 2014 1:49 PM
To: Andreas Mohr
Cc: cmake at cmake.org; Ravi Raman
Subject: Re: [CMake] Incorrect object file name on cmake compilation

I was wondering about this as well. Ravi, what is your motivation for having object file names of a particular format? I don't think I've ever had to care what object files in our builds are called.

Petr

On Thu, Sep 11, 2014 at 10:01 AM, Andreas Mohr <andi at lisas.de<mailto:andi at lisas.de>> wrote:
Hi,

> Date: Thu, 11 Sep 2014 07:49:23 +0000
> From: Ravi Raman <ravi.raman at Xoriant.Com>

> Hi,
>
> Thanks Petr for your reply. By incorrect I meant instead of the conventional main.obj, we get main.cpp.obj.
> I understood what you are saying. We have found a solution for this in our cmake code.

Good, so you've found a "solution" - to which, umm, I dare ask... "problem" exactly? :)

> We have explicitly set the /Fo compiler flag for main.cpp. With that it creates main.obj for main.cpp and also main.res for main.rc

Why does this need some manual effort (and of manually adding a very specific compiler flag syntax, in fact!)
when it ideally/normally/usually shouldn't,
one would want to ask.
Perhaps this "issue" is indicative of an asymmetric/incomplete mechanism or configuration
in CMake or this specific CMake environment, which one might want to discover and fix,
in order to have the need for any manual tweaking (in all sufficiently standard cases)
avoided in all future deployments...

Thanks,

Andreas Mohr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20140911/fe08b83a/attachment.html>


More information about the CMake mailing list