summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Ninja/CustomCommandExplicitDepends.cmake
blob: e0c2434dbefc5e086d047bebb23fe2fc312e0abc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
cmake_minimum_required(VERSION 3.26)
project(CustomCommandExplicitDepends C)

add_custom_command(
  OUTPUT  "${CMAKE_CURRENT_BINARY_DIR}/command.h"
  COMMAND "${CMAKE_COMMAND}" -E touch
          "${CMAKE_CURRENT_BINARY_DIR}/command.h"
  COMMENT "Creating command.h"
  DEPENDS_EXPLICIT_ONLY
)

add_library(dep STATIC dep.c)

add_library(top STATIC
  top.c
  "${CMAKE_CURRENT_BINARY_DIR}/command.h"
)
target_link_libraries(top PRIVATE dep)