summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bénier <clement.benier@iot.bzh>2019-05-29 14:36:51 +0200
committerClément Bénier <clement.benier@iot.bzh>2019-05-29 16:25:12 +0200
commit7e382f2ddb849d7c0c120031aa7f39598e66f182 (patch)
tree891c55a5c76bb2b0b301c8729282d7b3f0ddb4ee
parent0b8134b8f5717942c7b77130de728e86eecf99b2 (diff)
02-variables.cmake: warns - unset project options
- 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.cmake15
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()