Problem building GNURadio in custom environment

Viewed 22

I am trying to build the latest GNURadio package on my development system. Unfortunately this system configuration is tightly controlled and I can't just install new packages of software on it as it is used to develop a product and all development systems are kept in lockstep. We are currently on an older version of RedHat.

While I cannot modify the system includes I can download and use newer versions of packages locally (in non-system directories) as long as that doesn't affect the product build/debug environment. Normally this isn't a problem.

However, when building GNURadio I found that our development platforms use an older version of the Boost libraries than is required to build GNURadio. So, I got the latest version of Boost and extracted it into my local (home) directory. I found several directions for, I thought, instructing CMake to use additional include directories. Unfortunately, this hasn't seemed to work with the Boost libraries. CMake keeps complaining that it finds the older version of Boost and not the newer one I have extracted locally.

I have tried using

-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES=<dir>

and

-DCMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES_BEFORE=<dir> 

and this had no effect. I then tried adding the following to the top-level CMakeLists.txt file:

SET(CMAKE_INCLUDE_DIRECTORIES_BEFORE ON)
SET(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES <dir>)

or, even

include_directories(BEFORE <dir>)

Again, no joy.

I did a bit of digging and found that there is a GrBoost.cmake module and it had an additional configuration for the boost directory so I added this:

list(PREPEND BOOST_LIBRARYDIR "<dir>")

to the top of the file. Again, no luck.

I've never used CMake before (and I'm not really keen on learning yet another build system if I don't have to - our company just switched to bazel and I am coming up to speed on that) so I am flying blind here.

What do I have to do to get CMake to look in my local directory to find the Boost stuff I downloaded?

1 Answers

Ok. As it often happens, just after asking the question I was able to find an answer.

It turns out that there is a command-line option to CMake (CMAKE_PREFIX_PATH=<dir>) where you can specify additional base paths to search for CMake config files. I just added this to the command-line and it was found just fine.

I wasn't even aware that Boost came with such config files. Live and learn.

@vre's comment would have probably worked just as well (maybe better, in fact).

Related