Cmake error if cppunit not installed

Greetings,

Trying to run cmake on a Linux Mint 13 installation that doesn’t have
cppunit leads to what looks like an unintentional error message:

– Configuring gr-filter support…
– Dependency ENABLE_GRUEL = ON
– Dependency ENABLE_VOLK = ON
– Dependency Boost_FOUND = TRUE
– Dependency ENABLE_GR_CORE = ON
– Dependency ENABLE_GR_FFT = ON
– Enabling gr-filter support.
– Override with -DENABLE_GR_FILTER=ON/OFF
CMake Error at gr-filter/lib/CMakeLists.txt:178 (GR_ADD_TEST):
Unknown CMake command “GR_ADD_TEST”.

CMake Error: The following variables are used in this project, but
they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the
CMake files:
CPPUNIT_INCLUDE_DIRS (ADVANCED)
used as include directory in directory
/home/alc/gnuradio/src/gnuradio.git/gr-filter/lib
CPPUNIT_LIBRARIES (ADVANCED)
linked by target “test-gr-filter” in directory
/home/alc/gnuradio/src/gnuradio.git/gr-filter/lib

– Configuring incomplete, errors occurred!

With cppunit installed everything is fine.

Alex

On Fri, Jul 13, 2012 at 5:06 AM, Alexandru C. [email protected]
wrote:

– Dependency ENABLE_GR_FFT = ON
CPPUNIT_INCLUDE_DIRS (ADVANCED)

Alex

Alright, thanks. That should be easy to fix. Try this:

diff --git a/gr-filter/lib/CMakeLists.txt b/gr-filter/lib/CMakeLists.txt
index 73d7d7b…46e7ee1 100644
— a/gr-filter/lib/CMakeLists.txt
+++ b/gr-filter/lib/CMakeLists.txt
@@ -157,6 +157,8 @@ add_dependencies(gnuradio-filter gnuradio-fft
filter_generated_includes filter_g
########################################################################

QA C++ Code for gr-filter

########################################################################
+if(ENABLE_TESTING)
+include(GrTest)
list(APPEND test_gr_filter_sources
${CMAKE_CURRENT_SOURCE_DIR}/test_gr_filter.cc
${CMAKE_CURRENT_SOURCE_DIR}/qa_filter.cc
@@ -176,3 +178,4 @@ target_link_libraries(
)

GR_ADD_TEST(test_gr_filter test-gr-filter)
+endif(ENABLE_TESTING)

Tom

Linux Mint 13 is heavily based on Ubuntu 12.04, so I recreated the bug
and can confirm it exists in Ubuntu 12.04 32/64 bit. I ran CMake with
the fix, and both still report this error:

CMake Error: The following variables are used in this project, but they
are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the
CMake files:
CPPUNIT_INCLUDE_DIRS (ADVANCED)
used as include directory in directory /root/gnuradio/gr-filter/lib

On 07/13/2012 05:15 AM, Tom R. wrote:

– Dependency ENABLE_GR_CORE = ON
CMake files:
With cppunit installed everything is fine.
########################################################################
GR_ADD_TEST(test_gr_filter test-gr-filter)
+endif(ENABLE_TESTING)

Tom


Discuss-gnuradio mailing list
[email protected]
Discuss-gnuradio Info Page


Nicholas C.

On Fri, Jul 13, 2012 at 9:50 AM, Nicholas C. [email protected]
wrote:

used as include directory in directory /root/gnuradio/gr-filter/lib
Alright, thanks. I’ve just checked in the patch for this. Just had to
set the right variables at the right time.

Tom