https://github.com/Kitware/CMake
Raw File
Tip revision: f96f1aa5711118dfa410cfae0a8b83e9cc888646 authored by Brad King on 08 March 2019, 12:34:57 UTC
CMake 3.14.0-rc4
Tip revision: f96f1aa
CMP0004-OLD.cmake

cmake_minimum_required(VERSION 2.8.4)

cmake_policy(SET CMP0004 OLD)

add_library(foo SHARED empty.cpp)
add_library(bar SHARED empty.cpp)
add_library(bing SHARED empty.cpp)
add_library(bung SHARED empty.cpp)

cmake_policy(SET CMP0004 NEW)

add_library(bat SHARED empty.cpp)

target_link_libraries(foo "$<1: bar >")
target_link_libraries(bing "$<$<NOT:$<TARGET_POLICY:CMP0004>>: bar >")
target_link_libraries(bung "$<$<TARGET_POLICY:CMP0004>: bar >")

# The line below causes the error because the policy is NEW when bat
# is created.
target_link_libraries(bat "$<1: bar >")
back to top