X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=cmake%2Fcmake.d%2F02-variables.cmake;h=e90ff11f4c17a221a0acd4467fa73baafe2bc7a7;hb=refs%2Fchanges%2F03%2F11803%2F1;hp=6efe624507715a36f798e240bde56c4dce289ed1;hpb=0013593d4289e0be2e6651980185e3e95fcb8726;p=apps%2Fapp-templates.git diff --git a/cmake/cmake.d/02-variables.cmake b/cmake/cmake.d/02-variables.cmake index 6efe624..e90ff11 100644 --- a/cmake/cmake.d/02-variables.cmake +++ b/cmake/cmake.d/02-variables.cmake @@ -26,52 +26,28 @@ # Get colorized message output non Windows OS. You know bash ? :) if(NOT WIN32) - string(ASCII 27 Esc) - set(ColourReset "${Esc}[m") - set(ColourBold "${Esc}[1m") - set(Red "${Esc}[31m") - set(Green "${Esc}[32m") - set(Yellow "${Esc}[33m") - set(Blue "${Esc}[34m") - set(Magenta "${Esc}[35m") - set(Cyan "${Esc}[36m") - set(White "${Esc}[37m") - set(BoldRed "${Esc}[1;31m") - set(BoldGreen "${Esc}[1;32m") - set(BoldYellow "${Esc}[1;33m") - set(BoldBlue "${Esc}[1;34m") - set(BoldMagenta "${Esc}[1;35m") - set(BoldCyan "${Esc}[1;36m") - set(BoldWhite "${Esc}[1;37m") + string(ASCII 27 Esc) + set(ColourReset "${Esc}[m") + set(ColourBold "${Esc}[1m") + set(Red "${Esc}[31m") + set(Green "${Esc}[32m") + set(Yellow "${Esc}[33m") + set(Blue "${Esc}[34m") + set(Magenta "${Esc}[35m") + set(Cyan "${Esc}[36m") + set(White "${Esc}[37m") + set(BoldRed "${Esc}[1;31m") + set(BoldGreen "${Esc}[1;32m") + set(BoldYellow "${Esc}[1;33m") + set(BoldBlue "${Esc}[1;34m") + set(BoldMagenta "${Esc}[1;35m") + set(BoldCyan "${Esc}[1;36m") + set(BoldWhite "${Esc}[1;37m") endif() # Native packaging name set(NPKG_PROJECT_NAME agl-${PROJECT_NAME}) -# Get the os type -# Used to package .deb -if(EXISTS "/etc/os-release") - execute_process(COMMAND grep -E "^ID(=|_LIKE=)" /etc/os-release - OUTPUT_VARIABLE TMP_OSRELEASE - ) - if (NOT TMP_OSRELEASE STREQUAL "") - string(REGEX REPLACE ".*=" "" OSRELEASE ${TMP_OSRELEASE}) - else() - set(OSRELEASE "NOT DEBIAN OS") - endif() - message(STATUS "OSRELEASE = ${OSRELEASE}") -else() - set(OSRELEASE "NOT DEBIAN OS") -endif() - -if(DEFINED ENV{SDKTARGETSYSROOT}) - file(STRINGS $ENV{SDKTARGETSYSROOT}/usr/include/linux/version.h LINUX_VERSION_CODE_LINE REGEX "LINUX_VERSION_CODE") -elseif(DEFINED ENV{PKG_CONFIG_SYSROOT_DIR}) - file(STRINGS $ENV{PKG_CONFIG_SYSROOT_DIR}/usr/include/linux/version.h LINUX_VERSION_CODE_LINE REGEX "LINUX_VERSION_CODE") -else() - file(STRINGS /usr/include/linux/version.h LINUX_VERSION_CODE_LINE REGEX "LINUX_VERSION_CODE") -endif() - string(REGEX MATCH "[0-9]+" LINUX_VERSION_CODE ${LINUX_VERSION_CODE_LINE}) math(EXPR a "${LINUX_VERSION_CODE} >> 16") math(EXPR b "(${LINUX_VERSION_CODE} >> 8) & 255") @@ -119,14 +95,6 @@ endif(kernel_minimal_version) # Project path variables # ---------------------- - -# If no install dir try to guess some smart default -if(BINDINGS_INSTALL_PREFIX) - set(BINDINGS_INSTALL_DIR ${BINDINGS_INSTALL_PREFIX}/${PROJECT_NAME} CACHE PATH "Where the binding will be installed in your system") -else() - set(BINDINGS_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME} CACHE PATH "Where the binding will be installed in your system") -endif() - set(PKGOUT_DIR package CACHE PATH "Output directory for packages") # Define a default package directory @@ -139,13 +107,14 @@ endif() # Paths to templates files set(TEMPLATE_DIR "${PKG_TEMPLATE_PREFIX}/template.d" CACHE PATH "Subpath to a directory where are stored needed files to launch on remote target to debuging purposes") +string(REGEX REPLACE "^(.*)/.*$" "\\1" ENTRY_POINT "${PKG_TEMPLATE_PREFIX}") +set(PROJECT_PKG_ENTRY_POINT ${ENTRY_POINT}/packaging CACHE PATH "Where package build files, like rpm.spec file or config.xml, are write.") + +set(WIDGET_ICON "${ENTRY_POINT}/wgt/${PROJECT_ICON}" CACHE PATH "Path to the widget icon") if(NOT WIDGET_CONFIG_TEMPLATE) set(WIDGET_CONFIG_TEMPLATE ${TEMPLATE_DIR}/config.xml.in CACHE PATH "Path to widget config file template (config.xml.in)") endif() -string(REGEX REPLACE "^(.*)/.*$" "\\1" ENTRY_POINT "${PKG_TEMPLATE_PREFIX}") -set(PROJECT_PKG_ENTRY_POINT ${ENTRY_POINT}/packaging CACHE PATH "Where package build files, like rpm.spec file or config.xml, are write.") - # Path to autobuild template set(PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR ${CMAKE_SOURCE_DIR}/conf.d/autobuild/agl CACHE PATH "Subpath to a directory where are stored autobuild script") set(PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR ${CMAKE_SOURCE_DIR}/conf.d/autobuild/linux CACHE PATH "Subpath to a directory where are stored autobuild script") @@ -170,7 +139,8 @@ endif() set(GDB_INITIAL_BREAK "personality" CACHE STRING "Initial Break Point for GDB remote") # Define some checker binaries to verify input DATA files -# to be included in package. -set(LUA_CHECKER "luac" CACHE STRING "LUA compiler") +# to be included in package. Schema aren't checked for now. +# Dummy checker about JSON. +set(LUA_CHECKER "luac" "-p" CACHE STRING "LUA compiler") set(XML_CHECKER "xmllint" CACHE STRING "XML linter") -set(JSON_CHECKER "json_verify" CACHE STRING "JSON linter") +set(JSON_CHECKER "" CACHE STRING "JSON linter")