[CMake] How to get rid of Debug / Release VisualStudio folders?

Joshua Jensen jjensen at workspacewhiz.com
Wed Aug 22 20:20:41 EDT 2007


Luigi Calori wrote:
> Probably dumb question, but was not able to found hints on docs:
> Visual Studio projects generated do append Debug / Release to the 
> EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths.
> Is there a way to avoid this and force them to generate straight 
> inside EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH paths ?
I use the following:

    IF (CMAKE_GENERATOR MATCHES "Visual Studio")
        SET_TARGET_PROPERTIES(${TargetName} PROPERTIES PREFIX "../")
        SET_TARGET_PROPERTIES(${TargetName} PROPERTIES DEBUG_POSTFIX 
".debug")
    ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio")

It's not perfect, but it backs the executable out a directory.

Josh


More information about the CMake mailing list