CMP0068 — CMake 4.2.6 Documentation

# CMP0068

Added in version 3.9.

`RPATH` settings on macOS do not affect `install_name`.

CMake 3.9 and newer remove any effect the following settings may have on the `install_name` of a target on macOS:

- `BUILD_WITH_INSTALL_RPATH` target property

- `SKIP_BUILD_RPATH` target property

- `CMAKE_SKIP_RPATH` variable

- `CMAKE_SKIP_INSTALL_RPATH` variable

Previously, setting `BUILD_WITH_INSTALL_RPATH` had the effect of setting both the `install_name` of a target to `INSTALL_NAME_DIR` and the `RPATH` to `INSTALL_RPATH`. In CMake 3.9, it only affects setting of `RPATH`. However, if one wants `INSTALL_NAME_DIR` to apply to the target in the build tree, one may set `BUILD_WITH_INSTALL_NAME_DIR`.

If `SKIP_BUILD_RPATH`, `CMAKE_SKIP_RPATH` or `CMAKE_SKIP_INSTALL_RPATH` were used to strip the directory portion of the `install_name` of a target, one may set `INSTALL_NAME_DIR=""` instead.

The `OLD` behavior of this policy is to use the `RPATH` settings for `install_name` on macOS. The `NEW` behavior of this policy is to ignore the `RPATH` settings for `install_name` on macOS.

This policy was introduced in CMake version 3.9. It may be set by `cmake_policy()` or `cmake_minimum_required()`. If it is not set, CMake warns, and uses `OLD` behavior.

Note

The `OLD` behavior of a policy is `deprecated by definition` and may be removed in a future version of CMake.