[CMake] CMAKE_CFG_INTDIR

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Thu Sep 18 08:39:26 EDT 2014


On 15/09/14 12:01, Daniele E. Domenichelli wrote:
> Is there an alternative variable for CMAKE_CFG_INTDIR that can be used
> in configure time, instead of build time?
> 
> If there is not, is it safe to assume that the name of the directory is
> equal to the name of the current configuration?


Bump?

What I would like to do is to be able to change
CMAKE_RUNTIME_OUTPUT_DIRECTORY (and similar variables) with something
that contains the current configuration directory, i.e.

  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY .../${CMAKE_CFG_INTDIR}/...)

but unfortunately CMAKE_CFG_INTDIR causes an error when targets are
installed.

I was able to have something that works as I expect by doing this:

  foreach(config ${CMAKE_CONFIGURATION_TYPES})
    string(TOUPPER ${config} CONFIG)
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${CONFIG} .../${config}/...)
  endforeach()

But I was wondering if it is safe to assume that the current directory
is always "${config}" or if it might be different.



Cheers,
 Daniele


More information about the CMake mailing list