Align config.cmake file with app-template update
[apps/agl-service-can-low-level.git] / conf.d / cmake / config.cmake
1 ###########################################################################
2 # Copyright 2015, 2016, 2017 IoT.bzh
3 #
4 # author: Fulup Ar Foll <fulup@iot.bzh>
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 ###########################################################################
18
19 # Project Info
20 # ------------------
21 set(PROJECT_NAME low-can-service)
22 set(PROJECT_PRETTY_NAME "Low level CAN binding")
23 set(PROJECT_DESCRIPTION "Expose CAN Low Level APIs through AGL Framework")
24 set(PROJECT_URL "https://gerrit.automotivelinux.org/gerrit/apps/agl-service-can-low-level")
25 set(PROJECT_ICON "icon.png")
26 set(PROJECT_AUTHOR "Romain Forlot")
27 set(PROJECT_AUTHOR_MAIL "romain.forlot@iot.bzh")
28 set(PROJECT_LICENSE "APL2.0")
29 set(PROJECT_LANGUAGES "C;CXX")
30
31 # Where are stored default templates files from submodule or subtree app-templates in your project tree
32 # relative to the root project directory
33 set(PROJECT_APP_TEMPLATES_DIR "conf.d/app-templates")
34
35 # Which directories inspect to find CMakeLists.txt target files
36 # set(PROJECT_SRC_DIR_PATTERN "*")
37
38 # Compilation Mode (DEBUG, RELEASE)
39 # ----------------------------------
40 set(CMAKE_BUILD_TYPE "DEBUG" CACHE STRING "Default Build variant chosen. (Overwritten by cli if given)")
41
42 # Kernel selection if needed. You can choose between a
43 # mandatory version to impose a minimal version.
44 # Or check Kernel minimal version and just print a Warning
45 # about missing features and define a preprocessor variable
46 # to be used as preprocessor condition in code to disable
47 # incompatibles features. Preprocessor define is named
48 # KERNEL_MINIMAL_VERSION_OK.
49 #
50 # NOTE*** FOR NOW IT CHECKS KERNEL Yocto environment and
51 # Yocto SDK Kernel version.
52 # -----------------------------------------------
53 #set (kernel_mandatory_version 4.8)
54 set (kernel_minimal_version 4.8)
55
56 # Compiler selection if needed. Impose a minimal version.
57 # -----------------------------------------------
58 set (gcc_minimal_version 4.9)
59
60 # PKG_CONFIG required packages
61 # -----------------------------
62 set (PKG_REQUIRED_LIST
63         json-c
64         libsystemd>=222
65         afb-daemon
66 )
67
68 # Prefix path where will be installed the files
69 # Default: /usr/local (need root permission to write in)
70 # ------------------------------------------------------
71 set(INSTALL_PREFIX $ENV{HOME}/opt)
72
73 # Customize link option
74 # -----------------------------
75 list (APPEND link_libraries -pthread)
76
77 # Compilation options definition
78 # Use CMake generator expressions to specify only for a specific language
79 # Values are prefilled with default options that is currently used.
80 # Either separate options with ";", or each options must be quoted separately
81 # DO NOT PUT ALL OPTION QUOTED AT ONCE , COMPILATION COULD FAILED !
82 # ----------------------------------------------------------------------------
83 set(COMPILE_OPTIONS
84  -Wall
85  -Wextra
86  -Wconversion
87  -Wno-unused-parameter
88  -Wno-sign-compare
89  -Wno-sign-conversion
90  -Werror=maybe-uninitialized
91  -Werror=implicit-function-declaration
92  -ffunction-sections
93  -fdata-sections
94  -fPIC
95  -DPB_FIELD_16BIT
96  CACHE STRING "Compilation flags")
97 #set(C_COMPILE_OPTIONS "" CACHE STRING "Compilation flags for C language.")
98 set(CXX_COMPILE_OPTIONS -pthread CACHE STRING "Compilation flags for C++ language.")
99 #set(PROFILING_COMPILE_OPTIONS
100 # -g
101 # -O0
102 # -pg
103 # -Wp,-U_FORTIFY_SOURCE
104 # CACHE STRING "Compilation flags for PROFILING build type.")
105 #set(DEBUG_COMPILE_OPTIONS
106 # -Og
107 # -g
108 # -ggdb
109 # -D_FORTIFY_SOURCE=2
110 # CACHE STRING "Compilation flags for DEBUG build type.")
111 #set(COVERAGE_COMPILE_OPTIONS
112 # -g
113 # -O2
114 # --coverage
115 # CACHE STRING "Compilation flags for COVERAGE build type.")
116 #set(RELEASE_COMPILE_OPTIONS
117 # -O2
118 # -D_FORTIFY_SOURCE=2
119 # CACHE STRING "Compilation flags for RELEASE build type.")
120
121 # Optional location for config.xml.in
122 # -----------------------------------
123 #set(WIDGET_ICON "\"${CMAKE_SOURCE_DIR}conf.d/wgt/${PROJECT_ICON}\"" CACHE PATH "Path to the widget icon")
124 set(WIDGET_CONFIG_TEMPLATE "${CMAKE_SOURCE_DIR}/conf.d/wgt/config.xml.in" CACHE PATH "Path to widget config file template (config.xml.in)")
125
126 # Mandatory widget Mimetype specification of the main unit
127 # --------------------------------------------------------------------------
128 # Choose between :
129 #- text/html : HTML application,
130 #       content.src designates the home page of the application
131 #
132 #- application/vnd.agl.native : AGL compatible native,
133 #       content.src designates the relative path of the binary.
134 #
135 # - application/vnd.agl.service: AGL service, content.src is not used.
136 #
137 #- ***application/x-executable***: Native application,
138 #       content.src designates the relative path of the binary.
139 #       For such application, only security setup is made.
140 #
141 set(WIDGET_TYPE application/vnd.agl.service)
142
143 # Mandatory Widget entry point file of the main unit
144 # --------------------------------------------------------------
145 # This is the file that will be executed, loaded,
146 # at launch time by the application framework.
147 #
148 set(WIDGET_ENTRY_POINT lib/afb-low-can.so)
149
150 # Optional dependencies order
151 # ---------------------------
152 #set(EXTRA_DEPENDENCIES_ORDER)
153
154 # Optional Extra global include path
155 # -----------------------------------
156 #set(EXTRA_INCLUDE_DIRS)
157
158 # Optional extra libraries
159 # -------------------------
160 #set(EXTRA_LINK_LIBRARIES)
161
162 # Optional force binding Linking flag
163 # ------------------------------------
164 # set(BINDINGS_LINK_FLAG LinkOptions )
165
166 # Optional force package prefix generation, like widget
167 # -----------------------------------------------------
168 # set(PKG_PREFIX DestinationPath)
169
170 # Optional Application Framework security token
171 # and port use for remote debugging.
172 #------------------------------------------------------------
173 set(AFB_TOKEN   ""     CACHE STRING "Default binder security token")
174 set(AFB_REMPORT "1234" CACHE STRING "Default binder listening port")
175
176 # Print a helper message when every thing is finished
177 # ----------------------------------------------------
178 set(CLOSING_MESSAGE "Typical binding launch: afb-daemon --port=${AFB_REMPORT} --workdir=${CMAKE_BINARY_DIR}/package --ldpaths=lib --roothttp=htdocs  --token=\"${AFB_TOKEN}\" --tracereq=common --verbose")
179 set(PACKAGE_MESSAGE "Install widget file using in the target : afm-util install ${PROJECT_NAME}.wgt")
180
181 # Optional schema validator about now only XML, LUA and JSON
182 # are supported
183 #------------------------------------------------------------
184 #set(LUA_CHECKER "luac" "-p" CACHE STRING "LUA compiler")
185 #set(XML_CHECKER "xmllint" CACHE STRING "XML linter")
186 #set(JSON_CHECKER "json_verify" CACHE STRING "JSON linter")
187
188 # This include is mandatory and MUST happens at the end
189 # of this file, else you expose you to unexpected behavior
190 # -----------------------------------------------------------
191 include(${PROJECT_APP_TEMPLATES_DIR}/cmake/common.cmake)