Re: [cmake-developers] [PATCH] New module: FindIce.cmake

2014-08-12 Thread Roger Leigh
On Tue, Aug 12, 2014 at 09:08:57PM +0100, Roger Leigh wrote:
> On Mon, Aug 11, 2014 at 11:07:57AM -0400, Brad King wrote:
> > On 08/08/2014 08:56 AM, Roger Leigh wrote:
> > > On Thu, Aug 07, 2014 at 06:49:28PM +0100, Roger Leigh wrote:
> 
> > 3. There is a lot of hard-coded version-specific information
> >that will require constant maintenance and new releases
> >of CMake as the upstream versions change.  This is not
> >maintainable, and is one reason the package configuration
> >file approach linked above is much preferred to a Find
> >module.  Are there Windows Registry entries available
> >that specify the install location?
> 
> I have reworked this so that it loops through all the variants
> which are compatible with the generator in use, plus fallbacks.
> The disadvantage is that this now means that on Windows you
> won't get an outright failure if the visual studio version
> mismatches with the detected libraries whereas the previous
> approach hardcoded all that knowledge.  That said, it's a
> whole lot more flexible and maintainable this way and so is an
> acceptable tradeoff.
> 
> Regarding the Windows Registry, I've taken a look and it looks
> like there might be some usable keys from the installer which
> could be used, but I'll need to do further digging with all
> the different versions to see what's most usable here.

This turned out to be fairly simple at least for Ice versions
3.4.0 - 3.5.1, which all have the same naming convention.
Earlier versions have odd naming conventions and are in
Wow6432Node so I've not included them (they are obsolete in
any case, and ICE_HOME can be set to use them).

I've attached an updated copy which now includes using the
registry.  Happy to make any further improvements if needed.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
>From 3464e856d09de090a17ca7d8ce3e35b3caff4746 Mon Sep 17 00:00:00 2001
From: Roger Leigh 
Date: Thu, 7 Aug 2014 18:37:36 +0100
Subject: [PATCH] FindIce: New module to find ZeroC Ice

- autodetects Ice on all major platforms
- allows building with all supported Visual Studio versions on Windows
- autodetects the slice path on most platforms
- separately detects the Ice programs, headers, slice files and
  libraries so that any Ice configuration or installation errors can
  be accurately reported, making diagnosis of Ice problems simpler
---
 Help/manual/cmake-modules.7.rst |   1 +
 Help/module/FindIce.rst |   1 +
 Modules/FindIce.cmake   | 443 
 3 files changed, 445 insertions(+)
 create mode 100644 Help/module/FindIce.rst
 create mode 100644 Modules/FindIce.cmake

