mirror of
https://github.com/reactos/CMake.git
synced 2025-01-10 05:31:02 +00:00
5838aba1aa
Diagnostics which check the sanity of exported include paths previously skipped over any path containing a generator expression. Introduce a policy to issue an error message in such cases. The export files created in the OLD behavior are not usable, because they contain relative paths or paths to the source or build location which are not suitable for use on installation. CMake will report an error on import.
13 lines
392 B
CMake
13 lines
392 B
CMake
|
|
cmake_policy(SET CMP0041 OLD)
|
|
|
|
add_library(foo empty.cpp)
|
|
set_property(TARGET foo
|
|
PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
|
include/$<TARGET_PROPERTY:NAME>
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME>
|
|
${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME>
|
|
)
|
|
install(TARGETS foo EXPORT FooExport DESTINATION lib)
|
|
install(EXPORT FooExport DESTINATION lib/cmake)
|