summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-01-29 14:28:01 (GMT)
committerBrad King <brad.king@kitware.com>2014-01-29 14:40:51 (GMT)
commit16d040c958c68c38b2c0642b4094245af28c1910 (patch)
treec91d9e31022776c5682cd6fe7a673721bd6186b2 /Tests/RunCMake
parent00007dcc365797f71ebba2c7d31ab20abc4019e6 (diff)
downloadCMake-16d040c958c68c38b2c0642b4094245af28c1910.zip
CMake-16d040c958c68c38b2c0642b4094245af28c1910.tar.gz
CMake-16d040c958c68c38b2c0642b4094245af28c1910.tar.bz2
project: Add optional LANGUAGES keyword
Teach the project() command to recognize an optional "LANGUAGES" keyword after the project name and prior to the list of languages. Do not allow multiple copies of the keyword. If the keyword is specified and no languages are listed, imply NONE.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/project/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/project/LanguagesEmpty-stdout.txt1
-rw-r--r--Tests/RunCMake/project/LanguagesEmpty.cmake3
-rw-r--r--Tests/RunCMake/project/LanguagesImplicit-stdout.txt1
-rw-r--r--Tests/RunCMake/project/LanguagesImplicit.cmake3
-rw-r--r--Tests/RunCMake/project/LanguagesNONE-stdout.txt1
-rw-r--r--Tests/RunCMake/project/LanguagesNONE.cmake3
-rw-r--r--Tests/RunCMake/project/LanguagesTwice-result.txt1
-rw-r--r--Tests/RunCMake/project/LanguagesTwice-stderr.txt4
-rw-r--r--Tests/RunCMake/project/LanguagesTwice.cmake2
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake6
12 files changed, 29 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 9646e67..c29b736 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -82,6 +82,7 @@ add_RunCMake_test(include)
add_RunCMake_test(include_directories)
add_RunCMake_test(list)
add_RunCMake_test(message)
+add_RunCMake_test(project)
add_RunCMake_test(string)
add_RunCMake_test(try_compile)
add_RunCMake_test(set)
diff --git a/Tests/RunCMake/project/CMakeLists.txt b/Tests/RunCMake/project/CMakeLists.txt
new file mode 100644
index 0000000..12cd3c7
--- /dev/null
+++ b/Tests/RunCMake/project/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.4)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/project/LanguagesEmpty-stdout.txt b/Tests/RunCMake/project/LanguagesEmpty-stdout.txt
new file mode 100644
index 0000000..fb9c7e8
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesEmpty-stdout.txt
@@ -0,0 +1 @@
+ENABLED_LANGUAGES='NONE'
diff --git a/Tests/RunCMake/project/LanguagesEmpty.cmake b/Tests/RunCMake/project/LanguagesEmpty.cmake
new file mode 100644
index 0000000..4de2cca
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesEmpty.cmake
@@ -0,0 +1,3 @@
+project(ProjectA LANGUAGES)
+get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+message(STATUS "ENABLED_LANGUAGES='${langs}'")
diff --git a/Tests/RunCMake/project/LanguagesImplicit-stdout.txt b/Tests/RunCMake/project/LanguagesImplicit-stdout.txt
new file mode 100644
index 0000000..fb9c7e8
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesImplicit-stdout.txt
@@ -0,0 +1 @@
+ENABLED_LANGUAGES='NONE'
diff --git a/Tests/RunCMake/project/LanguagesImplicit.cmake b/Tests/RunCMake/project/LanguagesImplicit.cmake
new file mode 100644
index 0000000..e408454
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesImplicit.cmake
@@ -0,0 +1,3 @@
+project(ProjectA NONE)
+get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+message(STATUS "ENABLED_LANGUAGES='${langs}'")
diff --git a/Tests/RunCMake/project/LanguagesNONE-stdout.txt b/Tests/RunCMake/project/LanguagesNONE-stdout.txt
new file mode 100644
index 0000000..fb9c7e8
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesNONE-stdout.txt
@@ -0,0 +1 @@
+ENABLED_LANGUAGES='NONE'
diff --git a/Tests/RunCMake/project/LanguagesNONE.cmake b/Tests/RunCMake/project/LanguagesNONE.cmake
new file mode 100644
index 0000000..2c0125f
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesNONE.cmake
@@ -0,0 +1,3 @@
+project(ProjectA LANGUAGES NONE)
+get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+message(STATUS "ENABLED_LANGUAGES='${langs}'")
diff --git a/Tests/RunCMake/project/LanguagesTwice-result.txt b/Tests/RunCMake/project/LanguagesTwice-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesTwice-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/project/LanguagesTwice-stderr.txt b/Tests/RunCMake/project/LanguagesTwice-stderr.txt
new file mode 100644
index 0000000..9c69dd0
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesTwice-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at LanguagesTwice.cmake:1 \(project\):
+ LANGUAGES may be specified at most once.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/project/LanguagesTwice.cmake b/Tests/RunCMake/project/LanguagesTwice.cmake
new file mode 100644
index 0000000..6c4a3dc
--- /dev/null
+++ b/Tests/RunCMake/project/LanguagesTwice.cmake
@@ -0,0 +1,2 @@
+project(ProjectA LANGUAGES NONE LANGUAGES)
+message("This line not reached.")
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
new file mode 100644
index 0000000..cac0f46
--- /dev/null
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -0,0 +1,6 @@
+include(RunCMake)
+
+run_cmake(LanguagesImplicit)
+run_cmake(LanguagesEmpty)
+run_cmake(LanguagesNONE)
+run_cmake(LanguagesTwice)