summaryrefslogtreecommitdiff
path: root/gr-howto-write-a-block/lib/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'gr-howto-write-a-block/lib/CMakeLists.txt')
-rw-r--r--gr-howto-write-a-block/lib/CMakeLists.txt42
1 files changed, 29 insertions, 13 deletions
diff --git a/gr-howto-write-a-block/lib/CMakeLists.txt b/gr-howto-write-a-block/lib/CMakeLists.txt
index 835ae02d60..f847d757f6 100644
--- a/gr-howto-write-a-block/lib/CMakeLists.txt
+++ b/gr-howto-write-a-block/lib/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright 2011 Free Software Foundation, Inc.
+# Copyright 2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
@@ -22,10 +22,18 @@
########################################################################
include(GrPlatform) #define LIB_SUFFIX
-add_library(gnuradio-howto SHARED howto_square_ff.cc howto_square2_ff.cc)
+include_directories(${Boost_INCLUDE_DIR})
+link_directories(${Boost_LIBRARY_DIRS})
+
+add_library(gnuradio-howto SHARED square_ff_impl.cc square2_ff_impl.cc)
target_link_libraries(gnuradio-howto ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
set_target_properties(gnuradio-howto PROPERTIES DEFINE_SYMBOL "gnuradio_howto_EXPORTS")
+if(ENABLE_GR_CTRLPORT)
+ ADD_DEFINITIONS(-DGR_CTRLPORT)
+ include_directories(${ICE_INCLUDE_DIR})
+endif(ENABLE_GR_CTRLPORT)
+
########################################################################
# Install built library files
########################################################################
@@ -38,17 +46,25 @@ install(TARGETS gnuradio-howto
########################################################################
# Build and register unit test
########################################################################
-find_package(Boost COMPONENTS unit_test_framework)
-
include(GrTest)
-set(GR_TEST_TARGET_DEPS gnuradio-howto)
-#turn each test cpp file into an executable with an int main() function
-add_definitions(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
-add_executable(qa_howto_square_ff qa_howto_square_ff.cc)
-target_link_libraries(qa_howto_square_ff gnuradio-howto ${Boost_LIBRARIES})
-GR_ADD_TEST(qa_howto_square_ff qa_howto_square_ff)
+include_directories(${CPPUNIT_INCLUDE_DIRS})
+
+list(APPEND test_howto_sources
+ ${CMAKE_CURRENT_SOURCE_DIR}/test_howto.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/qa_howto.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/qa_square_ff.cc
+ ${CMAKE_CURRENT_SOURCE_DIR}/qa_square2_ff.cc
+)
+
+add_executable(test-howto ${test_howto_sources})
+
+target_link_libraries(
+ test-howto
+ ${GNURADIO_CORE_LIBRARIES}
+ ${Boost_LIBRARIES}
+ ${CPPUNIT_LIBRARIES}
+ gnuradio-howto
+)
-add_executable(qa_howto_square2_ff qa_howto_square2_ff.cc)
-target_link_libraries(qa_howto_square2_ff gnuradio-howto ${Boost_LIBRARIES})
-GR_ADD_TEST(qa_howto_square2_ff qa_howto_square2_ff)
+GR_ADD_TEST(test_howto test-howto)