From d9d11cb2e9e9f7ca3f1b63e4a951ed9888a14e8c Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Sun, 29 Jan 2017 20:19:06 +0300 Subject: [PATCH] Make EVENT_STAGE_NAME non cached It did not work before correctly anyway, since cmake do not reset cache entries by default, so that reset to "beta" didn't work. But I don't think that making this variable cached is useful, so let's remove this. (cherry picked from commit fe2c2622c389d7e9529b3c2fa828fb69cc985a1e) --- CMakeLists.txt | 32 ++++++++++++++++---------------- README.md | 3 --- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4a34f3d..dd6bf670 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,25 +76,25 @@ set(EVENT_PACKAGE_VERSION set(EVENT_NUMERIC_VERSION 0x02010800) # only a subset of names can be used, defaults to "beta" -set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE} - CACHE STRING "set the stage name (beta|alpha|release)") +set(EVENT_STAGE_NAME ${EVENT_VERSION_STAGE}) # a list that defines what can set for EVENT_STAGE_VERSION set(EVENT__ALLOWED_STAGE_NAMES - rc - beta - alpha - release) - -# attempt to find the EVENT__STAGE_VERSION in the allowed list -# of accepted stage names, the return value is stord in -# EVENT__STAGE_RET - -list(FIND EVENT__ALLOWED_STAGE_NAMES - ${EVENT_STAGE_NAME} - EVENT__STAGE_RET) - -if (EVENT__STAGE_RET EQUAL "-1") + rc + beta + alpha + alpha-dev + release + stable +) +list( + FIND EVENT__ALLOWED_STAGE_NAMES + "${EVENT_STAGE_NAME}" + EVENT__STAGE_RET +) +if (EVENT__STAGE_RET EQUAL -1) + message(WARNING + "stage ${EVENT_STAGE_NAME} is not allowed, reset to beta") set(EVENT_STAGE_NAME beta) endif() diff --git a/README.md b/README.md index 5e3eb4df..150bfe0d 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,6 @@ EVENT__ENABLE_VERBOSE_DEBUG:BOOL=OFF # on the the cross compilation target to verify that it works. See cmake # documentation for try_run for more details EVENT__FORCE_KQUEUE_CHECK:BOOL=OFF - -# set EVENT_STAGE_VERSION -EVENT__STAGE_VERSION:STRING=beta ``` __More variables can be found by running `cmake -LAH `__