df91cb93fb0d435e827abb0cb256c85aac3a9e50
[profile/ivi/wayland-ivi-extension.git] / weston-ivi-shell / CMakeLists.txt
1 ############################################################################
2 #
3 # Copyright (C) 2013 DENSO CORPORATION
4 # Copyright 2014 BMW Car IT GmbH
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(ivi-controller)
24
25 find_package(PkgConfig REQUIRED)
26 pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED)
27 pkg_check_modules(CAIRO cairo REQUIRED)
28 pkg_check_modules(WESTON weston REQUIRED)
29 pkg_check_modules(PIXMAN pixman-1 REQUIRED)
30 pkg_check_modules(EGL egl REQUIRED)
31 pkg_check_modules(GLES glesv2 REQUIRED)
32
33 GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES)
34
35 include_directories(
36     include
37     ${IVI_EXTENSION_INCLUDE_DIRS}
38     ${WAYLAND_SERVER_INCLUDE_DIRS}
39     ${CAIRO_INCLUDE_DIRS}
40     ${WESTON_INCLUDE_DIRS}
41     ${PIXMAN_INCLUDE_DIRS}
42     ${WESTON_INCLUDE_DIRS}/weston
43     ${EGL_INCLUDE_DIRS}
44     ${GLES_INCLUDE_DIRS}
45 )
46
47 link_directories(
48     ${WAYLAND_SERVER_LIBRARY_DIRS}
49     ${CAIRO_LIBRARY_DIRS}
50     ${WESTON_LIBRARY_DIRS}
51     ${PIXMAN_LIBRARY_DIRS}
52     ${WESTON_LIBDIR}/weston
53     ${EGL_LIBRARY_DIRS}
54     ${GLES_LIBRARY_DIRS}
55 )
56
57
58 add_library(${PROJECT_NAME} MODULE
59     src/ivi-controller.c
60     src/bitmap.c
61 )
62
63 set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
64
65 add_dependencies(${PROJECT_NAME}
66     ivi-extension-protocol
67     ${WAYLAND_SERVER_LIBRARIES}
68     ${CAIRO_LIBRARIES}
69     ${PIXMAN_LIBRARIES}
70     ${WESTON_LIBRARIES}
71     ${EGL_LIBRARIES}
72     ${GLES_LIBRARIES}
73 )
74
75 set(LIBS
76     ${LIBS}
77     ivi-extension-protocol
78     ${WAYLAND_SERVER_LIBRARIES}
79     ${CAIRO_LIBRARIES}
80     ${WESTON_LIBRARIES}
81     ${EGL_LIBRARIES}
82     ${GLES_LIBRARIES}
83 )
84
85 set(CMAKE_C_LDFLAGS "-module -avoid-version")
86
87 target_link_libraries(${PROJECT_NAME} ${LIBS})
88
89 install (
90     TARGETS             ${PROJECT_NAME}
91     LIBRARY DESTINATION lib/weston
92 )