Re: [cmake-developers] Cmake contribution for Open Watcom (patch)

2014-03-05 Thread Brad King
On 02/28/2014 02:38 PM, Jiri Malak wrote:
 FYI, you can run the test suite with the Open Watcom compiler
 by configuring to build with another compiler but setting
 CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM to be
 Watcom WMake and c:/path/to/wmake.exe, respectively.
 Then after building, open a terminal in an environment set up
 for Open Watcom and run bin\ctest to run the tests.  Add
 options -j 8 for parallel testing or -R someregex to
 run a subset of tests or -V to see verbose test output.
 
 Thanks for hint, it is very useful.

After working that way for years, by coincidence I just changed
testing for Open Watcom to use another approach that will be
easier to generalize for other compilers.

Now after building CMake with another compiler, open a terminal
with the environment configured for Open Watcom and do:

 mkdir CMake-ow-build
 cd CMake-ow-build
 cmake ../CMake -G Watcom WMake -DCMake_TEST_EXTERNAL_CMAKE=...

where the ... value is a path to the directory containing the
cmake, ctest, and cpack executables to be tested, such as:

 c:/path/to/CMake-other-build/bin

Then run

 wmake

in case there are any test-only binaries to build.  Finally run

 ctest

to launch the tests.  The ctest -j/-R/-V/etc. options will still work.

-Brad

-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Cmake contribution for Open Watcom (patch)

2014-02-28 Thread Brad King
On 02/28/2014 12:57 PM, Jiri Malak wrote:
 I would like contribute to CMake for Open Watcom Toolchain.

Thanks!

I've integrated the first change for testing here:

 Watcom: Fix static library name quoting for wlib
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;hb=5c5be193

with one tweak:

 -set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b 
 'TARGET_UNQUOTED' LINK_FLAGS OBJECTS )
 +set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b 
 TARGET_QUOTED OBJECTS )

The LINK_FLAGS placeholder is still needed.  It gets the
STATIC_LIBRARY_FLAGS:

 
http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_tgt:STATIC_LIBRARY_FLAGS

The LinkFlags* tests revealed this when I tested locally.

FYI, you can run the test suite with the Open Watcom compiler
by configuring to build with another compiler but setting
CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM to be
Watcom WMake and c:/path/to/wmake.exe, respectively.
Then after building, open a terminal in an environment set up
for Open Watcom and run bin\ctest to run the tests.  Add
options -j 8 for parallel testing or -R someregex to
run a subset of tests or -V to see verbose test output.

In order to generalize support for this compiler to other
platforms the Platform/Windows-wcl386.cmake module will need
to be refactored into the modern way of dividing platform
information across multiple files.  See the

 Compiler/GNU.cmake
 Compiler/GNU-C.cmake
 Compiler/GNU-CXX.cmake
 Platform/Windows-GNU.cmake
 Platform/Windows-GNU-C.cmake
 Platform/Windows-GNU-CXX.cmake

files.  One might refactor Platform/Windows-wcl386.cmake into

 Compiler/Watcom.cmake
 Compiler/Watcom-C.cmake
 Compiler/Watcom-CXX.cmake
 Platform/Windows-Watcom.cmake
 Platform/Windows-Watcom-C.cmake
 Platform/Windows-Watcom-CXX.cmake

for example.

Thanks,
-Brad

-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Cmake contribution for Open Watcom (patch)

2014-02-28 Thread Jiri Malak
 Thanks!

 I've integrated the first change for testing here:

  Watcom: Fix static library name quoting for wlib
  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;hb=5c5be193

 with one tweak:

 -set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b 
 'TARGET_UNQUOTED'
 LINK_FLAGS OBJECTS )
 +set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b 
 TARGET_QUOTED
 OBJECTS )

 The LINK_FLAGS placeholder is still needed.  It gets the
 STATIC_LIBRARY_FLAGS:

  
 http://www.cmake.org/cmake/help/v2.8.12/cmake.html#prop_tgt:STATIC_LIBRARY_FLAGS

 The LinkFlags* tests revealed this when I tested locally.


