Add_StepDependencies.cmake 1.0 KB

12345678910111213141516171819202122232425
  1. cmake_minimum_required(VERSION ${CMAKE_VERSION})
  2. if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12)
  3. cmake_policy(SET CMP0114 NEW)
  4. else()
  5. cmake_policy(SET CMP0114 OLD) # Test deprecated behavior.
  6. endif()
  7. include(ExternalProject)
  8. ExternalProject_Add(BAR URL https://cmake.org/bar.tar.gz)
  9. ExternalProject_Add(FOO URL https://cmake.org/foo.tar.gz STEP_TARGETS update)
  10. ExternalProject_Add_Step(FOO do_something COMMAND ${CMAKE_COMMAND} -E echo "Doing something")
  11. ExternalProject_Add_Step(FOO do_something_else COMMAND ${CMAKE_COMMAND} -E echo "Doing something else")
  12. ExternalProject_Add_StepTargets(FOO do_something)
  13. # download and do_something_else are not targets, but the file-level
  14. # dependency are set.
  15. ExternalProject_Add_StepDependencies(FOO download BAR)
  16. ExternalProject_Add_StepDependencies(FOO do_something_else BAR)
  17. # update and do_something are targets, therefore both file-level and
  18. # target-level dependencies are set.
  19. ExternalProject_Add_StepDependencies(FOO update BAR)
  20. ExternalProject_Add_StepDependencies(FOO do_something BAR)