From aad0c6c56a176005d1de913f7c41b2efc7bcb593 Mon Sep 17 00:00:00 2001 From: Tom Rondeau Date: Fri, 2 May 2014 10:42:42 -0400 Subject: [PATCH] cmake: adding LINK_DIRECTORIES to cmake to tell it where to find uhd if not in a normal (i.e., /usr or /usr/local) prefix. --- cuhd/lib/CMakeLists.txt | 12 +++++------- examples/CMakeLists.txt | 14 +++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/cuhd/lib/CMakeLists.txt b/cuhd/lib/CMakeLists.txt index 82ad6382c..fb74eae89 100644 --- a/cuhd/lib/CMakeLists.txt +++ b/cuhd/lib/CMakeLists.txt @@ -25,19 +25,17 @@ IF(UHD_FOUND) ADD_LIBRARY(cuhd cuhd_imp.cpp cuhd_utils.c) INCLUDE_DIRECTORIES(${UHD_INCLUDE_DIRS}) + LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) TARGET_LINK_LIBRARIES(cuhd ${UHD_LIBRARIES}) - + LIBLTE_SET_PIC(cuhd) APPEND_INTERNAL_LIST(OPTIONAL_LIBS cuhd) INSTALL(TARGETS cuhd DESTINATION ${LIBRARY_DIR}) - + MESSAGE(STATUS " cuhd UHD C wrapper will be installed.") - + ELSE(UHD_FOUND) - MESSAGE(STATUS " UHD driver not found. CUHD library is not generated") + MESSAGE(STATUS " UHD driver not found. CUHD library is not generated") ENDIF(UHD_FOUND) - - - \ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 21d3cdba8..117c6d47c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -38,6 +38,7 @@ target_link_libraries(ll_example lte) add_executable(synch_file synch_file.c) target_link_libraries(synch_file lte) +LINK_DIRECTORIES(${UHD_LIBRARY_DIRS}) ################################################################# # Check if UHD C-API and Graphics library are available @@ -59,8 +60,8 @@ target_link_libraries(pbch_enodeb lte) IF(${CUHD_FIND} EQUAL -1) SET_TARGET_PROPERTIES(pbch_ue PROPERTIES COMPILE_DEFINITIONS "DISABLE_UHD") SET_TARGET_PROPERTIES(pbch_enodeb PROPERTIES COMPILE_DEFINITIONS "DISABLE_UHD") -ELSE(${CUHD_FIND} EQUAL -1) - target_link_libraries(pbch_ue cuhd) +ELSE(${CUHD_FIND} EQUAL -1) + target_link_libraries(pbch_ue cuhd) target_link_libraries(pbch_enodeb cuhd) ENDIF(${CUHD_FIND} EQUAL -1) @@ -79,13 +80,13 @@ ENDIF(${GRAPHICS_FIND} EQUAL -1) ################################################################# IF(${CUHD_FIND} GREATER -1) - + add_executable(scan_rssi scan_rssi.c) target_link_libraries(scan_rssi lte cuhd ) - + add_executable(scan_pss scan_pss.c) target_link_libraries(scan_pss lte cuhd ) - + add_executable(scan_mib scan_mib.c) target_link_libraries(scan_mib lte cuhd ) @@ -93,5 +94,4 @@ IF(${CUHD_FIND} GREATER -1) ELSE(${CUHD_FIND} GREATER -1) MESSAGE(STATUS " UHD examples NOT INSTALLED: CUHD library not compiled.") -ENDIF(${CUHD_FIND} GREATER -1) - +ENDIF(${CUHD_FIND} GREATER -1)