From 69050f4d16ae649e074b5fd7cb3bae1811b403a8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 8 Jun 2017 11:53:01 -0400 Subject: Tests: Use full output paths in file(GENERATE) calls We don't define behavior for relative paths to the OUTPUT argument. Fix our tests to use full paths. --- Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake | 2 +- Tests/RunCMake/BuildDepends/C-Exe.cmake | 2 +- Tests/RunCMake/BuildDepends/Custom-Always.cmake | 2 +- Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake | 2 +- Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake | 2 +- Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake | 2 +- Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake | 2 +- Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake | 2 +- Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake | 2 +- Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake | 2 +- Tests/RunCMake/File_Generate/ReRunCMake.cmake | 2 +- Tests/RunCMake/File_Generate/WriteIfDifferent.cmake | 2 +- Tests/RunCMake/Framework/FrameworkLayout.cmake | 2 +- Tests/RunCMake/TargetObjects/NoTarget.cmake | 4 ++-- Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake index ef3301216a..87b0de0104 100644 --- a/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake +++ b/Tests/RunCMake/BuildDepends/C-Exe-Manifest.cmake @@ -11,7 +11,7 @@ endif() ]]) endif() -file(GENERATE OUTPUT check-$>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$>.cmake CONTENT " set(check_pairs \"$|${CMAKE_CURRENT_BINARY_DIR}/test.manifest\" ) diff --git a/Tests/RunCMake/BuildDepends/C-Exe.cmake b/Tests/RunCMake/BuildDepends/C-Exe.cmake index 5057ca91dc..ad5cd4d47c 100644 --- a/Tests/RunCMake/BuildDepends/C-Exe.cmake +++ b/Tests/RunCMake/BuildDepends/C-Exe.cmake @@ -2,7 +2,7 @@ enable_language(C) add_executable(main ${CMAKE_CURRENT_BINARY_DIR}/main.c) -file(GENERATE OUTPUT check-$>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$>.cmake CONTENT " set(check_pairs \"$|${CMAKE_CURRENT_BINARY_DIR}/main.c\" ) diff --git a/Tests/RunCMake/BuildDepends/Custom-Always.cmake b/Tests/RunCMake/BuildDepends/Custom-Always.cmake index d412708a1f..c7e7fb0bc7 100644 --- a/Tests/RunCMake/BuildDepends/Custom-Always.cmake +++ b/Tests/RunCMake/BuildDepends/Custom-Always.cmake @@ -16,7 +16,7 @@ add_custom_command( add_custom_target(drive ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/after-always) -file(GENERATE OUTPUT check-$>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$>.cmake CONTENT " set(check_pairs \"${CMAKE_CURRENT_BINARY_DIR}/always-updated|${CMAKE_CURRENT_BINARY_DIR}/before-always\" \"${CMAKE_CURRENT_BINARY_DIR}/after-always|${CMAKE_CURRENT_BINARY_DIR}/always-updated\" diff --git a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake index 687c8271fd..1e1f22ad08 100644 --- a/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake +++ b/Tests/RunCMake/BuildDepends/Custom-Symbolic-and-Byproduct.cmake @@ -16,7 +16,7 @@ add_custom_command( add_custom_target(drive ALL DEPENDS use-byproduct) add_dependencies(drive produce) -file(GENERATE OUTPUT check-$>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$>.cmake CONTENT " if (check_step EQUAL 1) set(check_pairs \"${CMAKE_CURRENT_BINARY_DIR}/use-byproduct|${CMAKE_CURRENT_BINARY_DIR}/gen-byproduct-stamp\" diff --git a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake index 0f92e0edbd..8b2ae78cfb 100644 --- a/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake +++ b/Tests/RunCMake/BuildDepends/MakeCustomIncludes.cmake @@ -6,7 +6,7 @@ add_custom_command( add_custom_target(generate ALL DEPENDS output.cxx) set_property(TARGET generate PROPERTY INCLUDE_DIRECTORIES ${CMAKE_CURRENT_BINARY_DIR}) -file(GENERATE OUTPUT check-$>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$>.cmake CONTENT " set(check_pairs \"${CMAKE_CURRENT_BINARY_DIR}/output.cxx|${CMAKE_CURRENT_BINARY_DIR}/MakeCustomIncludes.h\" ) diff --git a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake index add9aeb693..af6ad86ba8 100644 --- a/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake +++ b/Tests/RunCMake/BuildDepends/MakeInProjectOnly.cmake @@ -3,7 +3,7 @@ get_filename_component(include_dir "${CMAKE_BINARY_DIR}" PATH) include_directories("${include_dir}") add_executable(MakeInProjectOnly MakeInProjectOnly.c) set(CMAKE_DEPENDS_IN_PROJECT_ONLY 1) -file(GENERATE OUTPUT check-$>.cmake CONTENT " +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/check-$>.cmake CONTENT " if (check_step EQUAL 1) set(check_pairs \"$|${include_dir}/MakeInProjectOnly.h\" diff --git a/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake index 1a373b9281..8fc1218f22 100644 --- a/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake +++ b/Tests/RunCMake/CPackInstallProperties/FilenameGenex.cmake @@ -1,6 +1,6 @@ add_executable(mytest test.cpp) -file(GENERATE OUTPUT runtest_info.cmake CONTENT [[ +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info.cmake CONTENT [[ set(EXPECTED_MYTEST_NAME "$") ]]) diff --git a/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake index 77fe8ed5d8..b23d3c7df3 100644 --- a/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake +++ b/Tests/RunCMake/CPackInstallProperties/PerConfigValue.cmake @@ -6,7 +6,7 @@ foreach(CONFIG IN LISTS CMAKE_CONFIGURATION_TYPES) OUTPUT_NAME_${UPPER_CONFIG} bar_${CONFIG}) endforeach() -file(GENERATE OUTPUT runtest_info_$.cmake CONTENT [[ +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info_$.cmake CONTENT [[ set(CPACK_BUILD_CONFIG "$") set(EXPECTED_MYTEST_NAME "$") ]]) diff --git a/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake index 2e1d4656cb..2001d9f4cb 100644 --- a/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake +++ b/Tests/RunCMake/CPackInstallProperties/ValueGenex.cmake @@ -1,6 +1,6 @@ add_executable(mytest test.cpp) -file(GENERATE OUTPUT runtest_info.cmake CONTENT [[ +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/runtest_info.cmake CONTENT [[ set(EXPECTED_MYTEST_NAME "$") ]]) diff --git a/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake b/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake index e2b081d482..59ccf197d9 100644 --- a/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake +++ b/Tests/RunCMake/File_Generate/COMPILE_LANGUAGE-genex.cmake @@ -7,6 +7,6 @@ target_compile_options(empty ) file(GENERATE - OUTPUT opts-$.txt + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opts-$.txt CONTENT "$\n" ) diff --git a/Tests/RunCMake/File_Generate/ReRunCMake.cmake b/Tests/RunCMake/File_Generate/ReRunCMake.cmake index 109d60e6fe..541d86df25 100644 --- a/Tests/RunCMake/File_Generate/ReRunCMake.cmake +++ b/Tests/RunCMake/File_Generate/ReRunCMake.cmake @@ -1,5 +1,5 @@ file(GENERATE - OUTPUT output_file.txt + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/output_file.txt" INPUT "${CMAKE_CURRENT_BINARY_DIR}/input_file.txt" ) diff --git a/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake index d1d832a111..bb36a4c48e 100644 --- a/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake +++ b/Tests/RunCMake/File_Generate/WriteIfDifferent.cmake @@ -1,5 +1,5 @@ file(GENERATE - OUTPUT output_file.txt + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/output_file.txt CONTENT "123" ) diff --git a/Tests/RunCMake/Framework/FrameworkLayout.cmake b/Tests/RunCMake/Framework/FrameworkLayout.cmake index 3d62a8af34..4f4245952a 100644 --- a/Tests/RunCMake/Framework/FrameworkLayout.cmake +++ b/Tests/RunCMake/Framework/FrameworkLayout.cmake @@ -22,4 +22,4 @@ set_source_files_properties(some.txt PROPERTIES MACOSX_PACKAGE_LOCATION somedir) add_custom_command(TARGET Framework POST_BUILD COMMAND /usr/bin/file $) -file(GENERATE OUTPUT FrameworkName.cmake CONTENT "set(framework-dir \"$\")\n") +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkName.cmake CONTENT "set(framework-dir \"$\")\n") diff --git a/Tests/RunCMake/TargetObjects/NoTarget.cmake b/Tests/RunCMake/TargetObjects/NoTarget.cmake index 5d7e33e792..268577d50c 100644 --- a/Tests/RunCMake/TargetObjects/NoTarget.cmake +++ b/Tests/RunCMake/TargetObjects/NoTarget.cmake @@ -1,7 +1,7 @@ add_library(iface INTERFACE) target_sources(iface INTERFACE $) -file(GENERATE OUTPUT test_output CONTENT $) -file(GENERATE OUTPUT test_output2 CONTENT $) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output CONTENT $) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output2 CONTENT $) install(FILES $ DESTINATION objects) diff --git a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake index 8e5fdd047a..3bb3e374d2 100644 --- a/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake +++ b/Tests/RunCMake/TargetObjects/NotObjlibTarget.cmake @@ -1,3 +1,3 @@ add_library(StaticLib empty.cpp) -file(GENERATE OUTPUT test_output CONTENT $) +file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/test_output CONTENT $) -- cgit v1.2.1