OpenBSD.cmake 720 B

123456789101112131415161718
  1. INCLUDE(Platform/NetBSD)
  2. # On OpenBSD, the compile time linker does not share it's configuration with
  3. # the runtime linker. This will extract the library search paths from the
  4. # system's ld.so.hints file which will allow CMake to set the appropriate
  5. # -rpath-link flags
  6. IF(NOT CMAKE_PLATFORM_RUNTIME_PATH)
  7. EXECUTE_PROCESS(COMMAND /sbin/ldconfig -r
  8. OUTPUT_VARIABLE LDCONFIG_HINTS
  9. ERROR_QUIET)
  10. STRING(REGEX REPLACE ".*search\\ directories:\\ ([^\n]*).*" "\\1"
  11. LDCONFIG_HINTS "${LDCONFIG_HINTS}")
  12. STRING(REGEX REPLACE ":" ";"
  13. CMAKE_PLATFORM_RUNTIME_PATH
  14. "${LDCONFIG_HINTS}")
  15. ENDIF()
  16. SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)