diff options
author | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-22 17:43:14 (GMT) |
---|---|---|
committer | Matthew Woehlke <matthew.woehlke@kitware.com> | 2022-09-22 18:56:50 (GMT) |
commit | 611d80179006ba6670273fcfcad46b0bb64a36c2 (patch) | |
tree | 1975420c55f72ce6e9beb22c80aeae18398ded6b /Tests/RunCMake/try_compile | |
parent | a04eaf6742d98dd415ee939eae8c955c8afd1ce6 (diff) | |
download | CMake-611d80179006ba6670273fcfcad46b0bb64a36c2.zip CMake-611d80179006ba6670273fcfcad46b0bb64a36c2.tar.gz CMake-611d80179006ba6670273fcfcad46b0bb64a36c2.tar.bz2 |
try_compile: Add SOURCE_FROM_FILE
Add ability to copy try_compile (and try_run) source files from
arbitrary locations into the operation directory. This is included for
the sake of completion and consolidation, although use cases which
actually require this may be rare.
Diffstat (limited to 'Tests/RunCMake/try_compile')
4 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake index 0aa9039..d63624c 100644 --- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake +++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake @@ -23,6 +23,7 @@ unset(RunCMake_TEST_OPTIONS) run_cmake(SourceFromOneArg) run_cmake(SourceFromThreeArgs) run_cmake(SourceFromBadName) +run_cmake(SourceFromBadFile) run_cmake(ProjectCopyFile) run_cmake(NonSourceCopyFile) diff --git a/Tests/RunCMake/try_compile/SourceFromBadFile-result.txt b/Tests/RunCMake/try_compile/SourceFromBadFile-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/try_compile/SourceFromBadFile-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt b/Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt new file mode 100644 index 0000000..53a6d8d --- /dev/null +++ b/Tests/RunCMake/try_compile/SourceFromBadFile-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at SourceFromBadFile.cmake:[0-9]+ \(try_compile\): + SOURCE_FROM_FILE failed to copy "bad#source.c": No such file or directory +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/try_compile/SourceFromBadFile.cmake b/Tests/RunCMake/try_compile/SourceFromBadFile.cmake new file mode 100644 index 0000000..0a37f11 --- /dev/null +++ b/Tests/RunCMake/try_compile/SourceFromBadFile.cmake @@ -0,0 +1 @@ +try_compile(RESULT SOURCE_FROM_FILE bad.c "bad#source.c") |