From 7e382f2ddb849d7c0c120031aa7f39598e66f182 Mon Sep 17 00:00:00 2001 From: Clément Bénier Date: Wed, 29 May 2019 14:36:51 +0200 Subject: 02-variables.cmake: warns - unset project options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add warnings when PROJECT_DESCRIPTION and HOMEPAGE_URL are unset BUG-AGL: SPEC-2464 Change-Id: I24bd6e2428a1c4a89561740a4fc4a55bb14a3a2a Signed-off-by: Clément Bénier --- src/cmake/cmake.d/02-variables.cmake | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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() -- cgit 1.2.3-korg