Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor fixes for UHDConfig.cmake on windows #32

Closed
guruofquality opened this issue Apr 4, 2015 · 0 comments
Closed

minor fixes for UHDConfig.cmake on windows #32

guruofquality opened this issue Apr 4, 2015 · 0 comments

Comments

@guruofquality
Copy link
Contributor

Not to get too pedantic, but the following changes streamlined the ability of a dependency project to find UHD automatically on a windows system with find_package(UHD CONFIG):

  • Install the file to $prefix/cmake/UHDConfig.cmake (windows cmake has different search paths which can be read about here: https://www.cmake.org/cmake/help/v3.0/command/find_package.html)
  • The UHD_INCLUDE_HINTS and UHD_LIBDIR_HINTS variables can be set automatically relative to UHDConfig.cmake using ${CMAKE_CURRENT_LIST_DIR}, this way they are always found.
diff --git a/host/cmake/Modules/UHDConfig.cmake.in b/host/cmake/Modules/UHDConfig.cmake.in
index 78f0170..593a699 100644
--- a/host/cmake/Modules/UHDConfig.cmake.in
+++ b/host/cmake/Modules/UHDConfig.cmake.in
@@ -40,6 +40,10 @@ SET(UHD_INCLUDE_HINTS)
 SET(UHD_LIBDIR_HINTS)
 SET(UHD_DIR $ENV{UHD_DIR})

+IF(NOT UHD_DIR AND WIN32)
+    get_filename_component(UHD_DIR "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
+ENDIF()
+
 IF(UHD_DIR)
     LIST(APPEND UHD_INCLUDE_HINTS ${UHD_DIR}/include)
     LIST(APPEND UHD_LIBDIR_HINTS ${UHD_DIR}/lib)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants