cmake/Tests/RunCMake/InterfaceLibrary/ExcludeFromAll.cmake

8 lines
400 B
CMake
Raw Normal View History

2021-09-14 00:13:48 +02:00
# Test an interface library with a custom command, but excluded from all.
add_custom_command(OUTPUT iface.txt COMMAND ${CMAKE_COMMAND} -E touch iface.txt)
add_library(iface INTERFACE EXCLUDE_FROM_ALL iface.txt)
# Test that EXCLUDE_FROM_ALL is allowed even if the interface library has
# no sources, and does not cause it to appear in the build system.
add_library(iface2 INTERFACE EXCLUDE_FROM_ALL)