# FindICE.cmake

**URL:** <https://www.ruby-forum.com/t/findice-cmake/240804>\
**Category:** GNU Radio\
**Created:** [May 1, 2014, 3:12am UTC](https://www.ruby-forum.com/t/findice-cmake/240804 "2014-05-01T03:12:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 1, 2014, 3:12am UTC](https://www.ruby-forum.com/t/findice-cmake/240804/1 "2014-05-01T03:12:45Z")

</div>

I’m trying to build gnu radio with control port, but cmake won’t find  
my Ice installation. I have Ice-3.4 installed through apt on Ubuntu  
13.10. Digging in to the FindIce.cmake I made the following changes:

diff --git a/cmake/Modules/FindICE.cmake b/cmake/Modules/FindICE.cmake  
index 087ee9b…705c019 100644  
— a/cmake/Modules/FindICE.cmake  
+++ b/cmake/Modules/FindICE.cmake  
@@ -4,7 +4,7 @@  
FIND\_PACKAGE(PkgConfig)  
PKG\_CHECK\_MODULES(PC\_ICE Ice-3.4 QUIET)

-if(NOT ICE\_FOUND)  
+if(NOT PC\_ICE\_FOUND)

# Maybe we don’t have a .pc file for Ice. Check for Config.h. If

# that exists, get the version string and parse it for the proper

# version.

@@ -21,11 +21,11 @@ if(NOT ICE\_FOUND)  
set(ICE\_FOUND TRUE)  
endif(ICE\_FOUND)  
endif(ICE\_CONFIG\_INCLUDE\_DIR)  
-endif(NOT ICE\_FOUND)  
+endif(NOT PC\_ICE\_FOUND)

-if(NOT ICE\_FOUND)  
+if(NOT PC\_ICE\_FOUND)  
message(STATUS " package ‘Ice-3.4’ not found")  
-endif(NOT ICE\_FOUND)  
+endif(NOT PC\_ICE\_FOUND)

# Recheck if we found the right version of ICE and proceed if true.

This at least squelches the ‘package Ice-3.4 not found’ message, which  
is an improvement. (I test this with cmake -P . I’m  
still not able to get cmake to configure GNU Radio to build  
control-port, and this is already extending my cmake-fu.

I’ve only managed to get this configured properly through PyBOMBS. Any  
suggestions on fixing this module to properly detect a distro  
installed Ice?

Nathan

---

<div class="post-metadata">

**Author:** ![WestS\_Nathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8baadc/32.png) [@WestS\_Nathan](https://www.ruby-forum.com/u/WestS_Nathan)\
**Post date:** [May 1, 2014, 3:25pm UTC](https://www.ruby-forum.com/t/findice-cmake/240804/2 "2014-05-01T15:25:40Z")

</div>

On Wed, Apr 30, 2014 at 9:11 PM, West, Nathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> PKG\_CHECK\_MODULES(PC\_ICE Ice-3.4 QUIET)  
> -endif(NOT ICE\_FOUND)

Nathan,  
Yeah, I suspect you’re right on the use of the PC\_ for the variables.

Have you made sure that python-zeroc-ice is also installed?

Tom

---

<div class="post-metadata">

**Author:** ![WestS\_Nathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8baadc/32.png) [@WestS\_Nathan](https://www.ruby-forum.com/u/WestS_Nathan)\
**Post date:** [May 7, 2014, 9:20am UTC](https://www.ruby-forum.com/t/findice-cmake/240804/3 "2014-05-07T09:20:21Z")

</div>

Ok, yeah, I think I’ve figured out the problem. They completely changed  
the  
ICE package config files and the location of the libraries in 14.04. The  
package config file doesn’t have any include dirs specified and the  
library  
points to an installed Microsoft DLL, which seems… strange to me.  
Basically, I’m thinking that using the package config for Ice is  
worthless,  
so I’m going to strip it out of the FindICE-3.5.cmake file (we’ll be  
pushing up the minimum required version of ICE to 3.5 with our release  
of  
v3.8.0, anyways, so support for 3.4 will go away).

The other big issue is that the libraries are installed for multi-arch  
support, so they are located in /usr/lib/libIceX.so, anymore. And we’re  
using NO\_DEFAULT\_PATH when looking for libraries. I /think/ we started  
using that setting to support OS X builds. I have this working now on a  
VM,  
but I’m going to have to work on patching FindIce-3.5.cmake a little  
more  
to make sure everything’s ok and test it on multiple platforms (yay…).

If you’ve followed what I said above, you should be able to quickly fix  
this locally on your own machine. Basically:

- remove the use of package config (comment out PKG\_CHECK\_MODULE)
- remove the use of NO\_DEFAULT\_PATH in the FIND\_LIBRARY commands

Tom

---

<div class="post-metadata">

**Author:** ![WestS\_Nathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8baadc/32.png) [@WestS\_Nathan](https://www.ruby-forum.com/u/WestS_Nathan)\
**Post date:** [May 7, 2014, 11:54pm UTC](https://www.ruby-forum.com/t/findice-cmake/240804/4 "2014-05-07T23:54:45Z")

</div>

I can confirm that this solved the issue and I’m able to build with  
Ubuntu’s version of Ice. However, I think this also affects 13.10  
(that’s what I’ve been using and I upgraded specifically to get  
ice-3.5).

Thanks Tom.

---

<div class="post-metadata">

**Author:** ![WestS\_Nathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8baadc/32.png) [@WestS\_Nathan](https://www.ruby-forum.com/u/WestS_Nathan)\
**Post date:** [May 1, 2014, 10:04pm UTC](https://www.ruby-forum.com/t/findice-cmake/240804/5 "2014-05-01T22:04:09Z")

</div>

On Thu, May 1, 2014 at 8:23 AM, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > +++ b/cmake/Modules/FindICE.cmake  
> > set(ICE\_FOUND TRUE)
> > 
> > installed Ice?  
> > Tom

Yea, python-zeroc-ice is installed. If I replace all of the ICE\_FOUND  
instances with PC\_ICE\_FOUND then I get a syntax error on line 36:  
string(REGEX REPLACE “/include” “” ICE\_PATH  
${ICE\_CONFIG\_INCLUDE\_DIR}). I Don’t see where ICE\_PATH is being set in  
the first place.

Nathan

---

<div class="post-metadata">

**Author:** ![WestS\_Nathan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/8baadc/32.png) [@WestS\_Nathan](https://www.ruby-forum.com/u/WestS_Nathan)\
**Post date:** [May 8, 2014, 3:24am UTC](https://www.ruby-forum.com/t/findice-cmake/240804/6 "2014-05-08T03:24:26Z")

</div>

On Wed, May 7, 2014 at 5:53 PM, West, Nathan  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> I can confirm that this solved the issue and I’m able to build with  
> Ubuntu’s version of Ice. However, I think this also affects 13.10  
> (that’s what I’ve been using and I upgraded specifically to get  
> ice-3.5).
> 
> Thanks Tom.

Great, thanks for testing! I’ve pushed a branch to my github repo called  
cmake\_ice\_libs that addresses the issues for both Ice 3.4 and 3.5. I’ll  
use  
it tomorrow to test my various setups in-house, but any other feedback  
about it’s applicability or problems will be helpful!

[https://github.com/trondeau/gnuradio/tree/cmake\_ice\_libs](https://github.com/trondeau/gnuradio/tree/cmake_ice_libs)

Thanks,  
Tom
