[CMake] DLL and EXE with same base name: clash in VS.

Michael Wild themiwi at gmail.com
Wed Apr 6 04:46:51 EDT 2011


On 04/06/2011 10:34 AM, Óscar Fuentes wrote:
> Michael Wild <themiwi at gmail.com> writes:
> 
>> On 04/06/2011 09:21 AM, Alexey Livshits wrote:
>>>> We have a clang.exe and a clang.dll. While building, VS creates
>>>> clang.pdb (for the executable) and clang.pdb (for the dll) which
>>>> obviously is not right. Is there a way to tell VS to use a different
>>>> name for the PDB?
>>>
>>> You can use different project name for exe and set the output name via
>>> OUTPUT_NAME property.
>>
>> CMake uses prefix+base+".pdb" to generate the PDB file name, however I
>> didn't dig deep enough to find out what `base' is, just that it is
>> obtained with cmTarget::GetName(). Whether that refers to the target
>> name or the OUTPUT_NAME, I couldn't find out easily, so you'll have to
>> experiment ;-)
> 
> It is OUTPUT_NAME. The target name for clang.dll is libclang and the
> build creates clang.pdb (and clang.ilk ...)
> 
> If I understand correctly what Michael says, the .pdb file name is
> hardcoded.

If I read cmTarget::GetPDBName(const char*) in cmTarget.cxx correctly, yes.

I don't know VS well enough to know whether using a different name would
actually work, or whether the name is being enforced.

Michael


More information about the CMake mailing list