6 To use these templates files on your project just install the reference files using
7 **git submodule** then use `config.cmake` file to configure your project specificities :
10 git submodule add https://gerrit.automotivelinux.org/gerrit/apps/app-templatesconf.d/app-templates conf.d/app-templates
12 cp conf.d/app-templates/cmake/config.cmake.sample conf.d/cmake/config.cmake
15 Edit the copied config.cmake file to fit your needs.
17 Now, create your top CMakeLists.txt file which include `config.cmake` file.
19 An example is available in **app-templates** submodule that you can copy and
23 cp conf.d/app-templates/cmake/CMakeLists.txt CMakeLists.txt
26 ## Create your CMake targets
28 For each target part of your project, you need to use ***PROJECT_TARGET_ADD***
29 to include this target to your project.
31 Using it, make available the cmake variable ***TARGET_NAME*** until the next
32 ***PROJECT_TARGET_ADD*** is invoked with a new target name.
34 So, typical usage defining a target is:
37 PROJECT_TARGET_ADD(SuperExampleName) --> Adding target to your project
39 add_executable/add_library(${TARGET_NAME}.... --> defining your target sources
41 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES.... --> fit target properties
44 INSTALL(TARGETS ${TARGET_NAME}....
49 You should set properties on your targets that will be used to package your
50 apps in a widget file that could be installed on an AGL system.
52 Specify what is the type of your targets that you want to be included in the
53 widget package with the property **LABELS**:
57 - **BINDING**: Shared library that be loaded by the AGL Application Framework
58 - **BINDINGV2**: Shared library that be loaded by the AGL Application Framework.
59 This has to be accompagnied with a JSON file named like the *${OUTPUT_NAME}-apidef* of
60 the target that describe the API with OpenAPI syntax (e.g: *mybinding-apidef*).
61 Or you can choose the name by setting the *CACHE* cmake variable *OPENAPI_DEF*
62 (***CAUTION***: setting a CACHE variable is needed, or set a normal variable
63 with the *PARENT_SCOPE* option to make it visible for the parent scope
64 where the target is defined) JSON file will be used to generate header file
65 using `afb-genskel` tool.
66 - **HTDOCS**: Root directory of a web app. This target has to build its
67 directory and puts its files in the ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
68 - **DATA**: Resources used by your application. This target has to build its
69 directory and puts its files in the ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
70 - **EXECUTABLE**: Entry point of your application executed by the AGL
74 SET_TARGET_PROPERTIES(${TARGET_NAME}
77 OUTPUT_NAME "file_output_name")
80 > **TIP** you should use the prefix _afb-_ with your **BINDING* targets which
81 > stand for **Application Framework Binding**.