summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/build_command/BeforeProject-result.txt1
-rw-r--r--Tests/RunCMake/build_command/BeforeProject-stderr.txt5
-rw-r--r--Tests/RunCMake/build_command/BeforeProject.cmake2
-rw-r--r--Tests/RunCMake/build_command/CMakeLists.txt4
-rw-r--r--Tests/RunCMake/build_command/RunCMakeTest.cmake4
5 files changed, 15 insertions, 1 deletions
diff --git a/Tests/RunCMake/build_command/BeforeProject-result.txt b/Tests/RunCMake/build_command/BeforeProject-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/build_command/BeforeProject-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/build_command/BeforeProject-stderr.txt b/Tests/RunCMake/build_command/BeforeProject-stderr.txt
new file mode 100644
index 0000000..d3d7661
--- /dev/null
+++ b/Tests/RunCMake/build_command/BeforeProject-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at BeforeProject.cmake:[0-9]+ \(build_command\):
+ build_command\(\) requires CMAKE_MAKE_PROGRAM to be defined. Call project\(\)
+ or enable_language\(\) first.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/build_command/BeforeProject.cmake b/Tests/RunCMake/build_command/BeforeProject.cmake
new file mode 100644
index 0000000..15788d1
--- /dev/null
+++ b/Tests/RunCMake/build_command/BeforeProject.cmake
@@ -0,0 +1,2 @@
+build_command(MAKECOMMAND_DEFAULT_VALUE)
+project(${RunCMake_TEST} NONE)
diff --git a/Tests/RunCMake/build_command/CMakeLists.txt b/Tests/RunCMake/build_command/CMakeLists.txt
index e8db6b0..f6e84c0 100644
--- a/Tests/RunCMake/build_command/CMakeLists.txt
+++ b/Tests/RunCMake/build_command/CMakeLists.txt
@@ -1,3 +1,5 @@
cmake_minimum_required(VERSION 2.8)
-project(${RunCMake_TEST} NONE)
+if(NOT NoProject)
+ project(${RunCMake_TEST} NONE)
+endif()
include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/build_command/RunCMakeTest.cmake b/Tests/RunCMake/build_command/RunCMakeTest.cmake
index 4525c57..eaa1d77 100644
--- a/Tests/RunCMake/build_command/RunCMakeTest.cmake
+++ b/Tests/RunCMake/build_command/RunCMakeTest.cmake
@@ -2,3 +2,7 @@ include(RunCMake)
run_cmake(ErrorsOFF)
run_cmake(ErrorsON)
+
+set(RunCMake_TEST_OPTIONS -DNoProject=1)
+run_cmake(BeforeProject)
+unset(RunCMake_TEST_OPTIONS)