diff options
author | Martin Braun <martin.braun@ettus.com> | 2018-11-13 21:53:22 -0800 |
---|---|---|
committer | Brent Stapleton <bstapleton@g.hmc.edu> | 2018-11-14 14:10:09 -0800 |
commit | a69ab0c23a0c38e3fed3e412df36538d8959d23c (patch) | |
tree | e6669a138dad84f79c46588f43a38c69dda90246 /host/examples/CMakeLists.txt | |
parent | 4247f025020d7dd1f696dfbd3cce248957d6ace7 (diff) | |
download | uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.gz uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.tar.bz2 uhd-a69ab0c23a0c38e3fed3e412df36538d8959d23c.zip |
cmake: Update coding style to use lowercase commands
Also updates our coding style file.
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code (with GNU compliant sed):
cmake --help-command-list | grep -v "cmake version" | while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done > convert.sed \
&& git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' \
'*CMakeLists.txt' | xargs -0 gsed -i -f convert.sed && rm convert.sed
(Make sure the backslashes don't get mangled!)
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) |