Skip to content

Commit

Permalink
Add Volk
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Adams committed Jul 12, 2017
1 parent 1863d1b commit 8502d02
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost required to compile ais")
endif()

find_package(Volk)
if(NOT VOLK_FOUND)
message(FATAL_ERROR "Volk library required to compile gr-ais")
endif()
########################################################################
# Install directories
########################################################################
Expand Down Expand Up @@ -137,12 +141,14 @@ include_directories(
${Boost_INCLUDE_DIRS}
${CPPUNIT_INCLUDE_DIRS}
${GNURADIO_ALL_INCLUDE_DIRS}
${VOLK_INCLUDE_DIRS}
)

link_directories(
${Boost_LIBRARY_DIRS}
${CPPUNIT_LIBRARY_DIRS}
${GNURADIO_RUNTIME_LIBRARY_DIRS}
${VOLK_LIBRARIES}
)

# Set component parameters
Expand Down
26 changes: 26 additions & 0 deletions cmake/Modules/FindVolk.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
INCLUDE(FindPkgConfig)
PKG_CHECK_MODULES(PC_VOLK volk)

FIND_PATH(
VOLK_INCLUDE_DIRS
NAMES volk/volk.h
HINTS $ENV{VOLK_DIR}/include
${PC_VOLK_INCLUDEDIR}
PATHS /usr/local/include
/usr/include
)

FIND_LIBRARY(
VOLK_LIBRARIES
NAMES volk
HINTS $ENV{VOLK_DIR}/lib
${PC_VOLK_LIBDIR}
PATHS /usr/local/lib
/usr/local/lib64
/usr/lib
/usr/lib64
)

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS)
MARK_AS_ADVANCED(VOLK_LIBRARIES VOLK_INCLUDE_DIRS)
2 changes: 1 addition & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if(NOT ais_sources)
endif(NOT ais_sources)

add_library(gnuradio-ais SHARED ${ais_sources})
target_link_libraries(gnuradio-ais ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES})
target_link_libraries(gnuradio-ais ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} ${VOLK_LIBRARIES})
set_target_properties(gnuradio-ais PROPERTIES DEFINE_SYMBOL "gnuradio_ais_EXPORTS")

if(APPLE)
Expand Down

0 comments on commit 8502d02

Please sign in to comment.