diff options
Diffstat (limited to 'Tests/RunCMake/GenEx-TARGET_FILE')
5 files changed, 34 insertions, 1 deletions
diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake index ccec633..55b0f9b 100644 --- a/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake +++ b/Tests/RunCMake/GenEx-TARGET_FILE/RunCMakeTest.cmake @@ -2,8 +2,10 @@ include(RunCMake) run_cmake(TARGET_FILE-recursion) run_cmake(OUTPUT_NAME-recursion) -run_cmake(TARGET_FILE_PREFIX) +run_cmake(TARGET_FILE_DIR-dependency) +run_cmake(TARGET_FILE_DIR-no-dependency) run_cmake(TARGET_FILE_PREFIX-imported-target) +run_cmake(TARGET_FILE_PREFIX) run_cmake(TARGET_FILE_PREFIX-non-valid-target) run_cmake(TARGET_LINKER_FILE_PREFIX-non-valid-target) run_cmake(TARGET_FILE_SUFFIX) diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency-result.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency-stderr.txt b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency-stderr.txt new file mode 100644 index 0000000..0a79032 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency-stderr.txt @@ -0,0 +1,6 @@ +.*Policy CMP0112 is not set.* +.*Dependency being added to target.* +.*exec1.* +CMake Error: The inter-target dependency graph.* +.*"exec1" of type EXECUTABLE + depends on "copyFile" \(strong\) diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency.cmake new file mode 100644 index 0000000..e18ccd9 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-dependency.cmake @@ -0,0 +1,12 @@ +set(CMAKE_POLICY_WARNING_CMP0112 TRUE) + +enable_language (C) + +add_executable (exec1 empty.c) + +add_custom_target(copyFile + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/empty.c" + "$<TARGET_FILE_DIR:exec1>/$<TARGET_FILE_BASE_NAME:exec1>_e.c" +) +add_dependencies(exec1 copyFile) diff --git a/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-no-dependency.cmake b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-no-dependency.cmake new file mode 100644 index 0000000..e048e10 --- /dev/null +++ b/Tests/RunCMake/GenEx-TARGET_FILE/TARGET_FILE_DIR-no-dependency.cmake @@ -0,0 +1,12 @@ +cmake_policy(SET CMP0112 NEW) + +enable_language (C) + +add_executable (exec1 empty.c) + +add_custom_target(copyFile + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/empty.c" + "$<TARGET_FILE_DIR:exec1>/$<TARGET_FILE_BASE_NAME:exec1>_e.c" +) +add_dependencies(exec1 copyFile) |