I find a dirty way, but it does not work with Ninja generator.
> function(fix_msvc_pch_shared_problem targetSelf targetBinary)
> if ("${targetSelf}" STREQUAL "${targetBinary}")
> return()
> endif()
> # NOTE: Dirty hack! until to find other way
> get_filename_component(pdbpath ${${targetBinary}_PCH_BINARY_FILE} PATH)
> get_target_property(targetCompileFlags ${targetSelf} COMPILE_FLAGS)
> if (targetCompileFlags)
> set(origCompileFlags ${targetCompileFlags})
> endif()
> set_target_properties(${targetSelf} PROPERTIES
> COMPILE_FLAGS "${origCompileFlags}
> /Fd\"${pdbpath}/${targetBinary}.pdb\""
> )
> string(REGEX REPLACE " /Fd<TARGET_PDB>" "" temp
> "${CMAKE_${${targetBinary}_PCH_LANGUAGE}_COMPILE_OBJECT}")
> set(CMAKE_${${targetBinary}_PCH_LANGUAGE}_COMPILE_OBJECT ${temp}
> PARENT_SCOPE)
> endfunction()
>
2012/9/9 Loaden <[email protected]>
> Hi, all!
> I was googled about how to change the PDB file name. it seems the PDB name
> still hardcode in cmTarget.cxx?
> There exist any way to change the PDB filename for now?
> I don't want to adding /Fd"XXX.pdb" for compile, and /PDB:"XXX.pdb" for
> link.
> It's will given overwriting warning because in cl.cmake
>
> SET(CMAKE_CXX_COMPILE_OBJECT
>> "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}
>> <FLAGS> <DEFINES> /TP /Fo<OBJECT> /Fd<TARGET_PDB> -c
>> <SOURCE>${CMAKE_END_TEMP_FILE}")
>>
> What should I do?
> Any comments?
> Thanks!
>
> --
> Best Regards
> Yuchen
>
>
--
Best Regards
Yuchen
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake