CMP0111-imported-target-prelude.cmake 825 B

1234567891011121314151617181920212223242526272829303132
  1. enable_language(CXX)
  2. find_package(Qt5 REQUIRED COMPONENTS Core)
  3. # Detect `-NOTFOUND` libraries at generate time.
  4. cmake_policy(SET CMP0111 NEW)
  5. add_executable(imported::executable IMPORTED)
  6. add_library(imported::shared SHARED IMPORTED)
  7. add_library(imported::static STATIC IMPORTED)
  8. add_library(imported::unknown UNKNOWN IMPORTED)
  9. add_library(imported::interface INTERFACE IMPORTED)
  10. add_library(imported::module MODULE IMPORTED)
  11. function (set_location target name loc)
  12. set_property(TARGET "imported::${target}" PROPERTY
  13. "IMPORTED_${name}" "${loc}")
  14. endfunction ()
  15. set(CMAKE_AUTOMOC 1)
  16. add_library(automoc
  17. empty.cpp)
  18. target_link_libraries(automoc
  19. PRIVATE
  20. imported::shared
  21. imported::static
  22. imported::unknown
  23. imported::interface)
  24. add_dependencies(automoc
  25. imported::executable
  26. imported::module)