Re: [CMake] Executable extension (MSVC)

2008-05-15 Thread PCJohn

Good morning,

thanks for all your comments. Here are the results:

- it seems to me that cmake is building console applications by default 
(/SUBSYSTEM:CONSOLE).
That is correct for my .com applications. For the .exe, I will need 
WINDOWS subsystem. Any possiblities in cmake?


- for the suffix, I Alan's suggestion (SUFFIX property for 
SET_TARGET_PROPERTIES) works like a charm. Thanks.


John


John Drescher napsal(a):

 I know for a fact that this is not correct. I have written my own
 single windows applications that have a gui and a console and it is a
 .exe. Link the gui application with subsystem console.



Ok. I found what I do. I have a post build step (in a vc6 project
.dsp) that changes the subsystem to console after the build.

PostBuild_Cmds=editbin /SUBSYSTEM:CONSOLE $(TARGETPath)

John
  

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-15 Thread Werner Smekal

Hi John,

- it seems to me that cmake is building console applications by  
default (/SUBSYSTEM:CONSOLE).
That is correct for my .com applications. For the .exe, I will need  
WINDOWS subsystem. Any possiblities in cmake?



Use the WIN32 option of the add_executable command:

http://www.cmake.org/HTML/cmake-2.6.html#command:add_executable

Regards,
Werner

--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-15 Thread PCJohn

 Use the WIN32 option of the add_executable command:
 http://www.cmake.org/HTML/cmake-2.6.html#command:add_executable

Thanks. For any other interested people:
- this switches using of main to WinMain
- to switch it back, you can use
set_target_properties (autoconsole
  PROPERTIES LINK_FLAGS /ENTRY:main)

Thanks all involved people. The project compiles now and this .com  
.exe feature will be available in the next project release together with 
cmake support.

John


Werner Smekal napsal(a):

Hi John,

- it seems to me that cmake is building console applications by 
default (/SUBSYSTEM:CONSOLE).
That is correct for my .com applications. For the .exe, I will need 
WINDOWS subsystem. Any possiblities in cmake?



Use the WIN32 option of the add_executable command:

http://www.cmake.org/HTML/cmake-2.6.html#command:add_executable

Regards,
Werner

--
Dr. Werner Smekal
Institut fuer Allgemeine Physik
Technische Universitaet Wien
Wiedner Hauptstr 8-10
A-1040 Wien
Austria

email: [EMAIL PROTECTED]
web: http://www.iap.tuwien.ac.at/~smekal
phone: +43-(0)1-58801-13463 (office), +43-(0)1-58801-13469 (laboratory)
fax: +43-(0)1-58801-13499

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread Alan W. Irwin

On 2008-05-14 15:20+0200 PCJohn wrote:


Dear cmakers,

I really need to set executable extension to .com instead to standard .exe 
(using MSVC). Is it possible to do that, or do I need to not use cmake for 
win32 platform?


Look at the SUFFIX property for SET_TARGET_PROPERTIES.

Alan
__
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__

Linux-powered Science
__
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread Bill Hoffman

PCJohn wrote:

Dear cmakers,

I really need to set executable extension to .com instead to standard 
.exe (using MSVC). Is it possible to do that, or do I need to not use 
cmake for win32 platform?


