mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-20 21:50:53 -06:00
Use the `IMPLICIT_DEPENDS` option of `add_custom_command` and place the command in a custom target. Verify that `INCLUDE_DIRECTORIES` of that custom target are honored. This is a case that was not really designed to work but happens to work, is useful, and makes sense. Add a test case make sure it continues to work. Issue: #16830
14 lines
596 B
CMake
14 lines
596 B
CMake
add_custom_command(
|
|
OUTPUT output.cxx
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx output.cxx
|
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx
|
|
IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/MakeCustomIncludes.cxx)
|
|
add_custom_target(generate ALL DEPENDS output.cxx)
|
|
set_property(TARGET generate PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
file(GENERATE OUTPUT check-$<LOWER_CASE:$<CONFIG>>.cmake CONTENT "
|
|
set(check_pairs
|
|
\"${CMAKE_CURRENT_BINARY_DIR}/output.cxx|${CMAKE_CURRENT_BINARY_DIR}/MakeCustomIncludes.h\"
|
|
)
|
|
")
|