summaryrefslogtreecommitdiff
path: root/Tests/RunCMake/try_compile/OutputDirAsFlag.cmake
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2022-08-31 10:14:29 -0400
committerRobert Maynard <rmaynard@nvidia.com>2022-09-07 15:08:41 -0400
commit0c141b0393de6fccbef5ab54e93c70720345ed92 (patch)
treecd9e71e56595f115868155c366e9aae0f517d73b /Tests/RunCMake/try_compile/OutputDirAsFlag.cmake
parentecfc63a9b0e73b2c9525a4ba65ceb22759ab00fd (diff)
downloadcmake-0c141b0393de6fccbef5ab54e93c70720345ed92.tar.gz
try_compile: Record output location instead of reverse computing it
Fixes #23887, #23942, #20163, #18288
Diffstat (limited to 'Tests/RunCMake/try_compile/OutputDirAsFlag.cmake')
-rw-r--r--Tests/RunCMake/try_compile/OutputDirAsFlag.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/RunCMake/try_compile/OutputDirAsFlag.cmake b/Tests/RunCMake/try_compile/OutputDirAsFlag.cmake
new file mode 100644
index 0000000000..5c4dca51f6
--- /dev/null
+++ b/Tests/RunCMake/try_compile/OutputDirAsFlag.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+set(CMAKE_BUILD_TYPE RelWithDebInfo)
+
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ COPY_FILE "${CMAKE_CURRENT_BINARY_DIR}/out.bin"
+ CMAKE_FLAGS "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=bin"
+ )