From ff2004d43010926d4084abc1743ebaa1f39ad0b2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 21 Feb 2025 20:45:13 -0500 Subject: [PATCH] Tests: Extend CustomTransitiveProperties with non-transitive LINK_LIBRARIES --- .../CustomTransitiveProperties/CMakeLists.txt | 25 ++++++++++++++++++- Tests/CustomTransitiveProperties/check.cmake | 9 +++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Tests/CustomTransitiveProperties/CMakeLists.txt b/Tests/CustomTransitiveProperties/CMakeLists.txt index 8c276e9448..4d2a0aa81a 100644 --- a/Tests/CustomTransitiveProperties/CMakeLists.txt +++ b/Tests/CustomTransitiveProperties/CMakeLists.txt @@ -93,7 +93,7 @@ target_compile_definitions(CustomTransitiveProperties PRIVATE # Test TRANSITIVE_*_PROPERTY evaluation outside of usage requirements. add_executable(check-args check-args.c) set(out "${CMAKE_CURRENT_BINARY_DIR}/out-$.txt") -file(GENERATE OUTPUT "${out}" CONTENT "# file(GENERATE) produced: +set(in_CUSTOM [====[ iface1 CUSTOM_A: '$' iface1 INTERFACE_CUSTOM_A: '$' iface2 CUSTOM_A: '$' @@ -126,6 +126,20 @@ main CUSTOM_V: '$' main INTERFACE_CUSTOM_V: '$' main CUSTOM_W: '$' main INTERFACE_CUSTOM_W: '$' +]====]) +set(in_LINK_LIBRARIES [====[ +iface1 LINK_LIBRARIES: '$' +iface1 INTERFACE_LINK_LIBRARIES: '$' +iface2 LINK_LIBRARIES: '$' +iface2 INTERFACE_LINK_LIBRARIES: '$' +static1 LINK_LIBRARIES: '$' +static1 INTERFACE_LINK_LIBRARIES: '$' +main LINK_LIBRARIES: '$' +main INTERFACE_LINK_LIBRARIES: '$' +]====]) +file(GENERATE OUTPUT "${out}" CONTENT "# file(GENERATE) produced: +${in_CUSTOM} +${in_LINK_LIBRARIES} ") add_custom_target(check ALL VERBATIM COMMAND ${CMAKE_COMMAND} -Dconfig=$ -Dout=${out} -P${CMAKE_CURRENT_SOURCE_DIR}/check.cmake @@ -145,4 +159,13 @@ add_custom_target(check ALL VERBATIM "$" "CUSTOM_U_MAIN;CUSTOM_U_STATIC1_IFACE;CUSTOM_U_IFACE2;CUSTOM_U_TARGET_TYPE_EXECUTABLE;CUSTOM_U_IFACE1;CUSTOM_U_TARGET_NAME_CUSTOMTRANSITIVEPROPERTIES;CUSTOM_U_OBJECT1_IFACE" "$" "CUSTOM_V_MAIN;CUSTOM_V_STATIC1_IFACE;CUSTOM_V_IFACE1" "$" "CUSTOM_W_MAIN;CUSTOM_W_IFACE1;CUSTOM_W_OBJECT1_IFACE" + COMMAND check-args + "$" "" + "$" "" + "$" "" + "$" "iface1" + "$" "iface2" + "$" "$" + "$" "static1;object1" + "$" "" ) diff --git a/Tests/CustomTransitiveProperties/check.cmake b/Tests/CustomTransitiveProperties/check.cmake index d7130c84a8..9d4408c74a 100644 --- a/Tests/CustomTransitiveProperties/check.cmake +++ b/Tests/CustomTransitiveProperties/check.cmake @@ -32,6 +32,15 @@ main CUSTOM_V: 'CUSTOM_V_MAIN;CUSTOM_V_STATIC1_IFACE;CUSTOM_V_IFACE1' main INTERFACE_CUSTOM_V: '' main CUSTOM_W: 'CUSTOM_W_MAIN;CUSTOM_W_IFACE1;CUSTOM_W_OBJECT1_IFACE' main INTERFACE_CUSTOM_W: '' + +iface1 LINK_LIBRARIES: '' +iface1 INTERFACE_LINK_LIBRARIES: '' +iface2 LINK_LIBRARIES: '' +iface2 INTERFACE_LINK_LIBRARIES: 'iface1' +static1 LINK_LIBRARIES: 'iface2' +static1 INTERFACE_LINK_LIBRARIES: '\$' +main LINK_LIBRARIES: 'static1;object1' +main INTERFACE_LINK_LIBRARIES: '' ]]) string(REGEX REPLACE "\r\n" "\n" expect "${expect}") string(REGEX REPLACE "\n+$" "" expect "${expect}")