[CMake] Configuration environment variable for VS

Dmitry Bely dmitry.bely at gmail.com
Fri May 15 02:35:04 EDT 2009


On Fri, May 15, 2009 at 1:59 AM, James Bigler <jamesbigler at gmail.com> wrote:
> Is there a configuration environment variable for VS that I could use to
> change the behavior of an add_custom_command based on whether I'm building a
> debug or release build?
>
> I want something like this:
>
> add_custom_command(${OUTPUT_FILE}
>   COMMAND ${CMAKE_COMMAND} ARGS "$(Config)" -P "${my_custom_script}"
>   )

Yes, that's Visual Studio's $(ConfigurationName) variable. VS (not
CMake) will expand it during the build.

- Dmitry Bely


More information about the CMake mailing list