diff --git a/Help/manual/cmake-modules.7.rst b/Help/manual/cmake-modules.7.rst
index 91fffe9..737057c 100644
--- a/Help/manual/cmake-modules.7.rst
+++ b/Help/manual/cmake-modules.7.rst
@@ -114,6 +114,7 @@ All Modules
/module/FindHg
/module/FindHSPELL
/module/FindHTMLHelp
+   /module/FindIce
/module/FindIcotool
/module/FindImageMagick
/module/FindITK
diff --git a/Help/module/FindIce.rst b/Help/module/FindIce.rst
new file mode 100644
index 000..3af9405
--- /dev/null
+++ b/Help/module/FindIce.rst
@@ -0,0 +1 @@
+.. cmake-module:: ../../Modules/FindIce.cmake
diff --git a/Modules/FindIce.cmake b/Modules/FindIce.cmake
new file mode 100644
index 000..2930e2d
--- /dev/null
+++ b/Modules/FindIce.cmake
@@ -0,0 +1,443 @@
+#.rst:
+# FindIce
+# ---
+#
+# Find the ZeroC Internet Communication Engine (ICE) programs,
+# libraries and datafiles.
+#
+# Use this module by invoking find_package with the form::
+#
+#   find_package(Ice
+# [version] [EXACT]   # Minimum or EXACT version e.g. 3.5.1
+# [REQUIRED]  # Fail with error if Ice is not found
+# [COMPONENTS ]) # Ice libraries by their name
+#
+# Components can include any of: Freeze Glacier2 Ice IceBox IceDB
+# IceGrid IcePatch IceSSL IceStorm IceUtil IceXML Slice.
+#
+# This module reports information about the Ice installation in
+# several variables.  General variables::
+#
+#   Ice_VERSION - Ice release version
+#   Ice_FOUND - true if the main programs and libraries were found
+#   ICE_LIBRARIES - component libraries to be linked
+#   Ice_BINARY_DIR - the directory containing the Ice programs
+#   Ice_INCLUDE_DIR - the directory containing the Ice headers
+#   Ice_SLICE_DIR - the directory containing the Ice slice interface definitions
+#   Ice_LIBRARY_DIR - the directory containing the Ice libraries
+#
+# Ice programs are reported in::
+#
+#   Ice_SLICE2CPP_EXECUTABLE - path to slice2cpp executable
+#   Ice_SLICE2CS_EXECUTABLE - path to slice2cs executable
+#   Ice_SLICE2FREEZEJ_EXECUTABLE - path to slice2freezej executable
+#   Ice_SLICE2FREEZE_EXECUTABLE - path to slice2freeze execu

Re: [cmake-developers] [PATCH] New module: FindIce.cmake

2014-08-12 Thread Roger Leigh
On Mon, Aug 11, 2014 at 11:07:57AM -0400, Brad King wrote:
> On 08/08/2014 08:56 AM, Roger Leigh wrote:
> > On Thu, Aug 07, 2014 at 06:49:28PM +0100, Roger Leigh wrote:
> >> Hi,
> >>
> >> I've written a module for finding the details of a ZeroC ICE installation,
> >> attached, which I thought might be of interest to a wider audience and be
> >> suitable for direct inclusion into cmake.  I've attached the patch for 
> >> this.
> >> The docs should be correct, but I'm not yet totally familiar with the cmake
> >> docs build, so it might possibly need some minor tweaking.
> > 
> > I have added a few portability and documentation fixes.  Updated copy
> > attached.
> 
> Thanks for working on this.  The patch looks pretty complete.
> 
> Is it possible to convince ZeroC ICE to provide a CMake
> Package Configuration File as documented here:
> 
>  http://www.cmake.org/cmake/help/v3.0/manual/cmake-packages.7.html

I will certainly ask them if they will consider it.

> ?  That would be much more maintainable and allows for much more
> powerful CMake interfaces to be used.  It is the CMake equivalent
> of a pkg-config .pc file, but is much more powerful.
> 
> Otherwise we can consider the module here, but we ask that you
> commit to regular maintenance as the upstream changes.

I'm currently working on this for my job, and so will be keeping this
up to date.  I just thought it would benefit being upstream so that
others can benefit from it.  I'll also make the upstream aware of it.
They release fairly infrequently, so I don't expect updates generally
more than once or twice a year, if that.

While a configuration file would be ideal for new releases, the
proposed find script will cater for their most recent releases
to date, and as such will support all current Linux, Mac and
Windows users.

> As for the module itself, there are a few problems:

I hope that the new patch (attached) addresses these problems.  I
hope this is more acceptable, and I'll be happy to make any additional
changes.

> 1. The legal notice block is not of the proper format and
>fails the CMake.ModuleNotices test.

This should be fixed.

> 2. The module provides singular names like _LIBRARY as its
>output.  Please read
> 
> 
> http://www.cmake.org/cmake/help/v3.0/manual/cmake-developer.7.html#find-modules
> 
>for conventions on variable naming.  The find_* command
>cached result variables should not overlap with the output
>variables from the module.

I read through the conventions and fixed things to work as best as
I understood things.  I also switched to supporting COMPONENTS
and OPTIONAL_COMPONENTS for all the separate libraries.

