[CMake] RUNTIME_OUTPUT_DIRECTORY_<CONFIG> has no effect

Martin Magnusson martin at eyra.se
Fri Jan 7 05:11:18 EST 2011


I'm having trouble setting the runtime output directory, especially with
multiple configurations.

I'm using CMake 2.8 on Ubuntu 10.04, with gcc.

My current root CMakeLists.txt contains
SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin )
which works, although the EXECUTABLE_OUTPUT_PATH is deprecated.

If I read the documentation correctly, the proper way of setting the
output directory now would be
SET_PROPERTY( GLOBAL PROPERTY
  RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin
)
but that doesn't work for me. With that setting, the binary is produced
in the source directory, just as if I hadn't specified an output
directory at all.

If it weren't for multiple configurations, I could just go on using
EXECUTABLE_OUTPUT_PATH as before, but I would also like to be able to
specify something like
SET_PROPERTY( GLOBAL PROPERTY
  RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO
${PROJECT_BINARY_DIR}/bin/relwithdebinfo
)
and I can't find a way to do that with EXECUTABLE_OUTPUT_PATH.

What am I doing wrong?


More information about the CMake mailing list