Statistics
| Branch: | Tag: | Revision:

root / gr-howto-write-a-block-cmake / lib / CMakeLists.txt @ 626018eb

History | View | Annotate | Download (2.6 kB)

1
# Copyright 2011 Free Software Foundation, Inc.
2
#
3
# This file is part of GNU Radio
4
#
5
# GNU Radio is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3, or (at your option)
8
# any later version.
9
#
10
# GNU Radio is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with GNU Radio; see the file COPYING.  If not, write to
17
# the Free Software Foundation, Inc., 51 Franklin Street,
18
# Boston, MA 02110-1301, USA.
19
20
########################################################################
21
# Setup library
22
########################################################################
23
INCLUDE(GrPlatform) #define LIB_SUFFIX
24
25
ADD_LIBRARY(gnuradio-howto SHARED howto_square_ff.cc howto_square2_ff.cc)
26
TARGET_LINK_LIBRARIES(gnuradio-howto ${Boost_LIBRARIES} ${GRUEL_LIBRARIES} ${GNURADIO_CORE_LIBRARIES})
27
SET_TARGET_PROPERTIES(gnuradio-howto PROPERTIES DEFINE_SYMBOL "gnuradio_howto_EXPORTS")
28
29
########################################################################
30
# Install built library files
31
########################################################################
32
INSTALL(TARGETS gnuradio-howto
33
    LIBRARY DESTINATION ${LIB_SUFFIX}/lib # .so/.dylib file
34
    ARCHIVE DESTINATION ${LIB_SUFFIX}/lib # .lib file
35
    RUNTIME DESTINATION bin               # .dll file
36
)
37
38
########################################################################
39
# Install public header files
40
########################################################################
41
INSTALL(FILES
42
    howto_api.h
43
    howto_square_ff.h
44
    howto_square2_ff.h
45
    DESTINATION include/howto
46
)
47
48
########################################################################
49
# Build and register unit test
50
########################################################################
51
FIND_PACKAGE(Boost COMPONENTS unit_test_framework)
52
53
INCLUDE(GrTest)
54
SET(GR_TEST_TARGET_DEPS gnuradio-howto)
55
#turn each test cpp file into an executable with an int main() function
56
ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
57
58
ADD_EXECUTABLE(qa_howto_square_ff qa_howto_square_ff.cc)
59
TARGET_LINK_LIBRARIES(qa_howto_square_ff gnuradio-howto ${Boost_LIBRARIES})
60
GR_ADD_TEST(qa_howto_square_ff qa_howto_square_ff)
61
62
ADD_EXECUTABLE(qa_howto_square2_ff qa_howto_square2_ff.cc)
63
TARGET_LINK_LIBRARIES(qa_howto_square2_ff gnuradio-howto ${Boost_LIBRARIES})
64
GR_ADD_TEST(qa_howto_square2_ff qa_howto_square2_ff)