summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2013-10-01 20:35:59 +0100
committerRoger Leigh <rleigh@debian.org>2013-10-01 20:35:59 +0100
commit14d9638732bead1dbfe979781e0581a4ab885f3a (patch)
tree3e8e51df19bc3086fb02db322ae9b244beb3f706
parent204f85917adbd9b556f3beeab2ea22089db8440f (diff)
downloadschroot-14d9638732bead1dbfe979781e0581a4ab885f3a.tar.gz
cmake: Split out release settings into GitReleasePolicy
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/GitRelease.cmake7
-rw-r--r--cmake/GitReleasePolicy.cmake2
3 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 28db1695..0b9e276e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -28,8 +28,8 @@ set(GIT_VERSION_FILE_COMPAT "VERSION"
CACHE FILEPATH "Location of compatibility version metadata")
set(GIT_VERSION_FILE_USE_COMPAT ON
CACHE BOOL "Use compatibility version file")
-set(GIT_DIST_BRANCH distribution-${GIT_RELEASE_VERSION_MAJOR}.${GIT_RELEASE_VERSION_MINOR}
- CACHE STRING "Distribution branch name")
+set(GIT_RELEASE_POLICY_FILE "cmake/GitReleasePolicy.cmake"
+ CACHE FILEPATH "Location of release policy configuration")
include("${PROJECT_SOURCE_DIR}/cmake/GitRelease.cmake")
set(VERSION ${GIT_RELEASE_VERSION})
diff --git a/cmake/GitRelease.cmake b/cmake/GitRelease.cmake
index 0c71cb42..6f4e264f 100644
--- a/cmake/GitRelease.cmake
+++ b/cmake/GitRelease.cmake
@@ -267,6 +267,10 @@ set(GIT_VERSION_FILE_USE_COMPAT OFF
CACHE BOOL "Create compatibility version file in distributed source tree")
mark_as_advanced(FORCE GIT_VERSION_FILE GIT_VERSION_FILE_COMPAT GIT_VERSION_FILE_USE_COMPAT)
+# Release policy settings
+set(GIT_RELEASE_POLICY_FILE "GitReleasePolicy.cmake"
+ CACHE FILEPATH "Location of release policy configuration")
+
# Release sanity checking
set(GIT_RELEASE_CHECK_UNCOMMITTED ON
CACHE BOOL "Check for uncommitted files in working tree")
@@ -584,6 +588,9 @@ set(GIT_DIST_ROOT ${GIT_DIST_TMPDIR}/${GIT_DIST_NAME}
mark_as_advanced(FORCE GIT_DIST_BRANCH GIT_DIST_COMMIT_MESSAGE GIT_DIST_NAME GIT_DIST_TMPDIR GIT_DIST_ROOT)
endif (NOT CMAKE_SCRIPT_MODE_FILE)
+if(EXISTS ${GIT_RELEASE_POLICY_FILE})
+ include("${GIT_RELEASE_POLICY_FILE}")
+endif(EXISTS ${GIT_RELEASE_POLICY_FILE})
function(git_check_repo)
if(NOT EXISTS ${PROJECT_SOURCE_DIR}/.git)
diff --git a/cmake/GitReleasePolicy.cmake b/cmake/GitReleasePolicy.cmake
new file mode 100644
index 00000000..a5ad00f3
--- /dev/null
+++ b/cmake/GitReleasePolicy.cmake
@@ -0,0 +1,2 @@
+set(GIT_DIST_BRANCH "distribution-${GIT_RELEASE_VERSION_MAJOR}.${GIT_RELEASE_VERSION_MINOR}"
+ CACHE STRING "Distribution branch name" FORCE)