Imported Upstream version 2.8.11.2
[platform/upstream/cmake.git] / Modules / Platform / OpenBSD.cmake
1 include(Platform/NetBSD)
2
3 # On OpenBSD, the compile time linker does not share it's configuration with
4 # the runtime linker.  This will extract the library search paths from the
5 # system's ld.so.hints file which will allow CMake to set the appropriate
6 # -rpath-link flags
7 if(NOT CMAKE_PLATFORM_RUNTIME_PATH)
8   execute_process(COMMAND /sbin/ldconfig -r
9                   OUTPUT_VARIABLE LDCONFIG_HINTS
10                   ERROR_QUIET)
11   string(REGEX REPLACE ".*search\\ directories:\\ ([^\n]*).*" "\\1"
12          LDCONFIG_HINTS "${LDCONFIG_HINTS}")
13   string(REGEX REPLACE ":" ";"
14          CMAKE_PLATFORM_RUNTIME_PATH
15          "${LDCONFIG_HINTS}")
16 endif()
17
18 set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_OPENBSD_VERSIONING 1)
19
20 # OpenBSD policy requires that shared libraries be installed without
21 # executable permission.
22 set(CMAKE_INSTALL_SO_NO_EXE 1)