CMP0004-OLD.cmake 575 B

123456789101112131415161718192021
  1. cmake_minimum_required(VERSION 2.8.4)
  2. cmake_policy(SET CMP0004 OLD)
  3. add_library(foo SHARED empty.cpp)
  4. add_library(bar SHARED empty.cpp)
  5. add_library(bing SHARED empty.cpp)
  6. add_library(bung SHARED empty.cpp)
  7. cmake_policy(SET CMP0004 NEW)
  8. add_library(bat SHARED empty.cpp)
  9. target_link_libraries(foo "$<1: bar >")
  10. target_link_libraries(bing "$<$<NOT:$<TARGET_POLICY:CMP0004>>: bar >")
  11. target_link_libraries(bung "$<$<TARGET_POLICY:CMP0004>: bar >")
  12. # The line below causes the error because the policy is NEW when bat
  13. # is created.
  14. target_link_libraries(bat "$<1: bar >")