ilmControl: added display_flush to layer "screenshot"
[profile/ivi/wayland-ivi-extension.git] / ivi-layermanagement-api / ilmControl / CMakeLists.txt
1 ############################################################################
2 #
3 # Copyright 2010-2014 BMW Car IT GmbH
4 # Copyright (C) 2013 DENSO CORPORATION
5 #
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
21 cmake_minimum_required (VERSION 2.6)
22
23 project(ilmControl)
24
25 find_package(Threads)
26 find_package(PkgConfig REQUIRED)
27 pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED)
28
29 GET_TARGET_PROPERTY(ILM_COMMON_INCLUDE_DIRS ilmCommon INCLUDE_DIRECTORIES)
30
31 include_directories(
32     include
33     ${ILM_COMMON_INCLUDE_DIRS}
34     ${WAYLAND_CLIENT_INCLUDE_DIR}
35 )
36
37 link_directories(
38     ${WAYLAND_CLIENT_LIBRARY_DIRS}
39 )
40
41 add_library(${PROJECT_NAME} SHARED
42     src/ilm_control.c
43     src/ilm_control_wayland_platform.c
44 )
45
46 add_dependencies(${PROJECT_NAME}
47     ilmCommon
48     ${WAYLAND_CLIENT_LIBRARIES}
49 )
50
51 set(LIBS
52     ${LIBS}
53     ilmCommon
54     ivi-extension-protocol
55     rt
56     dl
57     ${CMAKE_THREAD_LIBS_INIT}
58     ${WAYLAND_CLIENT_LIBRARIES}
59 )
60
61 target_link_libraries(${PROJECT_NAME} ${LIBS})
62
63 install (
64     TARGETS             ${PROJECT_NAME}
65     LIBRARY DESTINATION lib
66 )
67
68 install (
69     FILES       ${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmControl/include/ilm_control.h
70     DESTINATION include/ilm
71 )
72
73 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${ILM_API_VERSION} SOVERSION ${ILM_API_VERSION})
74
75
76 #=============================================================================================
77 # generate documentation for ilmControl API
78 #=============================================================================================
79
80 add_custom_target(ilm-control-doc
81                   COMMAND cat ${CMAKE_SOURCE_DIR}/doc/Doxyfile.template
82                           | sed 's/___DOC_NAME___/ilmControl API/'
83                           | sed 's/___DOC_VERSION___/${ILM_API_VERSION}/'
84                           | sed 's!___INPUT_FILE___!${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include/ilm_common.h ${CMAKE_CURRENT_SOURCE_DIR}/include/ilm_control.h!'
85                           | sed 's/___OUTPUT_DIR___/ilm-control-doc/'
86                           | doxygen -
87                   COMMAND make --silent -C ilm-control-doc/latex
88                   COMMAND cp ilm-control-doc/latex/refman.pdf
89                              ${CMAKE_BINARY_DIR}/ilm-control-api-${ILM_API_VERSION}.pdf
90                   COMMENT "Generating ilm-control-api-${ILM_API_VERSION}.pdf"
91 )
92