mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 13:51:33 -06:00
For policy-specific tests, use the version before the policy was introduced. Otherwise, use 3.5 where possible. Also, remove `cmake_minimum_required()` and `project()` calls from individual cases where they are handled by `CMakeLists.txt`.
12 lines
341 B
CMake
12 lines
341 B
CMake
cmake_policy(SET CMP0004 NEW)
|
|
|
|
add_library(foo SHARED empty.cpp)
|
|
add_library(bar SHARED empty.cpp)
|
|
add_library(bat SHARED empty.cpp)
|
|
|
|
# The negation here avoids the error.
|
|
target_link_libraries(foo "$<$<NOT:$<TARGET_POLICY:CMP0004>>: bar >")
|
|
|
|
# The below line causes the error.
|
|
target_link_libraries(foo "$<$<TARGET_POLICY:CMP0004>: bat >")
|