[CMake] Per build configuration variables

Sergiu Dotenco sergiu.dotenco at gmail.com
Sun Aug 30 19:11:06 EDT 2015


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?


More information about the CMake mailing list