summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_compile
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-05-15 19:30:34 (GMT)
committerBrad King <brad.king@kitware.com>2013-05-31 14:01:50 (GMT)
commitd06db7ebe80636876d9701064b16cec9d3e2e3cb (patch)
tree10e0c1b7e4b421385749ec5b1b69c689c22ff6e0 /Tests/RunCMake/try_compile
parentb680824a5fdcc54c265c64ce8958f9d80acad70d (diff)
downloadCMake-d06db7ebe80636876d9701064b16cec9d3e2e3cb.zip
CMake-d06db7ebe80636876d9701064b16cec9d3e2e3cb.tar.gz
CMake-d06db7ebe80636876d9701064b16cec9d3e2e3cb.tar.bz2
try_compile: Refactor argument processing
Process all arguments in a single loop using a simple state machine. While at it, fix some error message typos. Also allow LINK_LIBRARIES with no actual libraries to disable use of the -DLINK_LIBRARIES=... from the CMAKE_FLAGS. This was already possible in the old logic if LINK_LIBRARIES was immediately followed by another keyword argument instead of the end of the argument list, so allow it in general. Update the RunCMake.try_compile test cases accordingly.
Diffstat (limited to 'Tests/RunCMake/try_compile')
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile2-result.txt (renamed from Tests/RunCMake/try_compile/NoLinkLibraries-result.txt)0
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/NoCopyFile2.cmake (renamed from Tests/RunCMake/try_compile/NoLinkLibraries.cmake)2
-rw-r--r--Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable2-result.txt1
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt4
-rw-r--r--Tests/RunCMake/try_compile/NoOutputVariable2.cmake2
-rw-r--r--Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt2
-rw-r--r--Tests/RunCMake/try_compile/RunCMakeTest.cmake3
11 files changed, 17 insertions, 9 deletions
diff --git a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
index 096fd98..d65d9488 100644
--- a/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
+++ b/Tests/RunCMake/try_compile/NoCopyFile-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at NoCopyFile.cmake:1 \(try_compile\):
- COPY_FILE specified but there is no variable
+ COPY_FILE must be followed by a file path
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt b/Tests/RunCMake/try_compile/NoCopyFile2-result.txt
index d00491f..d00491f 100644
--- a/Tests/RunCMake/try_compile/NoLinkLibraries-result.txt
+++ b/Tests/RunCMake/try_compile/NoCopyFile2-result.txt
diff --git a/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt
new file mode 100644
index 0000000..e889524
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoCopyFile2-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoCopyFile2.cmake:1 \(try_compile\):
+ COPY_FILE must be followed by a file path
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake b/Tests/RunCMake/try_compile/NoCopyFile2.cmake
index 04c5758..04b7f68 100644
--- a/Tests/RunCMake/try_compile/NoLinkLibraries.cmake
+++ b/Tests/RunCMake/try_compile/NoCopyFile2.cmake
@@ -1,2 +1,2 @@
try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
- LINK_LIBRARIES)
+ COPY_FILE CMAKE_FLAGS -DA=B)
diff --git a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt b/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
deleted file mode 100644
index 507dce0..0000000
--- a/Tests/RunCMake/try_compile/NoLinkLibraries-stderr.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-CMake Error at NoLinkLibraries.cmake:1 \(try_compile\):
- LINK_LIBRARIES specified but there is no content
-Call Stack \(most recent call first\):
- CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
index 77ede4c..18ad751 100644
--- a/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
+++ b/Tests/RunCMake/try_compile/NoOutputVariable-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at NoOutputVariable.cmake:1 \(try_compile\):
- OUTPUT_VARIABLE specified but there is no variable
+ OUTPUT_VARIABLE must be followed by a variable name
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt b/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoOutputVariable2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt
new file mode 100644
index 0000000..8b2cc25
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoOutputVariable2-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at NoOutputVariable2.cmake:1 \(try_compile\):
+ OUTPUT_VARIABLE must be followed by a variable name
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/NoOutputVariable2.cmake b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake
new file mode 100644
index 0000000..ad9ac9a
--- /dev/null
+++ b/Tests/RunCMake/try_compile/NoOutputVariable2.cmake
@@ -0,0 +1,2 @@
+try_compile(RESULT ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src.c
+ OUTPUT_VARIABLE CMAKE_FLAGS -DA=B)
diff --git a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
index cf02efb..025e658 100644
--- a/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
+++ b/Tests/RunCMake/try_compile/NonSourceCompileDefinitions-stderr.txt
@@ -1,4 +1,4 @@
CMake Error at NonSourceCompileDefinitions.cmake:1 \(try_compile\):
- COMPILE_FLAGS specified on a srcdir type TRY_COMPILE
+ COMPILE_DEFINITIONS specified on a srcdir type TRY_COMPILE
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index a4248ec..31643cf 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -4,8 +4,9 @@ run_cmake(NoArgs)
run_cmake(OneArg)
run_cmake(TwoArgs)
run_cmake(NoCopyFile)
+run_cmake(NoCopyFile2)
run_cmake(NoOutputVariable)
-run_cmake(NoLinkLibraries)
+run_cmake(NoOutputVariable2)
run_cmake(BadLinkLibraries)
run_cmake(NonSourceCopyFile)
run_cmake(NonSourceCompileDefinitions)