summaryrefslogtreecommitdiff
path: root/cmake/Modules
diff options
context:
space:
mode:
authorMichael Dickens <michael.dickens@ettus.com>2014-08-29 12:00:45 -0400
committerMichael Dickens <michael.dickens@ettus.com>2014-08-29 12:00:45 -0400
commitc8fcd0252255e7a7b85b2f69c14c2f48e7896e9e (patch)
tree0bc57097864fd68b21972e5d6cedb0f28780cb55 /cmake/Modules
parent13deb30aed1500b43916ea5f0b4ee056081dede7 (diff)
cmake: fix FindUHD.cmake to work better wit CMake 2.6, and in general.
Diffstat (limited to 'cmake/Modules')
-rw-r--r--cmake/Modules/FindUHD.cmake17
1 files changed, 9 insertions, 8 deletions
diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake
index d4d2069aeb..cfb89b11ce 100644
--- a/cmake/Modules/FindUHD.cmake
+++ b/cmake/Modules/FindUHD.cmake
@@ -2,23 +2,24 @@
# Find the library for the USRP Hardware Driver
########################################################################
+# make this file non-reentrant
+if(__INCLUDED_FIND_UHD_CMAKE)
+ return()
+endif()
+set(__INCLUDED_FIND_UHD_CMAKE TRUE)
+
# First check to see if UHD installed its own CMake files
# save the current MODULE path
set(SAVED_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
-# remove the current directory from the MODULE path
-list(REMOVE_ITEM CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
+# clear the current MODULE path; uses system paths only
+unset(CMAKE_MODULE_PATH)
# try to find UHD via the provided parameters,
# handle REQUIRED internally later
unset(UHD_FOUND)
-# try quietly when possible (CMake 2.8+).
-if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.0")
- set(UHD_QUIET "QUIET")
-endif()
-
# was the version specified?
unset(LOCAL_UHD_FIND_VERSION)
if(UHD_FIND_VERSION)
@@ -35,7 +36,7 @@ endif(UHD_FIND_VERSION_EXACT)
# UHDConfigVersion will catch a pass-through version bug ...
find_package(
UHD ${LOCAL_UHD_FIND_VERSION}
- ${LOCAL_UHD_FIND_VERSION_EXACT} ${UHD_QUIET}
+ ${LOCAL_UHD_FIND_VERSION_EXACT} QUIET
)
# restore CMAKE_MODULE_PATH