Compare to manual Project version if not from git
[apps/app-templates.git] / cmake / cmake.d / 03-macros.cmake
index bf297a2..2de89f3 100644 (file)
@@ -269,11 +269,6 @@ endmacro()
 # Pre-packaging
 macro(project_targets_populate)
        # Default Widget default directory
-       set(BINDIR bin)
-       set(ETCDIR etc)
-       set(LIBDIR lib)
-       set(HTTPDIR htdocs)
-       set(DATADIR data)
        set(PACKAGE_BINDIR  ${PROJECT_PKG_BUILD_DIR}/${BINDIR})
        set(PACKAGE_ETCDIR  ${PROJECT_PKG_BUILD_DIR}/${ETCDIR})
        set(PACKAGE_LIBDIR  ${PROJECT_PKG_BUILD_DIR}/${LIBDIR})
@@ -539,3 +534,23 @@ macro(project_closing_msg)
                        ${PROJECT_TARGETS} populate)
        endif()
 endmacro()
+
+macro(check_version)
+       if(${GIT_PROJECT_VERSION})
+               if(${GIT_PROJECT_VERSION} VERSION_GREATER ${APP_TEMPLATES_VERSION})
+                       message(STATUS "${Yellow}.. Your app-templates submodule version seems outdated. You should update it with 'git submodule update --remote ${PROJECT_APP_TEMPLATES_DIR}'.
+               - App-templates version: ${APP_TEMPLATES_VERSION}
+               - Project version according AGL Git tag: ${GIT_PROJECT_VERSION}"
+               )
+               endif()
+       elseif(${PROJECT_VERSION})
+               if(${PROJECT_VERSION} VERSION_GREATER ${APP_TEMPLATES_VERSION})
+                       message(STATUS "${Yellow}.. Your app-templates submodule version seems outdated. You should update it with 'git submodule update --remote ${PROJECT_APP_TEMPLATES_DIR}'.
+               - App-templates version: ${APP_TEMPLATES_VERSION}
+               - Project version according AGL Git tag: ${PROJECT_VERSION}"
+               )
+               endif()
+       else()
+               message(STATUS "${Yellow} Your git project repo doesn't have any version tags nor hosted by AGL gerrit infrastructure. Can't compare version between project and app-templates ${APP_TEMPLATES_VERSION} ${ColourReset}")
+       endif()
+endmacro()