> 3. There is a lot of hard-coded version-specific information
>that will require constant maintenance and new releases
>of CMake as the upstream versions change.  This is not
>maintainable, and is one reason the package configuration
>file approach linked above is much preferred to a Find
>module.  Are there Windows Registry entries available
>that specify the install location?

I have reworked this so that it loops through all the variants
which are compatible with the generator in use, plus fallbacks.
The disadvantage is that this now means that on Windows you
won't get an outright failure if the visual studio version
mismatches with the detected libraries whereas the previous
approach hardcoded all that knowledge.  That said, it's a
whole lot more flexible and maintainable this way and so is an
acceptable tradeoff.

Regarding the Windows Registry, I've taken a look and it looks
like there might be some usable keys from the installer which
could be used, but I'll need to do further digging with all
the different versions to see what's most usable here.

> 4. Rather than repeatedly testing CMAKE_SIZEOF_VOID_P,
>save the "/x64" suffix in a "${_x64}" variable.

Also fixed now.

If you had any further comments on the attached revision, I'll
be happy to make any further changes as needed, and as noted
above I'll also look at the registry stuff.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linuxhttp://people.debian.org/~rleigh/
 `. `'   schroot and sbuild  http://alioth.debian.org/projects/buildd-tools
   `-GPG Public Key  F33D 281D 470A B443 6756 147C 07B3 C8BC 4083 E800
>From e9c1ce9a8df62904e69ac687b6e0ed4f4aa769f8 Mon Sep 17 00:00:00 2001
From: Roger Leigh 
Date: Thu, 7 Aug 2014 18:37:36 +0100
Subject: [PATCH] FindIce: New module to find ZeroC Ice

- autodetects Ice on all major platforms
- allows building with all supported Visual Studio versions on Windows
- autodetects the slice path on most platforms
- separately detects the Ice programs, headers, slice files and
  libraries so that any Ice configuration or installation errors can
  be accurately reported, making diagnosis of Ice problems simpler
---
 Help/manual/cmake-modules.7.rst |   1 +
 Help/module/FindIce.rst |   1 +
 Modules/FindIce.cmake   | 461 

Re: [cmake-developers] [update]: CPack IFW generator

2014-08-12 Thread Brad King
On 08/12/2014 02:57 PM, Konstantin Podsvirov wrote:
> Update for the last week in one commit:
> http://git.podsvirov.pro/?p=kitware/cmake.git;a=commit;h=5ee02291d0c4dde21a4ecb513dd69cbb0157ddf6

Thanks.  I revised the commit slightly to not un-do some of my
earlier cleanups (we can't use that temporary "option" pointer
without warnings on several compilers about assignment in 'if'):

 CPackIFW: Revise this generator
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6496b60

Please base further work by starting a branch from e6496b60,
or from 'master' once it is merged there.  As I accept each
change I may revise it slightly, so then you should rebase
further work on the upstream version each time.

Thanks,
-Brad

-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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


Re: [cmake-developers] [update]: CPack IFW generator

2014-08-12 Thread Konstantin Podsvirov
Hello dear developers, and of course Brad!

11.08.2014, 18:38, "Brad King" :
> After some fixes for nightly testing this is now in 'master'...

Thank you that my small contribution is now available for the rest :-)

>> FYI, if you were to start a new branch and base your changes
>> off the upstream version instead of merging it then I would
>> not have to keep squashing away your history as much.
>
> Something like this:
>
> git checkout-b cpack-ifw-updates 2fdd5d88

Thanks for the hints.

The branch with the changes:
http://git.podsvirov.pro/?p=kitware/cmake.git;a=shortlog;h=refs/heads/cpack-ifw-updates

Update for the last week in one commit:
http://git.podsvirov.pro/?p=kitware/cmake.git;a=commit;h=5ee02291d0c4dde21a4ecb513dd69cbb0157ddf6

I hope that soon these changes will be accepted.

Regards,
Konstantin Podsvirov
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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