CMP0181 — CMake 4.3.1 Documentation

# CMP0181

Added in version 4.0.

The `CMAKE_EXE_LINKER_FLAGS`, `CMAKE_EXE_LINKER_FLAGS_<CONFIG>`, `CMAKE_SHARED_LINKER_FLAGS`, `CMAKE_SHARED_LINKER_FLAGS_<CONFIG>`, `CMAKE_MODULE_LINKER_FLAGS`, and `CMAKE_MODULE_LINKER_FLAGS_<CONFIG>` variables are parsed and re-quoted and support the `LINKER:` prefix.

CMake 3.31 and below use the content of these variables as is.

CMake 4.0 and above parse the content of these variables and manage the escaping of special characters. Moreover, the `LINKER:` prefix is now recognized and expanded.

The `OLD` behavior of this policy is to consume the content of the `CMAKE_EXE_LINKER_FLAGS`, `CMAKE_EXE_LINKER_FLAGS_<CONFIG>`, `CMAKE_SHARED_LINKER_FLAGS`, `CMAKE_SHARED_LINKER_FLAGS_<CONFIG>`, `CMAKE_MODULE_LINKER_FLAGS`, and `CMAKE_MODULE_LINKER_FLAGS_<CONFIG>` variables as is.

The `NEW` behavior of this policy is to parse and re-quote the content of the `CMAKE_EXE_LINKER_FLAGS`, `CMAKE_EXE_LINKER_FLAGS_<CONFIG>`, `CMAKE_SHARED_LINKER_FLAGS`, `CMAKE_SHARED_LINKER_FLAGS_<CONFIG>`, `CMAKE_MODULE_LINKER_FLAGS`, and `CMAKE_MODULE_LINKER_FLAGS_<CONFIG>` variables as well as to expand the `LINKER:` prefix.

This policy was introduced in CMake version 4.0. It may be set by `cmake_policy()` or `cmake_minimum_required()`. If it is not set, CMake does not warn, 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.