summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-07-25 12:47:49 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-07-25 12:47:49 (GMT)
commit10e54cd6c9437c27b3a758f8de1455086c53fae5 (patch)
tree6b5bf96206ddfbbd13301049eb40bc13dce2f432 /Tests
parent17fb435b213c660bd320cc85752444f5e13ce90a (diff)
parent5837f19690c7ef490e70baedce0a8b89594da3af (diff)
downloadCMake-10e54cd6c9437c27b3a758f8de1455086c53fae5.zip
CMake-10e54cd6c9437c27b3a758f8de1455086c53fae5.tar.gz
CMake-10e54cd6c9437c27b3a758f8de1455086c53fae5.tar.bz2
Merge topic 'dev/export-target-without-language'
5837f19 export: Error when exporting a target without a language
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt1
-rw-r--r--Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt6
-rw-r--r--Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake2
-rw-r--r--Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake3
6 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index e47fae4..6d1bca2 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -115,4 +115,5 @@ if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
endif()
add_RunCMake_test(File_Generate)
+add_RunCMake_test(ExportWithoutLanguage)
add_RunCMake_test(target_link_libraries)
diff --git a/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt
new file mode 100644
index 0000000..67a0ae3
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error: CMake can not determine linker language for target: NoLanguage
+CMake Error at NoLanguage.cmake:2 \(export\):
+ Exporting the target "NoLanguage" is not allowed since its linker language
+ cannot be determined
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake
new file mode 100644
index 0000000..2ede854
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/NoLanguage.cmake
@@ -0,0 +1,2 @@
+add_library(NoLanguage header.h)
+export(TARGETS NoLanguage FILE "${CMAKE_CURRENT_BINARY_DIR}/export.cmake")
diff --git a/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake b/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake
new file mode 100644
index 0000000..f77f4eb
--- /dev/null
+++ b/Tests/RunCMake/ExportWithoutLanguage/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(NoLanguage)