Update template to the reference
[staging/xdg-launcher.git] / templates / hybrid-html5 / binding / CMakeLists.txt
1 ###########################################################################
2 # Copyright 2015, 2016, 2017 IoT.bzh
3 #
4 # author: Fulup Ar Foll <fulup@iot.bzh>
5 # contrib: Romain Forlot <romain.forlot@iot.bzh>
6 #
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
10 #
11 #     http://www.apache.org/licenses/LICENSE-2.0
12 #
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 ###########################################################################
19
20 # Project target list
21 # --------------------
22 # Add target to project dependency list. Name specified as argument will be
23 # added to the project target list and the variable ${TARGET_NAME} become
24 # available with that value.
25 PROJECT_TARGET_ADD(xxx)
26
27         # Define project Targets
28         add_library(${TARGET_NAME} MODULE
29                 ${TARGET_NAME}-hat.c
30                 ${TARGET_NAME}-cb.c
31                 )
32
33         # Targets properties
34         # ------------------
35         # Target properties will be used to build package tree that will be
36         # built using project_package_build.
37         # OUTPUT_NAME:  Depends what is the name of your  output file, it is
38         # mandatory to specify which is its name with target the property
39         # OUTPUT_NAME for your target. If file name is same of your target then
40         # use variable ${TARGET_NAME}.
41         # LABELS: Choose between "BINDING", "HTDOCS", "EXECUTABLE" depending of
42         # the type of your target.
43         # PREFIX: This prefix will be added on the output file name specify with
44         # OUTPUT_NAME. By default, there isn't PREFIX on target except on
45         # library target with is "lib".
46         SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
47                 PREFIX "afb-"
48                 LABELS "BINDING"
49                 LINK_FLAGS ${BINDINGS_LINK_FLAG}
50                 OUTPUT_NAME ${TARGET_NAME}
51         )
52
53         # Link
54         # ----
55         # Library dependencies (include updates automatically). Linked to the
56         # target.
57         TARGET_LINK_LIBRARIES(${TARGET_NAME}
58                 ${link_libraries})
59
60         # Include
61         # -------
62         # Define target includes search and dependencies. Choose between PUBLIC,
63         # PRIVATE or INTERFACE. PRIVATE and PUBLIC items will populate the
64         # INCLUDE_DIRECTORIES property of <target>. PUBLIC and INTERFACE items
65         # will populate the INTERFACE_INCLUDE_DIRECTORIES property of <target>.
66         # The following arguments specify include directories.
67         # INTERFACE_INCLUDE_DIRECTORIES will be read at the
68         # TARGET_LINK_LIBRARIES step for others targets that link against this
69         # target.
70         TARGET_INCLUDE_DIRECTORIES( ${TARGET_NAME}
71                 PUBLIC  ${CMAKE_CURRENT_SOURCE_DIR}
72         )
73
74         # installation directory
75         INSTALL(TARGETS ${TARGET_NAME}
76                 LIBRARY DESTINATION ${BINDINGS_INSTALL_DIR})