openmicroscopy/openmicroscopy — pull request #2949 by rleigh-dundee (2014-08-15 14:17:25+00:00)
Title: cmake: FindIce: Additional improvements

- result of a few rounds of review with cmake upstream
- logic greatly simplified and more maintainable
- detects Windows Ice packages using the registry
- much easier to override autodetected programs/libs/paths with cmake cache variables
- follows cmake find package conventions

--no-rebase

--------

Testing:

- jobs should remain green
- Should build on all platforms with:

```
GTEST_ROOT=/path/to/gtest cmake -DICE_DEBUG=ON /path/to/openmicroscopy
```

- On MacOS X with an unlinked Ice and XQuartz installed, add the options (for example):

```
-DICE_HOME=/usr/local/Cellar/ice/3.5.1 -DICE_ICE_LIBRARIES=/usr/local/Cellar/ice/3.5.1/lib/libIce.dylib -DICE_SLICE_DIR=/usr/local/Cellar/ice/3.5.1/share/Ice-3.5/slice
```

This is because the ICE_HOME layout is nonstandard, so the slice directory needs specifying manually. Also, XQuartz libICE is detected instead of libIce due to the MacOS X case insensitivity, so ICE_ICE_LIBRARIES overrides the incorrect autodetection. Thanks to Apple and ZeroC for case insensitivity and reusing existing library names; MacPorts works around this by calling it something like libZeroC-Ice.dylib to work around the problem. I'll see if this can be further improved, but it's really a limitation of MacOS X and it works fine with correctly installed homebrew Ice.