1 ###########################################################################
2 # Copyright 2015-2020 IoT.bzh
3 # Copyright (C) 2020 Konsulko Group
5 # author: Marec Frédéric <frederic.marec@iot.bzh>
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 ###########################################################################
22 set(PROJECT_NAME "agl-service-homescreen")
23 set(API_NAME "homescreen")
24 set(PROJECT_PRETTY_NAME "HomeScreen Service")
25 set(PROJECT_DESCRIPTION "HomeScreen Binding Service")
26 set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-homescreen")
27 set(PROJECT_ICON "icon.svg")
28 set(PROJECT_AUTHOR "TOYOTA")
29 set(PROJECT_AUTHOR_EMAIL "")
30 set(PROJECT_VERSION "0.1")
31 set(PROJECT_LICENSE "APL2.0")
32 set(PROJECT_LANGUAGES,"CXX")
34 # Which directories inspect to find CMakeLists.txt target files
35 # set(PROJECT_SRC_DIR_PATTERN "*")
37 # Where are stored the project configuration files
38 # relative to the root project directory
39 set(PROJECT_CMAKE_CONF_DIR "conf.d")
41 # Compilation Mode (DEBUG, RELEASE, COVERAGE or PROFILING)
42 # ----------------------------------
43 set(BUILD_TYPE "RELEASE")
46 # Kernel selection if needed. You can choose between a
47 # mandatory version to impose a minimal version.
48 # Or check Kernel minimal version and just print a Warning
49 # about missing features and define a preprocessor variable
50 # to be used as preprocessor condition in code to disable
51 # incompatibles features. Preprocessor define is named
52 # KERNEL_MINIMAL_VERSION_OK.
54 # NOTE*** FOR NOW IT CHECKS KERNEL Yocto environment and
55 # Yocto SDK Kernel version.
56 # -----------------------------------------------
57 #set (kernel_mandatory_version 4.8)
58 #set (kernel_minimal_version 4.8)
60 # Compiler selection if needed. Impose a minimal version.
61 # -----------------------------------------------
62 set (gcc_minimal_version 4.9)
64 # PKG_CONFIG required packages
65 # -----------------------------
66 set (PKG_REQUIRED_LIST
71 # You can also consider to include libsystemd
72 # -----------------------------------
73 #list (APPEND PKG_REQUIRED_LIST libsystemd>=222)
75 # Prefix path where will be installed the files
76 # Default: /usr/local (need root permission to write in)
77 # ------------------------------------------------------
78 #set(INSTALL_PREFIX /opt/AGL CACHE PATH "INSTALL PREFIX PATH")
80 # Customize link option
81 # -----------------------------
82 list (APPEND link_libraries -pthread)
84 # Compilation options definition
85 # Use CMake generator expressions to specify only for a specific language
86 # Values are prefilled with default options that is currently used.
87 # Either separate options with ";", or each options must be quoted separately
88 # DO NOT PUT ALL OPTION QUOTED AT ONCE , COMPILATION COULD FAILED !
89 # ----------------------------------------------------------------------------
94 # -Wno-unused-parameter
96 # -Wno-sign-conversion
97 # -Werror=maybe-uninitialized
98 # -Werror=implicit-function-declaration
102 # CACHE STRING "Compilation flags")
103 #set(C_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C language.")
104 #set(CXX_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C++ language.")
105 #set(PROFILING_COMPILE_OPTIONS
109 # -Wp,-U_FORTIFY_SOURCE
110 # CACHE STRING "Compilation flags for PROFILING build type.")
111 #set(DEBUG_COMPILE_OPTIONS
114 # CACHE STRING "Compilation flags for DEBUG build type.")
115 #set(COVERAGE_COMPILE_OPTIONS
119 # CACHE STRING "Compilation flags for COVERAGE build type.")
120 #set(RELEASE_COMPILE_OPTIONS
123 # -D_FORTIFY_SOURCE=2
124 # -fstack-protector-strong
125 # -Wformat -Wformat-security
126 # -Werror=format-security
127 # -feliminate-unused-debug-types
129 # -Wl,--hash-style=gnu
131 # -fstack-protector-strong
132 # -Wl,-z,relro,-z,now
133 # CACHE STRING "Compilation flags for RELEASE build type.")
135 # Location for config.xml.in template file.
137 # If you keep them commented then it will build with a default minimal widget
138 # template which is very simple and it is highly probable that it will not suit
140 # -----------------------------------------
141 set(WIDGET_CONFIG_TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/conf.d/wgt/config.xml.in)
143 # Mandatory widget Mimetype specification of the main unit
144 # --------------------------------------------------------------------------
146 #- text/html : HTML application,
147 # content.src designates the home page of the application
149 #- application/vnd.agl.native : AGL compatible native,
150 # content.src designates the relative path of the binary.
152 # - application/vnd.agl.service: AGL service, content.src is not used.
154 #- ***application/x-executable***: Native application,
155 # content.src designates the relative path of the binary.
156 # For such application, only security setup is made.
158 set(WIDGET_TYPE application/vnd.agl.service)
160 # Mandatory Widget entry point file of the main unit
161 # --------------------------------------------------------------
162 # This is the file that will be executed, loaded,
163 # at launch time by the application framework.
165 set(WIDGET_ENTRY_POINT lib/homescreen-binding.so)
167 # Optional dependencies order
168 # ---------------------------
169 #set(EXTRA_DEPENDENCIES_ORDER)
171 # Optional Extra global include path
172 # -----------------------------------
173 #set(EXTRA_INCLUDE_DIRS)
175 # Optional extra libraries
176 # -------------------------
177 #set(EXTRA_LINK_LIBRARIES)
179 # Optional force binding Linking flag
180 # ------------------------------------
181 # set(BINDINGS_LINK_FLAG LinkOptions )
183 # Optional force package prefix generation, like widget
184 # -----------------------------------------------------
185 # set(PKG_PREFIX DestinationPath)
187 # Optional Application Framework security token
188 # and port use for remote debugging.
189 #------------------------------------------------------------
190 set(AFB_TOKEN "" CACHE PATH "Default binder security token")
191 set(AFB_REMPORT "1234" CACHE PATH "Default binder listening port")
193 # Print a helper message when every thing is finished
194 # ----------------------------------------------------
195 set(CLOSING_MESSAGE "Typical binding launch: cd ${CMAKE_BINARY_DIR}/package \\&\\& afb-daemon --port=${AFB_REMPORT} --workdir=. --ldpaths=lib --roothttp=htdocs --token=\"${AFB_TOKEN}\" --tracereq=common --verbose")
196 set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt")
198 # Optional schema validator about now only XML, LUA and JSON
200 #------------------------------------------------------------
201 #set(LUA_CHECKER "luac" "-p" CACHE STRING "LUA compiler")
202 #set(XML_CHECKER "xmllint" CACHE STRING "XML linter")
203 #set(JSON_CHECKER "json_verify" CACHE STRING "JSON linter")
205 include(CMakeAfbTemplates)