cmake/Tests/RunCMake/install/CMP0177.cmake
2024-11-11 15:18:55 +01:00

30 lines
783 B
CMake

enable_language(C)
add_library(foo1 STATIC obj1.c)
add_library(foo2 STATIC obj2.c)
set_target_properties(foo2 PROPERTIES HIDDEN_DOUBLE_DOT "..")
# All the shouldNotRemainX path components below should be normalized out when
# CMP0177 is set to NEW, and retained for OLD and WARN.
install(TARGETS foo1
EXPORT pkg
ARCHIVE DESTINATION shouldNotRemain1/../lib
)
install(TARGETS foo2
EXPORT pkg
ARCHIVE DESTINATION shouldNotRemain2/$<TARGET_PROPERTY:foo2,HIDDEN_DOUBLE_DOT>/lib
)
install(EXPORT pkg
DESTINATION shouldNotRemain3/deeper/../.././lib/cmake/pkg
FILE pkg-config.cmake
)
install(FILES obj1.c
DESTINATION shouldNotRemain4/anotherSubdir/../../files
)
install(DIRECTORY dir
# Trailing slash here is significant
DESTINATION shouldNotRemain5/../dirs/more/../
)