# Cmake max version test?

**URL:** <https://www.ruby-forum.com/t/cmake-max-version-test/224169>\
**Category:** GNU Radio\
**Created:** [November 1, 2012, 5:03pm UTC](https://www.ruby-forum.com/t/cmake-max-version-test/224169 "2012-11-01T17:03:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 1, 2012, 5:03pm UTC](https://www.ruby-forum.com/t/cmake-max-version-test/224169/1 "2012-11-01T17:03:36Z")

</div>

It turns out that gr-qtgui isn’t compatible with the QWT 6 API. It  
works with QWT 5.2.1 and 5.1.2; I don’t know about 5.0.2 or earlier.

Does anyone know if there a (simple) way in CMake to check that the  
library is -not- of a specific version? For example:

find\_package(Qwt “\< 6”)

where the “\< 6” is used for version checking. We could use  
‘find\_package(Qwt 5)’ but then I don’t know if the gr-qtgui is  
compatible with QWT 4.2.0 (and, I’m not inclined to do so given that  
that version dates to 2004). QWT does not install a PKGCONFIG, not a  
“qwt-config” type of script; as far as I can tell, the only way to  
verify its version is by either checking that of the installed library  
or its headers (and, for cross-OS compatibility I’d guess the latter).

I’d love to see an updated gr-qtgui, but the QWT 6 API is quite  
different than that from 5 & there are a number of changes that would be  
required in the GR code – so, probably not anytime soon given the  
number of changes that would be required.

Anyway, wondering if anyone knows of a simple solution. Thanks! - MLD

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [November 1, 2012, 5:06pm UTC](https://www.ruby-forum.com/t/cmake-max-version-test/224169/2 "2012-11-01T17:06:32Z")

</div>

On Thu, Nov 1, 2012 at 12:01 PM, Michael D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Anyway, wondering if anyone knows of a simple solution. Thanks! - MLD  
> gr-qtgui /should/ be compatible with QWT6. I’ve been running it on  
> QWT6 on my systems since 12.04 came out. If there are specific  
> problems, we can patch it.

If you look inside the code, there are quite a few places where you’ll  
see #if’s checking for the QWT version to do the right thing.

Tom

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [November 2, 2012, 2:40am UTC](https://www.ruby-forum.com/t/cmake-max-version-test/224169/3 "2012-11-02T02:40:16Z")

</div>

On Nov 1, 2012, at 12:04 PM, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> gr-qtgui /should/ be compatible with QWT6. I’ve been running it on  
> QWT6 on my systems since 12.04 came out. If there are specific  
> problems, we can patch it.
> 
> If you look inside the code, there are quite a few places where you’ll  
> see #if’s checking for the QWT version to do the right thing.

I just activated qwt 6.0.1, and this time it worked. So, ignore what I  
said about compatibility; the issue was with my end somehow. I had  
looked at the code and thought it seemed compatible, but for some reason  
it just didn’t work until now. Ah well; that happens sometimes 🙂 - MLD

---

<div class="post-metadata">

**Author:** ![mdeering](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/278dde/32.png) [@mdeering](https://www.ruby-forum.com/u/mdeering)\
**Post date:** [November 4, 2012, 5:09pm UTC](https://www.ruby-forum.com/t/cmake-max-version-test/224169/4 "2012-11-04T17:09:33Z")

</div>

On Thu, Nov 1, 2012 at 9:39 PM, Michael D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> On Nov 1, 2012, at 12:04 PM, Tom R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > gr-qtgui /should/ be compatible with QWT6. I’ve been running it on  
> > QWT6 on my systems since 12.04 came out. If there are specific  
> > problems, we can patch it.
> > 
> > If you look inside the code, there are quite a few places where you’ll  
> > see #if’s checking for the QWT version to do the right thing.
> 
> I just activated qwt 6.0.1, and this time it worked. So, ignore what I said  
> about compatibility; the issue was with my end somehow. I had looked at the code  
> and thought it seemed compatible, but for some reason it just didn’t work until  
> now. Ah well; that happens sometimes 🙂 - MLD

Good to know! It was a pain when they moved to version 6 and took some  
time to convert over, and we still miss things sometimes when we’re  
working on qtgui, but I’ve been trying to be good about checking  
against both version 5 and 6 before we release new stuff.

Tom
