MantisBT - CMake
View Issue Details
0010389CMakeCMakepublic2010-03-08 18:222016-06-10 14:31
d3x0r 
Bill Hoffman 
normalfeaturealways
closedmoved 
CMake-2-8 
 
0010389: To correctly support watcom, a few additional flags are needed.

Already there exists CMAKE_SHARED_LIBRARY_C_FLAGS to add flags to compile when building a library, but as far as I can tell, the related flags for building window and console mode applications does not exist..

I would suggest adding these... in the vein of _SHARED_LIBRARY_
CMAKE_WIN32_C_FLAGS
CMAKE_CONSOLE_C_FLAGS

I might also suggest
CMAKE_EXECUTABLE_C_FLAGS

to be added as a base for CMAKE_WIN32_C_FLAGS and CMAKE_CONSOLE_C_FLAGS if neither of those are defined.

-------------------

Also, a method to specify the system build type might be a nice feature to add to the core platform generator. There is an option for watcom '-bt' which specifies the build target system. It can be one of these values...
  "" - blank is default to current system type (the type the current tools are )
  "NT", "OS2", "DOS", "QNX" ... for their respective systems.

Although at an upper level I can set something like
set_property(CACHE CMAKE_WATCOM_BUILD_TYPE PROPERTY STRINGS
               "" "NT" "OS2" "DOS" "QNX")

When I try to use ${CMAKE_WATCOM_BUILD_TYPE} in the compile rule, it is not set when I change the value of BUILD_TYPE.

No tags attached.
Issue History
2010-03-08 18:22d3x0rNew Issue
2010-03-09 08:38Bill HoffmanNote Added: 0019773
2010-03-09 08:38Bill HoffmanStatusnew => assigned
2010-03-09 08:38Bill HoffmanAssigned To => Bill Hoffman
2010-06-14 19:07d3x0rNote Added: 0021010
2010-08-31 15:30David ColeNote Added: 0022026
2016-06-10 14:27Kitware RobotNote Added: 0041666
2016-06-10 14:27Kitware RobotStatusassigned => resolved
2016-06-10 14:27Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0019773)
Bill Hoffman   
2010-03-09 08:38   
I don't see the need for these:

CMAKE_WIN32_C_FLAGS
CMAKE_CONSOLE_C_FLAGS

CMAKE_C_FLAGS should work for those. What would be specific to win32 or console other than the flag that makes it console or win32?
(0021010)
d3x0r   
2010-06-14 19:07   
They are nessecary in the support of open watcom compiler.

-bc build target is a console application
-bd build target is a dynamic link library (DLL)
-bg build target is a GUI application
-bm build target is a multi-thread environment
-br build target uses DLL version of C/C++ run-time library
-bt[=<id>] build target is operating system <id>
-bw build target is a default windowing application

These are C flags that are passed during compile time, and change the outcome of the object between object that works, and object that fails to do anything. Very importantly is -br (relocatable), which static libraries can be compiled without, but DLLs definatly require.

-bw and -bc switch the behavior how the object starts (whether it calls WinMain or main), and also switch how stdio is handled I think (since with -bc, there are standard handles, while without, there is no console available)
(0022026)
David Cole   
2010-08-31 15:30   
We will not be addressing this for the upcoming CMake 2.8.3 release.
(0041666)
Kitware Robot   
2016-06-10 14:27   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.