CMP0073.cmake 518 B

123456789101112131415161718
  1. enable_language(C)
  2. add_library(warn empty.c)
  3. target_link_libraries(warn bar)
  4. message(STATUS "warn_LIB_DEPENDS='${warn_LIB_DEPENDS}'")
  5. cmake_policy(SET CMP0073 OLD)
  6. add_library(old empty.c)
  7. target_link_libraries(old bar)
  8. message(STATUS "old_LIB_DEPENDS='${old_LIB_DEPENDS}'")
  9. cmake_policy(SET CMP0073 NEW)
  10. add_library(new empty.c)
  11. target_link_libraries(new bar)
  12. message(STATUS "new_LIB_DEPENDS='${new_LIB_DEPENDS}'")
  13. if(DEFINED new_LIB_DEPENDS)
  14. message(FATAL_ERROR "new_LIB_DEPENDS set but should not be")
  15. endif()