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

Michael Oldfield sag_mal_pluesch at yahoo.com.au
Wed May 7 04:54:46 EDT 2014


On 07/05/14 14:56, J Decker wrote:
> On Tue, May 6, 2014 at 5:54 PM, Michael Oldfield
> <sag_mal_pluesch at yahoo.com.au <mailto:sag_mal_pluesch at yahoo.com.au>> wrote:
> 
>     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")
> 
> 
> that just sets the name, doesn't make a real .com; I don't think cmake
> has that support... have to add link flags probably also
>  
> 
>     It's a long time since I've used this, so I can't remember whether you
>     need the '.' in the property.

Of course, you're right. It's also a long time since I build a .com
executable.

Sorry for the noise,
Michael



More information about the CMake mailing list