[CMake] installing pdb files

Tyler Roscoe tyler at cryptio.net
Fri Dec 4 12:53:00 EST 2009


On Thu, Dec 03, 2009 at 04:48:58PM -0600, Randy Hancock wrote:
> install(FILES ${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/project_name.pdb
> DESTINATION ${SYMBOLS_DIR})
> 
> where SYMBOLS_DIR is set to something like:
> set(SYMBOLS_DIR "${CMAKE_SOURCE_DIR}/dist/symbols")
> 
> The tricky thing was getting the "Debug"/"Release" variable to work.
> Apparently the secret spell is to use \${CMAKE_INSTALL_CONFIG_NAME}. I
> presume the backslash is for delaying evaluation of the variable until
> the install step is actually run. The other weird thing is that the

Right. When working with IDEs like VS, there's no way to know at CMake
time which build configuration the user will select. You have to hack
around this in various ways; the \$ trick is one such hack. Here you're
relying on CMAKE_INSTALL_CONFIG_NAME to be defined at "make install"
time.

> 1) Is there a better way to do what I'm doing?

It looks like the .pdb files are considered RUNTIME outputs. In my
project, they end up right alongside the .dlls. You probably have some
other variable that points to the location of your .dlls, so maybe you
could use that var instead of CMAKE_INSTALL_CONFIG_NAME?

tyler


More information about the CMake mailing list