mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
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`.
16 lines
321 B
CMake
16 lines
321 B
CMake
enable_language(C)
|
|
|
|
add_library(a a.c)
|
|
|
|
add_library(b c.c)
|
|
target_link_libraries(a b)
|
|
|
|
add_library(c c.c)
|
|
add_dependencies(a c)
|
|
|
|
get_property(DEPS_A TARGET a PROPERTY MANUALLY_ADDED_DEPENDENCIES)
|
|
|
|
if(NOT DEPS_A STREQUAL "c")
|
|
message(FATAL_ERROR "Expected target c being a dependency of a but got: '${DEPS_A}'")
|
|
endif()
|