summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/BuildDepends/Custom-Always.cmake
blob: d412708a1fa7f296102575e8023f9035dd8a3e02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/before-always
  COMMAND ${CMAKE_COMMAND} -E touch before-always
  )
add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/always
  COMMAND ${CMAKE_COMMAND} -E touch always-updated
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/before-always
  )
set_property(SOURCE always PROPERTY SYMBOLIC 1)
add_custom_command(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/after-always
  DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/always
  COMMAND ${CMAKE_COMMAND} -E touch after-always
  )

add_custom_target(drive ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/after-always)

file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
set(check_pairs
  \"${CMAKE_CURRENT_BINARY_DIR}/always-updated|${CMAKE_CURRENT_BINARY_DIR}/before-always\"
  \"${CMAKE_CURRENT_BINARY_DIR}/after-always|${CMAKE_CURRENT_BINARY_DIR}/always-updated\"
  )
")