I find a dirty way, but it does not work with Ninja generator.<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">function(fix_msvc_pch_shared_problem targetSelf targetBinary)<br>

    if (&quot;${targetSelf}&quot; STREQUAL &quot;${targetBinary}&quot;)<br>        return()<br>    endif()<br>    # NOTE: Dirty hack! until to find other way<br>    get_filename_component(pdbpath ${${targetBinary}_PCH_BINARY_FILE} PATH)<br>

    get_target_property(targetCompileFlags ${targetSelf} COMPILE_FLAGS)<br>    if (targetCompileFlags)<br>        set(origCompileFlags ${targetCompileFlags})<br>    endif()<br>    set_target_properties(${targetSelf} PROPERTIES<br>

        COMPILE_FLAGS &quot;${origCompileFlags} /Fd\&quot;${pdbpath}/${targetBinary}.pdb\&quot;&quot;<br>    )<br>    string(REGEX REPLACE &quot; /Fd&lt;TARGET_PDB&gt;&quot; &quot;&quot; temp &quot;${CMAKE_${${targetBinary}_PCH_LANGUAGE}_COMPILE_OBJECT}&quot;)<br>

    set(CMAKE_${${targetBinary}_PCH_LANGUAGE}_COMPILE_OBJECT ${temp} PARENT_SCOPE)<br>endfunction()<br></blockquote><br><div class="gmail_quote">2012/9/9 Loaden <span dir="ltr">&lt;<a href="mailto:loaden@gmail.com" target="_blank">loaden@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, all!<br>I was googled about how to change the PDB file name. it seems the PDB name still hardcode in cmTarget.cxx?<br>

There exist any way to change the PDB filename for now?<br>I don&#39;t want to adding /Fd&quot;XXX.pdb&quot; for compile, and /PDB:&quot;XXX.pdb&quot; for link.<br>
It&#39;s will given overwriting warning because in cl.cmake<br><br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">SET(CMAKE_CXX_COMPILE_OBJECT<br>

    &quot;&lt;CMAKE_CXX_COMPILER&gt; ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} &lt;FLAGS&gt; &lt;DEFINES&gt; /TP /Fo&lt;OBJECT&gt; /Fd&lt;TARGET_PDB&gt; -c &lt;SOURCE&gt;${CMAKE_END_TEMP_FILE}&quot;)<br>
</blockquote><div>What should I do? <br>Any comments? <br></div>Thanks!<span class="HOEnZb"><font color="#888888"><br clear="all"><br>-- <br><div>Best Regards</div>
<div>Yuchen</div><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div>Best Regards</div>
<div>Yuchen</div><br>