cmake updates

This commit is contained in:
Bastian Bloessl
2019-02-21 18:36:24 +00:00
parent d58e74decb
commit 284a0b1fa5
5 changed files with 245 additions and 10 deletions
+35 -6
View File
@@ -1,6 +1,6 @@
# Copyright 2011,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
# This file is part of gr-foo
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,16 +43,45 @@ list(APPEND foo_sources
wireshark_connector_impl.cc
)
set(foo_sources "${foo_sources}" PARENT_SCOPE)
if(NOT foo_sources)
MESSAGE(STATUS "No C++ sources... skipping lib/")
return()
endif(NOT foo_sources)
add_library(gnuradio-foo SHARED ${foo_sources})
target_link_libraries(gnuradio-foo ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} ${UHD_LIBRARIES})
target_link_libraries(gnuradio-foo gnuradio::gnuradio-runtime ${Boost_LIBRARIES} ${UHD_LIBRARIES})
target_include_directories(gnuradio-foo
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
PUBLIC $<INSTALL_INTERFACE:include>
)
set_target_properties(gnuradio-foo PROPERTIES DEFINE_SYMBOL "gnuradio_foo_EXPORTS")
if(APPLE)
set_target_properties(gnuradio-foo PROPERTIES
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
)
endif(APPLE)
########################################################################
# Install built library files
########################################################################
install(TARGETS gnuradio-foo
LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
RUNTIME DESTINATION bin # .dll file
include(GrMiscUtils)
GR_LIBRARY_FOO(gnuradio-foo)
########################################################################
# Print summary
########################################################################
message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Building for version: ${VERSION} / ${LIBVER}")
########################################################################
# Build and register unit test
########################################################################
include(GrTest)
# If your unit tests require special include paths, add them here
#include_directories()
# List all files that contain Boost.UTF unit tests here
list(APPEND test_foo_sources
)