diff --git a/CMakeLists.txt b/CMakeLists.txt index e7fcd2c..72deaff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ endif() ######################################################################## # Compiler specific setup ######################################################################## -if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) +if(NOT WIN32) #http://gcc.gnu.org/wiki/Visibility add_definitions(-fvisibility=hidden) endif() @@ -116,20 +116,42 @@ endif(APPLE) ######################################################################## # Find gnuradio build dependencies ######################################################################## -find_package(CppUnit) -find_package(Doxygen) # Search for GNU Radio and its components and versions. Add any # components required to the list of GR_REQUIRED_COMPONENTS (in all # caps such as FILTER or FFT) and change the version to the minimum # API compatible version required. set(GR_REQUIRED_COMPONENTS RUNTIME FFT FILTER DIGITAL) -find_package(Gnuradio "3.7.2" REQUIRED) -find_package(Volk "1.3") +find_package(Gnuradio) +if(NOT GNURADIO_RUNTIME_FOUND) + message(FATAL_ERROR "GNU Radio required to compile gfdm") +endif() +find_package(CppUnit) if(NOT CPPUNIT_FOUND) - message(FATAL_ERROR "CppUnit required to compile gfdm") + message(FATAL_ERROR "CppUnit required to compile gr-ieee802-15-4") +endif() + +find_package(PythonLibs 2) +if(NOT PYTHONLIBS_FOUND) + message(FATAL_ERROR "Python required to compile gr-ieee802-15-4") +endif() + +find_package(Volk) +if(NOT VOLK_FOUND) + message(FATAL_ERROR "Volk required to compile gr-ieee802-15-4") +endif() + +find_package(SWIG) +if(NOT SWIG_FOUND) + message(FATAL_ERROR "SWIG required to compile gr-ieee802-15-4") endif() + +find_package(FFTW3f) +if(NOT FFTW3F_FOUND) + message(FATAL_ERROR "FFTW3 required to compile iqbalance") +endif() + if(CMAKE_BUILD_TYPE) if(${CMAKE_BUILD_TYPE} STREQUAL "Coverage") include(CodeCoverage) @@ -140,7 +162,8 @@ endif() ######################################################################## # Setup doxygen option ######################################################################## -if(DOXYGEN_FOUND) +find_package(Doxygen) + if(DOXYGEN_FOUND) option(ENABLE_DOXYGEN "Build docs using Doxygen" ON) else(DOXYGEN_FOUND) option(ENABLE_DOXYGEN "Build docs using Doxygen" OFF) @@ -157,6 +180,8 @@ include_directories( ${Boost_INCLUDE_DIRS} ${CPPUNIT_INCLUDE_DIRS} ${GNURADIO_ALL_INCLUDE_DIRS} + ${VOLK_INCLUDE_DIRS} + ${FFTW3F_INCLUDE_DIRS} ) link_directories( @@ -165,6 +190,8 @@ link_directories( ${GNURADIO_RUNTIME_LIBRARY_DIRS} ${GNURADIO_FFT_LIBRARY_DIRS} ${GNURADIO_FILTER_LIBRARY_DIRS} + ${VOLK_LIBRARY_DIRS} + ${FFTW3F_LIBRARY_DIRS} ) # Set component parameters diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 8b0811f..f2fe0da 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -22,9 +22,6 @@ ######################################################################## include(GrPlatform) #define LIB_SUFFIX -include_directories(${Boost_INCLUDE_DIR}) -link_directories(${Boost_LIBRARY_DIRS}) - list(APPEND gfdm_sources gfdm_utils.cc receiver_kernel_cc.cc @@ -54,13 +51,16 @@ list(APPEND gfdm_sources channel_estimator_cc_impl.cc) set(gfdm_sources "${gfdm_sources}" PARENT_SCOPE) -if(NOT gfdm_sources) - MESSAGE(STATUS "No C++ sources... skipping lib/") - return() -endif(NOT gfdm_sources) + +list(APPEND gfdm_libs + ${Boost_LIBRARIES} + ${GNURADIO_ALL_LIBRARIES} + ${VOLK_LIBRARIES} + ${FFTW3F_LIBRARIES} +) add_library(gnuradio-gfdm SHARED ${gfdm_sources}) -target_link_libraries(gnuradio-gfdm ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES}) +target_link_libraries(gnuradio-gfdm ${gfdm_libs}) set_target_properties(gnuradio-gfdm PROPERTIES DEFINE_SYMBOL "gnuradio_gfdm_EXPORTS") if(APPLE)