CMake/Tests/InterfaceLibrary/headerdir/CMakeLists.txt
Brad King ac14cbf017 Allow add_dependencies() on INTERFACE libraries (#15414)
Revert commit v3.0.0-rc1~175^2~20 (add_dependencies: Disallow use with
INTERFACE_LIBRARY, 2013-12-25).  Teach our dependency analysis to
transitively follow INTERFACE target utility dependencies as was done or
IMPORTED targets in commit v2.8.6~127^2~1 (Allow add_dependencies() on
imported targets, 2010-11-19).  Extend the InterfaceLibrary test with a
case to cover header generation for a header-only INTERFACE library via
a custom target.
2015-03-27 16:25:09 -04:00

14 lines
390 B
CMake

set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
add_library(headeriface INTERFACE)
add_custom_target(headeriface_gen
COMMENT "Generating iface_header_builddir.h"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/iface_header_builddir.h.in
${CMAKE_CURRENT_BINARY_DIR}/iface_header_builddir.h
VERBATIM
)
add_dependencies(headeriface headeriface_gen)