[CMake] Building both a .com and .exe executable on Windows.

Michael Oldfield sag_mal_pluesch at yahoo.com.au
Tue May 6 20:54:53 EDT 2014


On 07/05/14 00:25, Rick McGuire wrote:
> Working on converting an existing project to cmake, which is going
> fairly well.  I've found answers to most of questions with some quick
> google searches, but I've run into an issue where I've not managed to
> find any answers yet.  
> 
> One part of the project generates two executables with the same name.
>  The first is a non-console executable with a .exe extension, the second
> is a console version with a .com extension.  I know how to build the
> first, and I can build the second if I give it a different name and use
> a .exe extension, but I've not found a means of getting cmake to
> generate an executable with a .com extension.  Has anybody needed to
> deal with this issue before?

Perhaps try set_target_properties?

set_target_properties(MY_COM_TARGET PROPERTIES SUFFIX ".com")

It's a long time since I've used this, so I can't remember whether you
need the '.' in the property.

Michael


More information about the CMake mailing list