[CMake] Separate compiler and linker pdb

Michele Santullo michele.santullo at larian.com
Tue Jun 19 11:57:11 EDT 2012


Hello, we recently converted our project to cmake but for some reason, 
as we generate for VS 2008 on Windows, we get the same path for both the 
compiler and the linker generated pdb files.

The path is something like ..../bin/Debug/Project.pdb for both, so they 
overwrite each other causing various errors. If I pass the /Fd switch to 
the compiler, cmake just keeps the old path and appends the new one to 
the command line parameters, confusing the VS IDE and causing a full 
rebuild every time we build.

Is there a solution to produce two different files?
Could it be caused by some error in my cmake files? The only settings 
about paths I can think of are:

set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin )
set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib )

if(MSVC)
	set(PDB_SEARCH_PATHS "/PDBPATH")
	SET(LNK_FLAGS_DEBUG "${LNK_FLAGS_DEBUG} ${PDB_SEARCH_PATHS}")
	SET(LNK_FLAGS_RELEASE "${LNK_FLAGS_RELEASE} ${PDB_SEARCH_PATHS}")
	SET(LNK_FLAGS_SHIPPING "${LNK_FLAGS_SHIPPING} ${PDB_SEARCH_PATHS}")
endif(MSVC)

Thanks,
Michele


More information about the CMake mailing list