[CMake] Per build configuration variables

Sergiu Dotenco sergiu.dotenco at gmail.com
Tue Sep 1 11:03:30 EDT 2015


On 8/31/2015 1:11 AM, Sergiu Dotenco wrote:
> I would like to pass different library directories to fixup_bundle,
> depending what configuration is currently active. Right now, I define a
> cache variable consisting of DLL directories:
> 
> set (RUNTIME_LIBRARY_DIRS "C:/Foo/Release/bin;..." CACHE STRING "")
> 
> This is problematic, since for a different build configuration (for
> instance RelWithDebInfo or even Debug) this set of directories would
> probably be different as well. For Makefile generators I can use
> CMAKE_BUILD_TYPE to decide which variables to select. However, this does
> not work in an environment that supports multiconfiguration, such as
> Visual Studio or Xcode, because the selection must be done at build time.
> 
> Any ideas how can one achieve this?
> 

Got it. One can use CMAKE_INSTALL_CONFIG_NAME in install (CODE "...").


More information about the CMake mailing list