Good to know. It is confusing to mix Librarian flags with Linker flags.
It was for some historical reason?

 FYI, you can run the test suite with the Open Watcom compiler
 by configuring to build with another compiler but setting
 CMAKE_TEST_GENERATOR and CMAKE_TEST_MAKEPROGRAM to be
 Watcom WMake and c:/path/to/wmake.exe, respectively.
 Then after building, open a terminal in an environment set up
 for Open Watcom and run bin\ctest to run the tests.  Add
 options -j 8 for parallel testing or -R someregex to
 run a subset of tests or -V to see verbose test output.


Thanks for hint, it is very useful.

 In order to generalize support for this compiler to other
 platforms the Platform/Windows-wcl386.cmake module will need
 to be refactored into the modern way of dividing platform
 information across multiple files.  See the

  Compiler/GNU.cmake
  Compiler/GNU-C.cmake
  Compiler/GNU-CXX.cmake
  Platform/Windows-GNU.cmake
  Platform/Windows-GNU-C.cmake
  Platform/Windows-GNU-CXX.cmake

 files.  One might refactor Platform/Windows-wcl386.cmake into

  Compiler/Watcom.cmake
  Compiler/Watcom-C.cmake
  Compiler/Watcom-CXX.cmake
  Platform/Windows-Watcom.cmake
  Platform/Windows-Watcom-C.cmake
  Platform/Windows-Watcom-CXX.cmake

 for example.

I a little studied CMake internals, that it is exactly what I want to do.
I will add also OW Fortran compiler and OW asseblers definitions.

Regards

Jiri


-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Cmake contribution for Open Watcom (patch)

2014-02-28 Thread Brad King
On 02/28/2014 02:38 PM, Jiri Malak wrote:
 The LINK_FLAGS placeholder is still needed.  It gets the
 STATIC_LIBRARY_FLAGS:
 It is confusing to mix Librarian flags with Linker flags.

The LINK_FLAGS placeholder is just an implementation detail
whose name does not matter.  For actual linker calls it gets the
LINKER_FLAGS information but for librarian and archiver calls
(for STATIC libs) it gets the STATIC_LIBRARY_FLAGS value, not
any linker flags.

-Brad

-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Cmake contribution for Open Watcom (patch)

2014-02-28 Thread J Decker
That continues to be broken for what we talked about in the newsgroup;

The wlib should be removed *???*


On Fri, Feb 28, 2014 at 9:57 AM, Jiri Malak malak.j...@gmail.com wrote:

 Hi,

 I would like contribute to CMake for Open Watcom Toolchain.
 Now only WIN32 host and target is supported.
 I plan to add cross-compilation configuration for all supported hosts and 
 target.
 By example enable user on Linux cross compile for DOS/WIN16/win32/OS2
 etc.

 I enclosed first fix for existing bug in OW support.

 From 503538874023eeddac975eb09660d59f4067fcd9 Mon Sep 17 00:00:00 2001
 From: Jiri Malak malak.j...@gmail.com 
 http://192.168.0.2/posta/src/compose.php?send_to=malak.jiri%40gmail.com
 Date: Fri, 28 Feb 2014 18:21:52 +0100
 Subject: [PATCH] Open Watcom Module Windows-wcl386.cmake fix

 fix incorrect quoting of library name, now it is double quote instead of 
 incorrect
 single quote
 ---
  Modules/Platform/Windows-wcl386.cmake | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/Modules/Platform/Windows-wcl386.cmake
 b/Modules/Platform/Windows-wcl386.cmake
 index 8a03b29..329e6f0 100644
 --- a/Modules/Platform/Windows-wcl386.cmake
 +++ b/Modules/Platform/Windows-wcl386.cmake
 @@ -40,7 +40,7 @@ set (CMAKE_C_STANDARD_LIBRARIES_INIT library clbrdll.lib 
 library
 plbrdll.lib  l
  set (CMAKE_CXX_STANDARD_LIBRARIES_INIT ${CMAKE_C_STANDARD_LIBRARIES_INIT})

  set(CMAKE_C_CREATE_IMPORT_LIBRARY
 -  wlib -c -q -n -b TARGET_IMPLIB +'TARGET_UNQUOTED')
 +  wlib -c -q -n -b TARGET_IMPLIB +TARGET_QUOTED)
  set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})

  set(CMAKE_C_LINK_EXECUTABLE
 @@ -78,7 +78,7 @@ set(CMAKE_C_CREATE_SHARED_LIBRARY 
 ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
  set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})

  # create a C++ static library
 -set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b
 'TARGET_UNQUOTED'
 LINK_FLAGS OBJECTS )
 +set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b
 TARGET_QUOTED OBJECTS )

  # create a C static library
  set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
 --
 1.8.0.msysgit.0

 Regards

 Jiri



 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] Cmake contribution for Open Watcom (patch)

