2
0

FindUUID.cmake 756 B

1234567891011121314151617181920212223242526272829303132
  1. # UUID_FOUND
  2. # UUID_LIBRARIES
  3. # UUID_LIBRARY_DIRS
  4. # UUID_LDFLAGS
  5. # UUID_INCLUDE_DIRS
  6. # UUID_CFLAGS
  7. if (NOT KS_PLAT_WIN)
  8. include(FindPkgConfig)
  9. if (NOT PKG_CONFIG_FOUND)
  10. message("Failed to locate pkg-config" FATAL)
  11. endif()
  12. pkg_check_modules(UUID uuid REQUIRED)
  13. if(UUID_FOUND)
  14. find_library(UUID_ABS_LIB_PATH
  15. NAMES ${UUID_LIBRARIES}
  16. HINTS ${UUID_LIBRARY_DIRS}
  17. PATHS ${UUID_LIBRARY_DIRS}
  18. )
  19. if(NOT TARGET LIBUUID::LIBUUID)
  20. add_library(LIBUUID::LIBUUID UNKNOWN IMPORTED)
  21. set_target_properties(LIBUUID::LIBUUID PROPERTIES
  22. IMPORTED_LOCATION ${UUID_ABS_LIB_PATH}
  23. INTERFACE_INCLUDE_DIRECTORIES "${UUID_INCLUDE_DIRS}")
  24. endif()
  25. message("Found UUID setup target at imported location: ${UUID_ABS_LIB_PATH}")
  26. endif()
  27. endif()