Cmake Error

Hi,GR,

I’m trying to use cmake to build gr-ieee802.11 project. But I had
following error:


CMake Warning at CMakeLists.txt:85 (find_package):
By not providing “FindCppUnit.cmake” in CMAKE_MODULE_PATH this project
has
asked CMake to find a package configuration file provided by
“CppUnit”, but
CMake did not find one.

Could not find a package configuration file provided by “CppUnit” with
any
of the following names:

CppUnitConfig.cmake
cppunit-config.cmake

Add the installation prefix of “CppUnit” to CMAKE_PREFIX_PATH or set
“CppUnit_DIR” to a directory containing one of the above files. If
“CppUnit” provides a separate development package or SDK, be sure it
has
been installed.

CMake Error at CMakeLists.txt:92 (message):
CppUnit required to compile ieee802-11


After I use apt-get to install libcppunit, the problem still exist.

On 09/02/2014 08:52 AM, zhangwen wrote:

CMake Warning at CMakeLists.txt:85 (find_package):
By not providing “FindCppUnit.cmake” in CMAKE_MODULE_PATH this
project has
asked CMake to find a package configuration file provided by
“CppUnit”, but
CMake did not find one.

Oooops, looks like I delete a bit too much files from cmake/Modules. I
just restored them. Can you please try again?

But, actually that’s a good opportunity to ask what an OOT module has to
install. Actually, I thought FindCppUnit.cmake is installed with GNU
Radio

So maybe it is just a matter of adapting ${CMAKE_MODULE_PATH}?

For now I just did it as gr-fosphor :slight_smile:

Best,
Bastian

On Tue, Sep 2, 2014 at 3:46 AM, Bastian B. [email protected]
wrote:

For now I just did it as gr-fosphor :slight_smile:

Best,
Bastian

Yes, GNU Radio installs FindCppUnit.cmake, so you’re probably right
about
just having to tell cmake the right place to look for this. Cmake can be
funny about that stuff. Instead, that’s why when you build a project
with
gr_modtool it puts all of the cmake files into the project for you. Just
to
be sure you can always reach them in your project.

Tom

The best way to use the .cmake files installed by GNU Radio in an OOT
module is to do the
{{{
find_package(Gnuradio […])
}}}
as close to first thing as possible. Once that’s done, then all of the
other GR .cmake modules (including FindCppUnit.cmake) will become
available when using CMake >= 2.8.X. See:
<
https://github.com/gnuradio/gnuradio/blob/master/cmake/Modules/GnuradioConfig.cmake#L28

Please note that on CMake 2.6.X and prior this will like -not- work
because CMAKE_CURRENT_LIST_DIR is not yet supported (at least in my
testing on OSX; I assume it’s the same on other OSs).

Thus, for example, if I change the file gr-ieee802-11/CMakeLists.txt to
include the following instead of the line setting the CMAKE_MODULE_PATH,
then CMake 2.8+ finds everything as hoped/expected.
{{{
########################################################################

Find gnuradio build dependencies

########################################################################
set(GR_REQUIRED_COMPONENTS RUNTIME FILTER FFT PMT DIGITAL)
find_package(Gnuradio)
if(NOT GNURADIO_RUNTIME_FOUND)
message(FATAL_ERROR “GnuRadio Runtime required to compile
ieee802-11”)
endif()
}}}
On CMake 2.6 I need to set the CMAKE_MODULE_PATH to include the
directory in which GnuradioConfig.cmake is found to get this to work.
I’ve tried a bunch of alternatives to working around this on CMake 2.6,
and there’s no obvious way to do it using just CMake internals /
commands. The best way I can find to do this is to create a
GnuradioConfig.cmake.in file that internally sets this variable
correctly (as is done for GnuradioConfigVersion.cmake.in for the version
info).

I, for one, believe that not having to include all of the
already-installed GR .cmake files is the way to go if at all possible;
it eliminates the need to keep updating these files in the various OOT
modules as well as reduces file redundancy.

Hope this helps! - MLD

On 09/04/2014 04:33 AM, zhangwen wrote:

Thank you Bastian! I have downloaded the latest version and complete the
installation of gr-ieee802.11.

Now I am learning to write my own OOT modules from Gnuradio wiki. Could
you give me some advice?

You should have a look at the GNU Radio wiki
http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModules

I know little about building a block and Cmake tool. And what is gr-fosphor?
I open the .grc and other grc file in example. There are still some
blocks missing, so I can’t run the programs. Addition, I try in both
root and normal authority.

Please have a look at the readme

Best,
Bastian

Thank you Bastian! I have downloaded the latest version and complete the
installation of gr-ieee802.11.

Now I am learning to write my own OOT modules from Gnuradio wiki. Could
you give me some advice?
I know little about building a block and Cmake tool. And what is
gr-fosphor?

I open the .grc and other grc file in example. There are still some
blocks missing, so I can’t run the programs. Addition, I try in both
root and normal authority.

I attached the pictures of the missing progect.

Best regrads,
Zhang Wen