From 8d245c6e0b725028d1fa67d768da417b06c2d00a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 10 Nov 2010 10:27:27 -0800 Subject: uhd: reorganized utils cmakefile to use list of sources --- host/utils/CMakeLists.txt | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'host/utils/CMakeLists.txt') diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt index f0fa806c5..174d1d997 100644 --- a/host/utils/CMakeLists.txt +++ b/host/utils/CMakeLists.txt @@ -18,37 +18,36 @@ ######################################################################## # Utilities that get installed into the runtime path ######################################################################## -ADD_EXECUTABLE(uhd_find_devices uhd_find_devices.cpp) -TARGET_LINK_LIBRARIES(uhd_find_devices uhd) - -ADD_EXECUTABLE(uhd_usrp_probe uhd_usrp_probe.cpp) -TARGET_LINK_LIBRARIES(uhd_usrp_probe uhd) - -INSTALL(TARGETS - uhd_find_devices - uhd_usrp_probe - RUNTIME DESTINATION ${RUNTIME_DIR} +SET(util_runtime_sources + uhd_find_devices.cpp + uhd_usrp_probe.cpp ) +#for each source: build an executable and install +FOREACH(util_source ${util_runtime_sources}) + GET_FILENAME_COMPONENT(util_name ${util_source} NAME_WE) + ADD_EXECUTABLE(${util_name} ${util_source}) + TARGET_LINK_LIBRARIES(${util_name} uhd) + INSTALL(TARGETS ${util_name} RUNTIME DESTINATION ${RUNTIME_DIR}) +ENDFOREACH(util_source) + ######################################################################## # Utilities that get installed into the share path ######################################################################## -ADD_EXECUTABLE(usrp_burn_db_eeprom usrp_burn_db_eeprom.cpp) -TARGET_LINK_LIBRARIES(usrp_burn_db_eeprom uhd) - -ADD_EXECUTABLE(usrp_burn_mb_eeprom usrp_burn_mb_eeprom.cpp) -TARGET_LINK_LIBRARIES(usrp_burn_mb_eeprom uhd) - -ADD_EXECUTABLE(usrp1_init_eeprom usrp1_init_eeprom.cpp) -TARGET_LINK_LIBRARIES(usrp1_init_eeprom uhd) - -INSTALL(TARGETS - usrp_burn_db_eeprom - usrp_burn_mb_eeprom - usrp1_init_eeprom - RUNTIME DESTINATION ${PKG_DATA_DIR}/utils +SET(util_share_sources + usrp_burn_db_eeprom.cpp + usrp_burn_mb_eeprom.cpp + usrp1_init_eeprom.cpp ) +#for each source: build an executable and install +FOREACH(util_source ${util_share_sources}) + GET_FILENAME_COMPONENT(util_name ${util_source} NAME_WE) + ADD_EXECUTABLE(${util_name} ${util_source}) + TARGET_LINK_LIBRARIES(${util_name} uhd) + INSTALL(TARGETS ${util_name} RUNTIME DESTINATION ${PKG_DATA_DIR}/utils) +ENDFOREACH(util_source) + INSTALL(PROGRAMS usrp2_recovery.py usrp2_card_burner.py -- cgit v1.2.3 From 0d83209d13b558fe35b22ea06d0b38645ecbdcf7 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Wed, 10 Nov 2010 10:45:56 -0800 Subject: usrp1: usrp1 util is conditionally enabled --- host/utils/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'host/utils/CMakeLists.txt') diff --git a/host/utils/CMakeLists.txt b/host/utils/CMakeLists.txt index 174d1d997..38e21c753 100644 --- a/host/utils/CMakeLists.txt +++ b/host/utils/CMakeLists.txt @@ -37,9 +37,14 @@ ENDFOREACH(util_source) SET(util_share_sources usrp_burn_db_eeprom.cpp usrp_burn_mb_eeprom.cpp - usrp1_init_eeprom.cpp ) +IF(ENABLE_USRP1) + LIST(APPEND util_share_sources + usrp1_init_eeprom.cpp + ) +ENDIF(ENABLE_USRP1) + #for each source: build an executable and install FOREACH(util_source ${util_share_sources}) GET_FILENAME_COMPONENT(util_name ${util_source} NAME_WE) -- cgit v1.2.3