Files
CMake/Tests/RunCMake/Ninja/LooseObjectDepends.cmake
T
Brad King 1edf138506 Tests/RunCMake: Update cmake_minimum_required versions
For policy-specific tests, use the version before the policy was
introduced.  Otherwise, use 3.5 where possible.

Also, remove `cmake_minimum_required()` and `project()` calls from
individual cases where they are handled by `CMakeLists.txt`.
2023-02-11 06:24:22 -05:00

26 lines
738 B
CMake

enable_language(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")
add_custom_target(create-command.h
DEPENDS
"${CMAKE_CURRENT_BINARY_DIR}/command.h")
add_custom_target(create-target.h
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/target.h"
COMMAND "${CMAKE_COMMAND}" -E touch
"${CMAKE_CURRENT_BINARY_DIR}/target.h"
COMMENT "Creating target.h")
add_library(dep SHARED dep.c)
add_dependencies(dep create-command.h create-target.h)
target_include_directories(dep
PUBLIC
"${CMAKE_CURRENT_BINARY_DIR}")
add_library(top top.c)
target_link_libraries(top PRIVATE dep)