summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeOnly/ProjectIncludeBefore
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2019-03-28 19:43:40 (GMT)
committerRuslan Baratov <ruslan_baratov@yahoo.com>2019-04-01 17:30:19 (GMT)
commit076118694995c19de7637156322818f3994de76a (patch)
tree232852f10182ebbc3773e7ee122c058dd8ff7aa1 /Tests/CMakeOnly/ProjectIncludeBefore
parent3e129d71bc12a325c0548aaaea24470cd172470b (diff)
downloadCMake-076118694995c19de7637156322818f3994de76a.zip
CMake-076118694995c19de7637156322818f3994de76a.tar.gz
CMake-076118694995c19de7637156322818f3994de76a.tar.bz2
project: Add variable CMAKE_PROJECT_INCLUDE_BEFORE
Diffstat (limited to 'Tests/CMakeOnly/ProjectIncludeBefore')
-rw-r--r--Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt5
-rw-r--r--Tests/CMakeOnly/ProjectIncludeBefore/include.cmake9
2 files changed, 14 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt b/Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt
new file mode 100644
index 0000000..5cd9cba
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt
@@ -0,0 +1,5 @@
+set(FOO TRUE)
+project(ProjectInclude LANGUAGES NONE)
+if(NOT AUTO_INCLUDE)
+ message(FATAL_ERROR "include file not found")
+endif()
diff --git a/Tests/CMakeOnly/ProjectIncludeBefore/include.cmake b/Tests/CMakeOnly/ProjectIncludeBefore/include.cmake
new file mode 100644
index 0000000..0a4799d
--- /dev/null
+++ b/Tests/CMakeOnly/ProjectIncludeBefore/include.cmake
@@ -0,0 +1,9 @@
+if(NOT FOO)
+ message(FATAL_ERROR "FOO is not set")
+endif()
+
+if(NOT "${PROJECT_NAME}" STREQUAL "")
+ message(FATAL_ERROR "PROJECT_NAME should be empty")
+endif()
+
+set(AUTO_INCLUDE TRUE)