diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-11-08 11:31:10 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-11-08 11:31:10 +0100 |
commit | c38e3212cee645e28bc121bc50a61fe17e33832e (patch) | |
tree | 475a7453a9da0e0db6ff5c785b802ff6bedec3a1 | |
parent | b418056848a94b68da2b4b40923e888535738c4e (diff) |
Fix: version variable detection.
Gives instructions in the error message.
Change-Id: I56ff89932d8222116c091e25bfa5fc3b0489d5e8
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | src/cmake/cmake.d/02-variables.cmake | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmake/cmake.d/02-variables.cmake b/src/cmake/cmake.d/02-variables.cmake index 951a681..4ced24e 100644 --- a/src/cmake/cmake.d/02-variables.cmake +++ b/src/cmake/cmake.d/02-variables.cmake @@ -81,9 +81,9 @@ execute_process(COMMAND git status --short # Include project configuration # ------------------------------ -if(NOT DEFINED PROJECT_VERSION AND NOT DEFINED GIT_PROJECT_VERSION) - message(FATAL_ERROR "${Red}No version tag found from your project's source directory and no PROJECT_VERSION set in your config.cmake file. Abort!") -elseif(NOT DEFINED PROJECT_VERSION AND DEFINED GIT_PROJECT_VERSION) +if(NOT PROJECT_VERSION AND NOT GIT_PROJECT_VERSION) + message(FATAL_ERROR "${Red}No version tag found from your project's source directory and no PROJECT_VERSION set in your config.cmake file. Please set a version tag or cmake variable in your config.cmake. Abort!") +elseif(NOT PROJECT_VERSION AND GIT_PROJECT_VERSION) set(PROJECT_VERSION ${GIT_PROJECT_VERSION}) endif() |