diff options
Diffstat (limited to 'Tests')
63 files changed, 564 insertions, 0 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..cc2e49a --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_genex_Debug\.txt +depend_echo_genex_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-ninja-stdout.txt new file mode 100644 index 0000000..cc2e49a --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_genex_Debug\.txt +depend_echo_genex_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..214e747 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_genex_cmd_Debug\.txt +depend_echo_genex_cmd_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-ninja-stdout.txt new file mode 100644 index 0000000..842336d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_cmd-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_genex_cmd_Debug\.txt +depend_echo_genex_cmd_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..eafe30b --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_genex_out_Debug\.txt +depend_echo_genex_out_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-ninja-stdout.txt new file mode 100644 index 0000000..eafe30b --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_genex_out-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_genex_out_Debug\.txt +depend_echo_genex_out_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..e7b74b9 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_raw_Debug\.txt +depend_echo_raw_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-ninja-stdout.txt new file mode 100644 index 0000000..2e01d6a --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-depend_echo_raw-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating depend_echo_raw_Debug\.txt +depend_echo_raw_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..7455c25 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] Generating echo_depend_Debug\.txt +echo_depend_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-ninja-stdout.txt new file mode 100644 index 0000000..7455c25 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] Generating echo_depend_Debug\.txt +echo_depend_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..6d5620d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Release\.txt +depend_Release\.txt +\[2/2\] Generating echo_depend_cmd_Debug\.txt +echo_depend_cmd_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-ninja-stdout.txt new file mode 100644 index 0000000..2f0f1f1 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_cmd-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] Generating echo_depend_cmd_Debug\.txt +echo_depend_cmd_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..39f5471 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] Generating echo_depend_out_Debug\.txt +echo_depend_out_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-ninja-stdout.txt new file mode 100644 index 0000000..39f5471 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_depend_out-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] Generating echo_depend_out_Debug\.txt +echo_depend_out_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..cc43cda --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] Generating echo_genex_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Release' 'echo_genex_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-ninja-stdout.txt new file mode 100644 index 0000000..11985c6 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_genex_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_genex_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..68a8cd1 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_genex_out_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_genex_out_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-ninja-stdout.txt new file mode 100644 index 0000000..76b409d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_genex_out-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_genex_out_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_genex_out_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-stderr.txt new file mode 100644 index 0000000..86f7995 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-in-release-graph-ninja-stderr.txt @@ -0,0 +1 @@ +ninja: error: 'echo_no_cross_byproduct_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_byproduct-Debug', missing and no known rule to make it diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-ninja-stdout.txt new file mode 100644 index 0000000..1c74b71 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_no_cross_byproduct_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_byproduct_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-stderr.txt new file mode 100644 index 0000000..e41cb17 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-in-release-graph-ninja-stderr.txt @@ -0,0 +1 @@ +ninja: error: 'echo_no_cross_byproduct_if_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_byproduct_if-Debug', missing and no known rule to make it diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-ninja-stdout.txt new file mode 100644 index 0000000..294d48b --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_byproduct_if-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_no_cross_byproduct_if_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_byproduct_if_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-result.txt new file mode 100644 index 0000000..d197c91 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-result.txt @@ -0,0 +1 @@ +[^0] diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-stderr.txt new file mode 100644 index 0000000..2ea22fa --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-in-release-graph-ninja-stderr.txt @@ -0,0 +1 @@ +ninja: error: 'echo_no_cross_output_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_output-Debug', missing and no known rule to make it diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-ninja-stdout.txt new file mode 100644 index 0000000..1f4cc41 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_no_cross_output\.txt, echo_no_cross_output_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_output_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-result.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-stderr.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-stderr.txt new file mode 100644 index 0000000..fde66ea --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-in-release-graph-ninja-stderr.txt @@ -0,0 +1 @@ +ninja: error: 'echo_no_cross_output_if_Debug\.txt', needed by 'CMakeFiles/echo_no_cross_output_if-Debug', missing and no known rule to make it diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-ninja-stdout.txt new file mode 100644 index 0000000..dc31f3b --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_no_cross_output_if-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_no_cross_output_a\.txt, echo_no_cross_output_if_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_no_cross_output_if_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..01ebae3 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] Generating echo_raw_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Debug' 'echo_raw_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-ninja-stdout.txt new file mode 100644 index 0000000..242c9b0 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_raw-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_raw_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_raw_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..e77ef1a --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] echo_target_depend +echo_target_depend_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-ninja-stdout.txt new file mode 100644 index 0000000..e77ef1a --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] echo_target_depend +echo_target_depend_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..8196fcb --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Release\.txt +depend_Release\.txt +\[2/2\] echo_target_depend_cmd +echo_target_depend_cmd_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-ninja-stdout.txt new file mode 100644 index 0000000..d45dcc2 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_cmd-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] echo_target_depend_cmd +echo_target_depend_cmd_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..45f2e57 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,5 @@ +^(Recompacting log\.\.\. +)?\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] echo_target_depend_out +echo_target_depend_out_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-ninja-stdout.txt new file mode 100644 index 0000000..d90a2f3 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/2\] Generating depend_Debug\.txt +depend_Debug\.txt +\[2/2\] echo_target_depend_out +echo_target_depend_out_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..73b403f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] echo_target_genex +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Release' 'echo_target_genex_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-ninja-stdout.txt new file mode 100644 index 0000000..c374ce8 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] echo_target_genex +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_genex_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..ad6d6e0 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] echo_target_genex_out +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_genex_out_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-ninja-stdout.txt new file mode 100644 index 0000000..e819fdf --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_genex_out-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] echo_target_genex_out +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_genex_out_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..34df645 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] echo_target_raw +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Debug' 'echo_target_raw_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-ninja-stdout.txt new file mode 100644 index 0000000..3fa5488 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_raw-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] echo_target_raw +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_target_raw_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..f504d98 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] target_no_cross_byproduct +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Release' 'target_no_cross_byproduct\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-ninja-stdout.txt new file mode 100644 index 0000000..6e933b2 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_no_cross_byproduct-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] target_no_cross_byproduct +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'target_no_cross_byproduct\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake new file mode 100644 index 0000000..5d6f421 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake @@ -0,0 +1,167 @@ +enable_language(C) + +add_executable(echo echo.c) + +add_custom_command( + OUTPUT echo_raw_$<CONFIG>.txt + COMMAND echo $<CONFIG> echo_raw_$<CONFIG>.txt + WORKING_DIRECTORY $<CONFIG> + ) + +add_custom_command( + OUTPUT echo_genex_$<IF:$<CONFIG:Debug>,Debug,$<IF:$<CONFIG:Release>,Release,$<IF:$<CONFIG:MinSizeRel>,MinSizeRel,RelWithDebInfo>>>.txt + COMMAND $<TARGET_FILE:echo> $<COMMAND_CONFIG:$<CONFIG>> echo_genex_$<OUTPUT_CONFIG:$<CONFIG>>.txt + WORKING_DIRECTORY $<OUTPUT_CONFIG:$<CONFIG>> + ) + +add_custom_command( + OUTPUT echo_genex_out_$<CONFIG>.txt + COMMAND $<OUTPUT_CONFIG:$<TARGET_FILE:echo>> $<CONFIG> echo_genex_out_$<CONFIG>.txt + WORKING_DIRECTORY $<COMMAND_CONFIG:$<CONFIG>> + ) + +add_custom_command( + OUTPUT depend_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo depend_$<CONFIG>.txt + ) + +add_custom_command( + OUTPUT echo_depend_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo echo_depend_$<CONFIG>.txt + DEPENDS depend_$<CONFIG>.txt + ) + +add_custom_command( + OUTPUT echo_depend_out_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo echo_depend_out_$<CONFIG>.txt + DEPENDS $<OUTPUT_CONFIG:depend_$<CONFIG>.txt> + ) + +add_custom_command( + OUTPUT echo_depend_cmd_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo echo_depend_cmd_$<CONFIG>.txt + DEPENDS $<COMMAND_CONFIG:depend_$<CONFIG>.txt> + ) + +add_custom_command( + OUTPUT depend_echo_raw_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo depend_echo_raw_$<CONFIG>.txt + DEPENDS echo + ) + +add_custom_command( + OUTPUT depend_echo_genex_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo depend_echo_genex_$<CONFIG>.txt + DEPENDS $<TARGET_FILE:echo> + ) + +add_custom_command( + OUTPUT depend_echo_genex_out_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo depend_echo_genex_out_$<CONFIG>.txt + DEPENDS $<OUTPUT_CONFIG:$<TARGET_FILE:echo>> + ) + +add_custom_command( + OUTPUT depend_echo_genex_cmd_$<CONFIG>.txt + COMMAND ${CMAKE_COMMAND} -E echo depend_echo_genex_cmd_$<CONFIG>.txt + DEPENDS $<COMMAND_CONFIG:$<TARGET_FILE:echo>> + ) + +# An OUTPUT that is not per-config prevents cross-config generation. +add_custom_command( + OUTPUT echo_no_cross_output.txt echo_no_cross_output_$<CONFIG>.txt + COMMAND echo $<CONFIG> echo_no_cross_output_$<CONFIG>.txt + WORKING_DIRECTORY $<CONFIG> + ) +add_custom_command( + OUTPUT echo_no_cross_output_$<IF:$<CONFIG:Debug>,a,b>.txt echo_no_cross_output_if_$<CONFIG>.txt + COMMAND echo $<CONFIG> echo_no_cross_output_if_$<CONFIG>.txt + WORKING_DIRECTORY $<CONFIG> + ) + +# BYPRODUCTS that are not per-config prevent cross-config generation. +add_custom_command( + OUTPUT echo_no_cross_byproduct_$<CONFIG>.txt + BYPRODUCTS echo_no_cross_byproduct.txt + COMMAND echo $<CONFIG> echo_no_cross_byproduct_$<CONFIG>.txt + WORKING_DIRECTORY $<CONFIG> + ) +add_custom_command( + OUTPUT echo_no_cross_byproduct_if_$<CONFIG>.txt + BYPRODUCTS echo_no_cross_byproduct_$<IF:$<CONFIG:Debug>,a,b>.txt + COMMAND echo $<CONFIG> echo_no_cross_byproduct_if_$<CONFIG>.txt + WORKING_DIRECTORY $<CONFIG> + ) + +foreach(case + echo_raw + echo_genex + echo_genex_out + echo_depend + echo_depend_out + echo_depend_cmd + depend + depend_echo_raw + depend_echo_genex + depend_echo_genex_out + depend_echo_genex_cmd + echo_no_cross_output + echo_no_cross_output_if + echo_no_cross_byproduct + echo_no_cross_byproduct_if + ) + set_property(SOURCE + ${CMAKE_CURRENT_BINARY_DIR}/${case}_Debug.txt + ${CMAKE_CURRENT_BINARY_DIR}/${case}_Release.txt + ${CMAKE_CURRENT_BINARY_DIR}/${case}_MinSizeRel.txt + ${CMAKE_CURRENT_BINARY_DIR}/${case}_RelWithDebInfo.txt + PROPERTY SYMBOLIC 1) + add_custom_target(${case} DEPENDS ${case}_$<CONFIG>.txt) +endforeach() + +add_custom_target(echo_target_raw + BYPRODUCTS echo_target_raw_$<CONFIG>.txt + COMMENT echo_target_raw + COMMAND echo $<CONFIG> echo_target_raw_$<CONFIG>.txt + WORKING_DIRECTORY $<CONFIG> + ) + +add_custom_target(echo_target_genex + BYPRODUCTS echo_target_genex_$<CONFIG>.txt + COMMENT echo_target_genex + COMMAND $<TARGET_FILE:echo> $<COMMAND_CONFIG:$<CONFIG>> echo_target_genex_$<OUTPUT_CONFIG:$<CONFIG>>.txt + WORKING_DIRECTORY $<OUTPUT_CONFIG:$<CONFIG>> + ) + +add_custom_target(echo_target_genex_out + BYPRODUCTS echo_target_genex_out_$<CONFIG>.txt + COMMENT echo_target_genex_out + COMMAND $<OUTPUT_CONFIG:$<TARGET_FILE:echo>> $<CONFIG> echo_target_genex_out_$<CONFIG>.txt + WORKING_DIRECTORY $<COMMAND_CONFIG:$<CONFIG>> + ) + +add_custom_target(echo_target_depend + COMMAND ${CMAKE_COMMAND} -E echo echo_target_depend_$<CONFIG>.txt + DEPENDS depend_$<CONFIG>.txt + COMMENT echo_target_depend + ) + +add_custom_target(echo_target_depend_out + COMMAND ${CMAKE_COMMAND} -E echo echo_target_depend_out_$<CONFIG>.txt + DEPENDS $<OUTPUT_CONFIG:depend_$<CONFIG>.txt> + COMMENT echo_target_depend_out + ) + +add_custom_target(echo_target_depend_cmd + COMMAND ${CMAKE_COMMAND} -E echo echo_target_depend_cmd_$<CONFIG>.txt + DEPENDS $<COMMAND_CONFIG:depend_$<CONFIG>.txt> + COMMENT echo_target_depend_cmd + ) + +# BYPRODUCTS that are not per-config block cross-configs. +add_custom_target(target_no_cross_byproduct + BYPRODUCTS target_no_cross_byproduct.txt + COMMENT target_no_cross_byproduct + COMMAND echo $<CONFIG> target_no_cross_byproduct.txt + WORKING_DIRECTORY $<CONFIG> + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index 2411114..dc2db57 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -242,6 +242,102 @@ run_ninja(CustomCommandsAndTargets release-leaf-exe build-Release.ninja LeafExe) run_cmake_build(CustomCommandsAndTargets release-clean Release clean:all) run_ninja(CustomCommandsAndTargets release-leaf-byproduct build-Release.ninja main.c) +set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CustomCommandOutputGenex-build) +set(RunCMake_TEST_OPTIONS "-DCMAKE_CONFIGURATION_TYPES=Debug\\;Release\\;MinSizeRel\\;RelWithDebInfo;-DCMAKE_CROSS_CONFIGS=all") +run_cmake_configure(CustomCommandOutputGenex) +set(RunCMake_TEST_NO_CLEAN 1) +unset(RunCMake_TEST_OPTIONS) +# echo_raw +run_ninja(CustomCommandOutputGenex echo_raw-debug build-Debug.ninja echo_raw:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_raw-debug-in-release-graph build-Release.ninja echo_raw:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_genex +run_ninja(CustomCommandOutputGenex echo_genex-debug build-Debug.ninja echo_genex:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_genex-debug-in-release-graph build-Release.ninja echo_genex:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_genex_out +run_ninja(CustomCommandOutputGenex echo_genex_out-debug build-Debug.ninja echo_genex_out:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_genex_out-debug-in-release-graph build-Release.ninja echo_genex_out:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_depend* +run_ninja(CustomCommandOutputGenex echo_depend-debug build-Debug.ninja echo_depend:Debug) +run_ninja(CustomCommandOutputGenex echo_depend_out-debug build-Debug.ninja echo_depend_out_Debug.txt) +run_ninja(CustomCommandOutputGenex echo_depend_cmd-debug build-Debug.ninja echo_depend_cmd_Debug.txt) +run_ninja(CustomCommandOutputGenex echo_depend-debug-in-release-graph build-Release.ninja echo_depend:Debug) +run_ninja(CustomCommandOutputGenex echo_depend_out-debug-in-release-graph build-Release.ninja echo_depend_out_Debug.txt) +run_ninja(CustomCommandOutputGenex echo_depend_cmd-debug-in-release-graph build-Release.ninja echo_depend_cmd_Debug.txt) +# depend_echo_raw +run_ninja(CustomCommandOutputGenex depend_echo_raw-debug build-Debug.ninja depend_echo_raw:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex depend_echo_raw-debug-in-release-graph build-Release.ninja depend_echo_raw:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# depend_echo_genex +run_ninja(CustomCommandOutputGenex depend_echo_genex-debug build-Debug.ninja depend_echo_genex:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex depend_echo_genex-debug-in-release-graph build-Release.ninja depend_echo_genex:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# depend_echo_genex_out +run_ninja(CustomCommandOutputGenex depend_echo_genex_out-debug build-Debug.ninja depend_echo_genex_out:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex depend_echo_genex_out-debug-in-release-graph build-Release.ninja depend_echo_genex_out:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# depend_echo_genex_cmd +run_ninja(CustomCommandOutputGenex depend_echo_genex_cmd-debug build-Debug.ninja depend_echo_genex_cmd:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex depend_echo_genex_cmd-debug-in-release-graph build-Release.ninja depend_echo_genex_cmd:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# no_cross_output +run_ninja(CustomCommandOutputGenex echo_no_cross_output-debug build-Debug.ninja echo_no_cross_output:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_no_cross_output-debug-in-release-graph build-Release.ninja echo_no_cross_output:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# no_cross_output_if +run_ninja(CustomCommandOutputGenex echo_no_cross_output_if-debug build-Debug.ninja echo_no_cross_output_if:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_no_cross_output_if-debug-in-release-graph build-Release.ninja echo_no_cross_output_if:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# no_cross_byproduct +run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct-debug build-Debug.ninja echo_no_cross_byproduct:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct-debug-in-release-graph build-Release.ninja echo_no_cross_byproduct:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# no_cross_byproduct_if +run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct_if-debug build-Debug.ninja echo_no_cross_byproduct_if:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct_if-debug-in-release-graph build-Release.ninja echo_no_cross_byproduct_if:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_target_raw +run_ninja(CustomCommandOutputGenex echo_target_raw-debug build-Debug.ninja echo_target_raw:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_target_raw-debug-in-release-graph build-Release.ninja echo_target_raw:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_target_genex +run_ninja(CustomCommandOutputGenex echo_target_genex-debug build-Debug.ninja echo_target_genex:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_target_genex-debug-in-release-graph build-Release.ninja echo_target_genex:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_target_genex_out +run_ninja(CustomCommandOutputGenex echo_target_genex_out-debug build-Debug.ninja echo_target_genex_out:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_target_genex_out-debug-in-release-graph build-Release.ninja echo_target_genex_out:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_target_depend* +run_ninja(CustomCommandOutputGenex echo_target_depend-debug build-Debug.ninja echo_target_depend:Debug) +run_ninja(CustomCommandOutputGenex echo_target_depend_out-debug build-Debug.ninja echo_target_depend_out:Debug) +run_ninja(CustomCommandOutputGenex echo_target_depend_cmd-debug build-Debug.ninja CMakeFiles/echo_target_depend_cmd-Debug) # undocumented +run_ninja(CustomCommandOutputGenex echo_target_depend-debug-in-release-graph build-Release.ninja echo_target_depend:Debug) +run_ninja(CustomCommandOutputGenex echo_target_depend_out-debug-in-release-graph build-Release.ninja echo_target_depend_out:Debug) +run_ninja(CustomCommandOutputGenex echo_target_depend_cmd-debug-in-release-graph build-Release.ninja CMakeFiles/echo_target_depend_cmd-Debug) # undocumented +# target_no_cross_* +run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug build-Debug.ninja target_no_cross_byproduct:Debug) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug-in-release-graph build-Release.ninja target_no_cross_byproduct:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +unset(RunCMake_TEST_NO_CLEAN) + unset(RunCMake_TEST_BINARY_DIR) run_cmake(CustomCommandDepfile) diff --git a/Tests/RunCMake/NinjaMultiConfig/echo.c b/Tests/RunCMake/NinjaMultiConfig/echo.c new file mode 100644 index 0000000..48a187f --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/echo.c @@ -0,0 +1,21 @@ +#include <stdio.h> +#if defined(_WIN32) +# include <direct.h> +# define getcwd _getcwd +#else +# include <unistd.h> +#endif + +int main(int argc, char** argv) +{ + int i; + char cwd[1024]; + if (getcwd(cwd, sizeof(cwd)) != NULL) { + printf("'%s'$", cwd); + } + for (i = 0; i < argc; ++i) { + printf(" '%s'", argv[i]); + } + printf("\n"); + return 0; +} diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt index 6d51575..547fb1c 100644 --- a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt +++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt @@ -44,4 +44,24 @@ CMake Error at BadByproduct.cmake:7 \(add_custom_command\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) +)+( +CMake Error at BadByproduct.cmake:8 \(add_custom_command\): + Error evaluating generator expression: + + \$<OUTPUT_CONFIG:h> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + +)+( +CMake Error at BadByproduct.cmake:9 \(add_custom_command\): + Error evaluating generator expression: + + \$<COMMAND_CONFIG:i> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + )+ diff --git a/Tests/RunCMake/add_custom_command/BadByproduct.cmake b/Tests/RunCMake/add_custom_command/BadByproduct.cmake index 7c786a4..cf00f5b 100644 --- a/Tests/RunCMake/add_custom_command/BadByproduct.cmake +++ b/Tests/RunCMake/add_custom_command/BadByproduct.cmake @@ -5,3 +5,5 @@ add_custom_command(OUTPUT c BYPRODUCTS "a>") add_custom_command(OUTPUT d BYPRODUCTS "$<CONFIG>/#") add_custom_command(OUTPUT e BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/f) add_custom_command(OUTPUT f BYPRODUCTS "$<TARGET_PROPERTY:prop>") +add_custom_command(OUTPUT h BYPRODUCTS "$<OUTPUT_CONFIG:h>") +add_custom_command(OUTPUT i BYPRODUCTS "$<COMMAND_CONFIG:i>") diff --git a/Tests/RunCMake/add_custom_command/BadCommand-result.txt b/Tests/RunCMake/add_custom_command/BadCommand-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadCommand-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_custom_command/BadCommand-stderr.txt b/Tests/RunCMake/add_custom_command/BadCommand-stderr.txt new file mode 100644 index 0000000..470afd6 --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadCommand-stderr.txt @@ -0,0 +1,21 @@ +(CMake Error at BadCommand.cmake:1 \(add_custom_command\): + Error evaluating generator expression: + + \$<OUTPUT_CONFIG:a> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +)+(CMake Error at BadCommand.cmake:2 \(add_custom_command\): + Error evaluating generator expression: + + \$<COMMAND_CONFIG:b> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +)+ diff --git a/Tests/RunCMake/add_custom_command/BadCommand.cmake b/Tests/RunCMake/add_custom_command/BadCommand.cmake new file mode 100644 index 0000000..8c9c3f9 --- /dev/null +++ b/Tests/RunCMake/add_custom_command/BadCommand.cmake @@ -0,0 +1,3 @@ +add_custom_command(OUTPUT "a" COMMAND "$<1:$<OUTPUT_CONFIG:a>>") +add_custom_command(OUTPUT "b" COMMAND "$<1:$<COMMAND_CONFIG:b>>") +add_custom_target(drive DEPENDS "a" "b") diff --git a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt index 506bec9..2e43568 100644 --- a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt +++ b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt @@ -44,4 +44,24 @@ CMake Error at BadOutput.cmake:7 \(add_custom_command\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) +)+( +CMake Error at BadOutput.cmake:8 \(add_custom_command\): + Error evaluating generator expression: + + \$<OUTPUT_CONFIG:h> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + +)+( +CMake Error at BadOutput.cmake:9 \(add_custom_command\): + Error evaluating generator expression: + + \$<COMMAND_CONFIG:i> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + )+ diff --git a/Tests/RunCMake/add_custom_command/BadOutput.cmake b/Tests/RunCMake/add_custom_command/BadOutput.cmake index 77acb7f..f04bdd1 100644 --- a/Tests/RunCMake/add_custom_command/BadOutput.cmake +++ b/Tests/RunCMake/add_custom_command/BadOutput.cmake @@ -5,3 +5,5 @@ add_custom_command(OUTPUT "a>" COMMAND c) add_custom_command(OUTPUT "$<CONFIG>/#" COMMAND d) add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/e COMMAND f) add_custom_command(OUTPUT "$<TARGET_PROPERTY:prop>" COMMAND g) +add_custom_command(OUTPUT "$<OUTPUT_CONFIG:h>" COMMAND h) +add_custom_command(OUTPUT "$<COMMAND_CONFIG:i>" COMMAND i) diff --git a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake index aac085d..9c59b4b 100644 --- a/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_custom_command/RunCMakeTest.cmake @@ -6,6 +6,7 @@ run_cmake(AppendNotOutput) run_cmake(BadArgument) run_cmake(BadByproduct) run_cmake(BadOutput) +run_cmake(BadCommand) run_cmake(GeneratedProperty) run_cmake(LiteralQuotes) run_cmake(NoArguments) diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt index 4f0f005..da9af49 100644 --- a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt +++ b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt @@ -44,4 +44,24 @@ CMake Error at BadByproduct.cmake:7 \(add_custom_target\): Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) +)+( +CMake Error at BadByproduct.cmake:8 \(add_custom_target\): + Error evaluating generator expression: + + \$<OUTPUT_CONFIG:n> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + +)+( +CMake Error at BadByproduct.cmake:9 \(add_custom_target\): + Error evaluating generator expression: + + \$<COMMAND_CONFIG:p> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + )+ diff --git a/Tests/RunCMake/add_custom_target/BadByproduct.cmake b/Tests/RunCMake/add_custom_target/BadByproduct.cmake index e97f9fd..c317b83 100644 --- a/Tests/RunCMake/add_custom_target/BadByproduct.cmake +++ b/Tests/RunCMake/add_custom_target/BadByproduct.cmake @@ -5,3 +5,5 @@ add_custom_target(e BYPRODUCTS "a>" COMMAND f) add_custom_target(g BYPRODUCTS "$<CONFIG>/#" COMMAND h) add_custom_target(i BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/j COMMAND k) add_custom_target(l BYPRODUCTS "$<TARGET_PROPERTY:prop>" COMMAND m) +add_custom_target(n BYPRODUCTS "$<OUTPUT_CONFIG:n>" COMMAND o) +add_custom_target(p BYPRODUCTS "$<COMMAND_CONFIG:p>" COMMAND q) diff --git a/Tests/RunCMake/add_custom_target/BadCommand-result.txt b/Tests/RunCMake/add_custom_target/BadCommand-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/add_custom_target/BadCommand-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/add_custom_target/BadCommand-stderr.txt b/Tests/RunCMake/add_custom_target/BadCommand-stderr.txt new file mode 100644 index 0000000..dfdf8f8 --- /dev/null +++ b/Tests/RunCMake/add_custom_target/BadCommand-stderr.txt @@ -0,0 +1,21 @@ +(CMake Error at BadCommand.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OUTPUT_CONFIG:a> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +)+(CMake Error at BadCommand.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<COMMAND_CONFIG:b> + + Expression did not evaluate to a known generator expression +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +)+ diff --git a/Tests/RunCMake/add_custom_target/BadCommand.cmake b/Tests/RunCMake/add_custom_target/BadCommand.cmake new file mode 100644 index 0000000..dadf038 --- /dev/null +++ b/Tests/RunCMake/add_custom_target/BadCommand.cmake @@ -0,0 +1,4 @@ +add_custom_target(drive + COMMAND "$<1:$<OUTPUT_CONFIG:a>>" + COMMAND "$<1:$<COMMAND_CONFIG:b>>" + ) diff --git a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake index f5d5dd2..22a9ed4 100644 --- a/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_custom_target/RunCMakeTest.cmake @@ -1,6 +1,7 @@ include(RunCMake) run_cmake(BadByproduct) +run_cmake(BadCommand) run_cmake(BadTargetName) run_cmake(ByproductsNoCommand) run_cmake(CommandExpandsEmpty) |