[CMake] CMake, Nmake files and APPVER

Brad King brad.king at kitware.com
Tue Mar 15 10:02:56 EST 2005


Tanner Lovelace wrote:
> So, it looks like writing a macro to set the compiler defines automatically
> is trivial.  Setting the linker flags, though, may be a bit more problematic
> since it appears that CMake already generates a "-subsystem:console" or
> "-subsystem:windows" based on if WIN32 is specified or not in the
> ADD_EXECUTABLE definition.

The Modules/Platform/Windows-cl.cmake file sets these variables:

SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)

Your listfile code can replace these values with whatever flags you want:

SET(CMAKE_CREATE_WIN32_EXE "/subsystem:windows,5.0")

Then those flags will be used on the link line instead.

-Brad


More information about the CMake mailing list