2014-02-28 Thread J Decker
THere is 'toolchain' support sort-of in cmake, for selecting targets

Something else that cmake building is lacking is a working RC compiler
default...

 SET( CMAKE_RC_COMPILER rc )

# I dunno; something about floating point, not sure if it's required it's
from long ago... probably because I was linking to stdio sscanf but didn't
use a string that had a %g or %f in it so floating point support wasn't
linkin...
 set( ExtraFlags ${ExtraFlags} /fp5 /fpi87 )


 # this flag is for build dll?  emit DllRuntime startup link
#set( LibraryExtraFlags -bd )


 set( ConsoleProgramExtraFlags -bc )


 set( WindowsProgramExtraFlags -bg )


when adding 'add_executable( target optional WIN32 ... ) '
there is a marker for wheter to include console or windows runtime (select
main or winmain entry points)

and for add_library( target optional SHARED ... ) should add -bd

yes?



On Fri, Feb 28, 2014 at 9:57 AM, Jiri Malak malak.j...@gmail.com wrote:

 Hi,

 I would like contribute to CMake for Open Watcom Toolchain.
 Now only WIN32 host and target is supported.
 I plan to add cross-compilation configuration for all supported hosts and 
 target.
 By example enable user on Linux cross compile for DOS/WIN16/win32/OS2
 etc.

 I enclosed first fix for existing bug in OW support.

 From 503538874023eeddac975eb09660d59f4067fcd9 Mon Sep 17 00:00:00 2001
 From: Jiri Malak malak.j...@gmail.com 
 http://192.168.0.2/posta/src/compose.php?send_to=malak.jiri%40gmail.com
 Date: Fri, 28 Feb 2014 18:21:52 +0100
 Subject: [PATCH] Open Watcom Module Windows-wcl386.cmake fix

 fix incorrect quoting of library name, now it is double quote instead of 
 incorrect
 single quote
 ---
  Modules/Platform/Windows-wcl386.cmake | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/Modules/Platform/Windows-wcl386.cmake
 b/Modules/Platform/Windows-wcl386.cmake
 index 8a03b29..329e6f0 100644
 --- a/Modules/Platform/Windows-wcl386.cmake
 +++ b/Modules/Platform/Windows-wcl386.cmake
 @@ -40,7 +40,7 @@ set (CMAKE_C_STANDARD_LIBRARIES_INIT library clbrdll.lib 
 library
 plbrdll.lib  l
  set (CMAKE_CXX_STANDARD_LIBRARIES_INIT ${CMAKE_C_STANDARD_LIBRARIES_INIT})

  set(CMAKE_C_CREATE_IMPORT_LIBRARY
 -  wlib -c -q -n -b TARGET_IMPLIB +'TARGET_UNQUOTED')
 +  wlib -c -q -n -b TARGET_IMPLIB +TARGET_QUOTED)
  set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})

  set(CMAKE_C_LINK_EXECUTABLE
 @@ -78,7 +78,7 @@ set(CMAKE_C_CREATE_SHARED_LIBRARY 
 ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
  set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})

  # create a C++ static library
 -set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b
 'TARGET_UNQUOTED'
 LINK_FLAGS OBJECTS )
 +set(CMAKE_CXX_CREATE_STATIC_LIBRARY  wlib ${CMAKE_LIB_QUIET} -c -n -b
 TARGET_QUOTED OBJECTS )

  # create a C static library
  set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
 --
 1.8.0.msysgit.0

 Regards

 Jiri



 --

 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers