diff options
author | Clément Bénier <clement.benier@iot.bzh> | 2019-05-29 14:36:51 +0200 |
---|---|---|
committer | Clément Bénier <clement.benier@iot.bzh> | 2019-05-29 16:25:36 +0200 |
commit | 3490ab7e6fc57edb8c94f2ec4b2c94b14a60b953 (patch) | |
tree | 3d7e7e9084ad45cf1c9d117fc3021a80888181fb | |
parent | 9ad5e65f72f79ea4a608b7028d6ee16c5d10e342 (diff) |
02-variables.cmake: warns - unset project optionshalibut_7.99.1halibut/7.99.17.99.1
- add warnings when PROJECT_DESCRIPTION and HOMEPAGE_URL are unset
BUG-AGL: SPEC-2464
Change-Id: I24bd6e2428a1c4a89561740a4fc4a55bb14a3a2a
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
-rw-r--r-- | src/cmake/cmake.d/02-variables.cmake | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/cmake/cmake.d/02-variables.cmake b/src/cmake/cmake.d/02-variables.cmake index f95db48..8d42cd8 100644 --- a/src/cmake/cmake.d/02-variables.cmake +++ b/src/cmake/cmake.d/02-variables.cmake @@ -89,9 +89,22 @@ elseif(NOT PROJECT_VERSION AND VERSION) set(PROJECT_VERSION ${VERSION}) endif() +if(NOT PROJECT_DESCRIPTION) + message(WARNING "${Red}No description found. Please set a PROJECT_DESCRIPTION cmake variable in your config.cmake.") + set(PROJECT_DESCRIPTION "-") +endif() + +if(NOT HOMEPAGE_URL) + message(WARNING "${Red}No homepage url found. Please set a PROJECT_URL cmake variable in your config.cmake.") +endif() + # Release additionnals informations isn't supported so setting project # attributes then add the dirty flag if git repo not sync'ed -project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES ${PROJECT_LANGUAGES} DESCRIPTION ${PROJECT_DESCRIPTION} HOMEPAGE_URL ${PROJECT_URL}) +if(HOMEPAGE_URL) + project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES ${PROJECT_LANGUAGES} DESCRIPTION ${PROJECT_DESCRIPTION} HOMEPAGE_URL ${PROJECT_URL}) +else() + project(${PROJECT_NAME} VERSION ${PROJECT_VERSION} LANGUAGES ${PROJECT_LANGUAGES} DESCRIPTION ${PROJECT_DESCRIPTION}) +endif() if(NOT ${DIRTY_FLAG}) set(PROJECT_VERSION "${PROJECT_VERSION}-${COMMIT_HASH}-dirty") else() |