Adding comments as documentation for each target.
[staging/xdg-launcher.git] / templates / native / app / 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-native-app)
26
27         # Define project Targets
28         add_executable(${TARGET_NAME}
29                 ${TARGET_NAME}.c
30                 )
31
32         # Link
33         # ----
34         # Library dependencies (include updates automatically). Linked to the
35         # target.
36         link_libraries(
37                 ${CMAKE_THREAD_LIBS_INIT}
38                 ${libafbwsc_LIBRARIES}
39                 ${json-c_LIBRARIES}
40                 ${libsystemd_LIBRARIES}
41         )
42
43         # Targets properties
44         # ------------------
45         # Target properties will be used to build package tree that will be
46         # built using project_package_build.
47         # OUTPUT_NAME:  Depends what is the name of your  output file, it is
48         # mandatory to specify which is its name with target the property
49         # OUTPUT_NAME for your target. If file name is same of your target then
50         # use variable ${TARGET_NAME}.
51         # LABELS: Choose between "BINDING", "HTDOCS", "EXECUTABLE" depending of
52         # the type of your target.
53         # PREFIX: This prefix will be added on the output file name specify with
54         # OUTPUT_NAME. By default, there isn't PREFIX on target except on
55         # library target with is "lib".
56         SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
57                 LABELS "EXECUTABLE"
58                 OUTPUT_NAME ${TARGET_NAME})
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  ${libafbwsc_INCLUDE_DIRS}
72                         ${json-c_INCLUDE_DIRS}
73                         ${libsystemd_INCLUDE_DIRS})
74
75         # Link
76         # ----
77         # Library dependencies (include updates automatically). Linked to the
78         # target.
79         TARGET_LINK_LIBRARIES(${TARGET_NAME}
80                 afbwsc
81                 ${link_libraries})
82
83         # installation directory
84         INSTALL(TARGETS ${TARGET_NAME}
85                 RUNTIME DESTINATION ${BINDINGS_INSTALL_DIR})