CMake/Tests/BuildDepends/Project/link_depends_no_shared_check.cmake
Brad King 306796e862 Teach BuildDepends test to cover LINK_DEPENDS_NO_SHARED
Build a shared library and an executable linking to it inside the inner
test.  Set LINK_DEPENDS_NO_SHARED on the executable.  Add a custom
target to compare the output file times.  Verify that on the first build
the executable is newer than the library.  Then modify a library source
file.  Verify that on the second build the library is newer because the
executable did not have a dependency to re-link.
2012-11-09 09:26:51 -05:00

8 lines
184 B
CMake

if(NOT EXISTS "${lib}" OR NOT EXISTS "${exe}")
file(REMOVE "${out}")
elseif("${exe}" IS_NEWER_THAN "${lib}")
file(WRITE "${out}" "1\n")
else()
file(WRITE "${out}" "0\n")
endif()