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 Sep 2, 2014, at 3:46 AM, Bastian Bloessl <bloe...@ccs-labs.org> wrote: > 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 > > https://github.com/gnuradio/gnuradio/blob/master/CMakeLists.txt#L391 > > So maybe it is just a matter of adapting ${CMAKE_MODULE_PATH}? > > For now I just did it as gr-fosphor :-) _______________________________________________ Discuss-gnuradio mailing list Discuss-gnuradio@gnu.org https://lists.gnu.org/mailman/listinfo/discuss-gnuradio