Reasons:
I planned to port InventorTools utilities 
(http://merlin.fit.vutbr.cz/wiki/index.php/Open_Inventor_Tools) to 
cmake, I am using dual gui/console behaviour (like the one described 
at http://www.codeguru.com/Cpp/W-D/console/redirection/article.php/c3955).

In short: two executable exists - utility.com and utility.exe.
If I type utility or utility.com in windows console, I can work with the 
application as with ordinary console application.
When I run utility.exe (started from Explorer or by shortcut, or Windows 
gui), I get normal Windows application - no annoying console, just gui.
This can not be realized in single executable. utility.com always opens 
console, even when started from gui, and utility.exe never communicate 
through console - as given by nature of Windows :( . Just both of them 
can do the thing.
Everything worked perfectly in MSVC, however I am unable to reconstruct 
the scenario in cmake due to difficulties with com extension.




What are the flags used in MSVC to create a .com file?

-Bill
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread John Drescher
  What are the flags used in MSVC to create a .com file?

I assume you need a very old version of msvc to support 16 bit
compiles. Microsoft compilers have not supported this since version
4.X I believe which was more than 10 years ago.

John
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread John Drescher
On Wed, May 14, 2008 at 9:20 AM, PCJohn [EMAIL PROTECTED] wrote:
 Dear cmakers,

  I really need to set executable extension to .com instead to standard .exe
 (using MSVC). Is it possible to do that, or do I need to not use cmake for
 win32 platform?

  Reasons:
  I planned to port InventorTools utilities
 (http://merlin.fit.vutbr.cz/wiki/index.php/Open_Inventor_Tools) to cmake, I
 am using dual gui/console behaviour (like the one described at
 http://www.codeguru.com/Cpp/W-D/console/redirection/article.php/c3955).
  In short: two executable exists - utility.com and utility.exe.
  If I type utility or utility.com in windows console, I can work with the
 application as with ordinary console application.
  When I run utility.exe (started from Explorer or by shortcut, or Windows
 gui), I get normal Windows application - no annoying console, just gui.
  This can not be realized in single executable. utility.com always opens
 console, even when started from gui, and utility.exe never communicate
 through console - as given by nature of Windows :( . Just both of them can
 do the thing.

I know for a fact that this is not correct. I have written my own
single windows applications that have a gui and a console and it is a
.exe. Link the gui application with subsystem console.

John
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread David Cole
No flags, just name the output file .com instead of .exe...

Still works with present day Visual Studio...


On Wed, May 14, 2008 at 1:00 PM, John Drescher [EMAIL PROTECTED] wrote:

   What are the flags used in MSVC to create a .com file?
 
 I assume you need a very old version of msvc to support 16 bit
 compiles. Microsoft compilers have not supported this since version
 4.X I believe which was more than 10 years ago.

 John
 ___
 CMake mailing list
 CMake@cmake.org
 http://www.cmake.org/mailman/listinfo/cmake

___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread Bill Hoffman

John Drescher wrote:

 What are the flags used in MSVC to create a .com file?


I assume you need a very old version of msvc to support 16 bit
compiles. Microsoft compilers have not supported this since version
4.X I believe which was more than 10 years ago.



I don't know about that.  devenv.com is shipped with visual studio.

-Bill
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread clinton
On Wednesday 14 May 2008 11:05:43 am David Cole wrote:
 No flags, just name the output file .com instead of .exe...

Right. 


 Still works with present day Visual Studio...

Even Visual Studio has a tiny devenv.com which probably calls devenv.exe and 
keeps it attached to the console to see output in batch mode.

Clint


 On Wed, May 14, 2008 at 1:00 PM, John Drescher [EMAIL PROTECTED] wrote:
What are the flags used in MSVC to create a .com file?
 
  I assume you need a very old version of msvc to support 16 bit
  compiles. Microsoft compilers have not supported this since version
  4.X I believe which was more than 10 years ago.
 
  John
  ___
  CMake mailing list
  CMake@cmake.org
  http://www.cmake.org/mailman/listinfo/cmake


___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Executable extension (MSVC)

2008-05-14 Thread John Drescher
  I know for a fact that this is not correct. I have written my own
  single windows applications that have a gui and a console and it is a
  .exe. Link the gui application with subsystem console.

Ok. I found what I do. I have a post build step (in a vc6 project
.dsp) that changes the subsystem to console after the build.

PostBuild_Cmds=editbin /SUBSYSTEM:CONSOLE $(TARGETPath)

John
___
CMake mailing list
CMake@cmake.org
http://www.cmake.org/mailman/listinfo/cmake