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 ("${targetSelf}" STREQUAL "${targetBinary}")<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 "${origCompileFlags} /Fd\"${pdbpath}/${targetBinary}.pdb\""<br> )<br> string(REGEX REPLACE " /Fd<TARGET_PDB>" "" temp "${CMAKE_${${targetBinary}_PCH_LANGUAGE}_COMPILE_OBJECT}")<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"><<a href="mailto:loaden@gmail.com" target="_blank">loaden@gmail.com</a>></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't want to adding /Fd"XXX.pdb" for compile, and /PDB:"XXX.pdb" for link.<br>
It'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>
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> <DEFINES> /TP /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")<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>