diff options
Diffstat (limited to 'host/examples/CMakeLists.txt')
-rw-r--r-- | host/examples/CMakeLists.txt | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/host/examples/CMakeLists.txt b/host/examples/CMakeLists.txt index 8ebf2cc09..3d4e064bd 100644 --- a/host/examples/CMakeLists.txt +++ b/host/examples/CMakeLists.txt @@ -8,7 +8,7 @@ ######################################################################## # example applications ######################################################################## -SET(example_sources +set(example_sources benchmark_rate.cpp network_relay.cpp rx_multi_samples.cpp @@ -30,52 +30,52 @@ SET(example_sources sync_to_gps.cpp ) -IF(ENABLE_RFNOC) - LIST(APPEND +if(ENABLE_RFNOC) + list(APPEND example_sources rfnoc_nullsource_ce_rx.cpp rfnoc_rx_to_file.cpp rfnoc_radio_loopback.cpp benchmark_streamer.cpp ) -ENDIF(ENABLE_RFNOC) +endif(ENABLE_RFNOC) -IF(ENABLE_OCTOCLOCK) - LIST(APPEND example_sources test_clock_synch.cpp) -ENDIF(ENABLE_OCTOCLOCK) +if(ENABLE_OCTOCLOCK) + list(APPEND example_sources test_clock_synch.cpp) +endif(ENABLE_OCTOCLOCK) #for each source: build an executable and install -FOREACH(example_source ${example_sources}) - GET_FILENAME_COMPONENT(example_name ${example_source} NAME_WE) - ADD_EXECUTABLE(${example_name} ${example_source}) - TARGET_LINK_LIBRARIES(${example_name} uhd ${Boost_LIBRARIES}) +foreach(example_source ${example_sources}) + get_filename_component(example_name ${example_source} NAME_WE) + add_executable(${example_name} ${example_source}) + target_link_libraries(${example_name} uhd ${Boost_LIBRARIES}) UHD_INSTALL(TARGETS ${example_name} RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples) -ENDFOREACH(example_source) +endforeach(example_source) ######################################################################## # ASCII Art DFT - requires curses, so this part is optional ######################################################################## -FIND_PACKAGE(Curses) +find_package(Curses) -IF(CURSES_FOUND) - INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR}) - ADD_EXECUTABLE(rx_ascii_art_dft rx_ascii_art_dft.cpp) - TARGET_LINK_LIBRARIES(rx_ascii_art_dft uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES}) +if(CURSES_FOUND) + include_directories(${CURSES_INCLUDE_DIR}) + add_executable(rx_ascii_art_dft rx_ascii_art_dft.cpp) + target_link_libraries(rx_ascii_art_dft uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES}) UHD_INSTALL(TARGETS rx_ascii_art_dft RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples) - ADD_EXECUTABLE(twinrx_freq_hopping twinrx_freq_hopping.cpp) - TARGET_LINK_LIBRARIES(twinrx_freq_hopping uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES}) + add_executable(twinrx_freq_hopping twinrx_freq_hopping.cpp) + target_link_libraries(twinrx_freq_hopping uhd ${CURSES_LIBRARIES} ${Boost_LIBRARIES}) UHD_INSTALL(TARGETS twinrx_freq_hopping RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples) -ENDIF(CURSES_FOUND) +endif(CURSES_FOUND) ######################################################################## # Examples using C API ######################################################################## -IF(ENABLE_C_API) +if(ENABLE_C_API) # # Check if this particular C99 feature is available with this compiler # - INCLUDE(CheckCSourceCompiles) + include(CheckCSourceCompiles) CHECK_C_SOURCE_COMPILES(" typedef struct { int bar; @@ -93,26 +93,26 @@ IF(ENABLE_C_API) } " HAVE_C99_STRUCTDECL) - IF(HAVE_C99_STRUCTDECL) - ADD_SUBDIRECTORY(getopt) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/getopt) + if(HAVE_C99_STRUCTDECL) + add_subdirectory(getopt) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/getopt) - SET(C_API_EXAMPLES + set(C_API_EXAMPLES rx_samples_c tx_samples_c ) - FOREACH(example ${C_API_EXAMPLES}) - ADD_EXECUTABLE(${example} ${example}.c) - TARGET_LINK_LIBRARIES(${example} uhd getopt) - IF(UNIX) - TARGET_LINK_LIBRARIES(${example} m) - ENDIF(UNIX) + foreach(example ${C_API_EXAMPLES}) + add_executable(${example} ${example}.c) + target_link_libraries(${example} uhd getopt) + if(UNIX) + target_link_libraries(${example} m) + endif(UNIX) UHD_INSTALL(TARGETS ${example} RUNTIME DESTINATION ${PKG_LIB_DIR}/examples COMPONENT examples) - ENDFOREACH(example ${C_API_EXAMPLES}) - ENDIF(HAVE_C99_STRUCTDECL) -ENDIF(ENABLE_C_API) + endforeach(example ${C_API_EXAMPLES}) + endif(HAVE_C99_STRUCTDECL) +endif(ENABLE_C_API) -IF(ENABLE_PYTHON_API) - ADD_SUBDIRECTORY(python) -ENDIF(ENABLE_PYTHON_API) +if(ENABLE_PYTHON_API) + add_subdirectory(python) +endif(ENABLE_PYTHON_API) |