Files
Tyler Yankee 858fdd426b add_custom_command: Disallow exe-suffixed targets in DEPENDS
Two targets whose names differ only in a `.exe` suffix create a
conflict when adding target- and file-level dependencies for a custom
command. Add CMP0212 to provide compatibility with the old behavior.

Issue: #27612
2026-03-23 09:50:46 -04:00

13 lines
395 B
CMake

include(RunCMake)
function(run_cmake_case_cmp0212 case)
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
run_cmake(${case})
set(RunCMake_TEST_NO_CLEAN 1)
set(RunCMake_TEST_OUTPUT_MERGE 1)
run_cmake_command(${case}-build ${CMAKE_COMMAND} --build . --target ${ARGN})
endfunction()
run_cmake_case_cmp0212(CMP0212-OLD tgt1)
run_cmake_case_cmp0212(CMP0212-NEW tgt1 bar)