[CMake] Watcom Support

J Decker d3ck0r at gmail.com
Fri Mar 5 18:59:33 EST 2010


On Fri, Mar 5, 2010 at 6:15 AM, Bill Hoffman <bill.hoffman at kitware.com> wrote:
> J Decker wrote:
>>
>> but then, for every project that already exists, it won't build
>> correctly using watcom, because the options just aren't set in the
>> generator, or 3 more flavors of generators aren't added to support
>> static library, executlable and dynamic library with correct compile
>> time options.
>>
>
> It should go in Modules/Platform/Windows-wcl386.cmake.
>
> Just set these:
> CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT
> CMAKE_SHARED_LINKER_FLAGS_INIT
> CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT
>

I set

SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )

SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )

and made sure to clean my build directory, and re-ran generate with
Watcom WMake  generator.  I would imagine that in
CMakeFiles/project.dir/bulid.make that this line should hvae addtional
options...

	wlink  system nt_dll   name sack_bag.dll option caseexact  file
{$(sack_bag_OBJECTS) $(sack_bag_EXTERNAL_OBJECTS)} library odbc32.lib
library wsock32.lib library ws2_32.lib library opengl32.lib library
odbc32.lib library winmm.lib library iphlpapi.lib library wsock32.lib
library ws2_32.lib library opengl32.lib library winmm.lib library
iphlpapi.lib library clbrdll.lib library plbrdll.lib  library
kernel32.lib library user32.lib library gdi32.lib library winspool.lib
library comdlg32.lib library advapi32.lib library shell32.lib library
ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib
library odbccp32.lib


Only thing I see in the bulid tree that mentions debug all are...

CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=debug all
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=debug all
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=debug all
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=debug all


And nowhere else.

>
> See Windows-cl.cmake for an example, you will also want to set
> RELWITHDEBINFO to have the same flag.  If you can verify this works, I will
> merge into git master for CMake.
>
> -Bill
>


More information about the CMake mailing list