~ci-train-bot/miral/miral-ubuntu-yakkety-2068

« back to all changes in this revision

Viewing changes to miral-shell/spinner/CMakeLists.txt

  • Committer: Alan Griffiths
  • Date: 2016-04-08 14:33:31 UTC
  • Revision ID: alan@octopull.co.uk-20160408143331-1t2nspcuf7ndmodt
Quck and dirty import of old spinner

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- Mode: CMake; indent-tabs-mode: nil; tab-width: 2 -*-
 
2
#
 
3
# Copyright © 2014 Canonical Ltd.
 
4
#
 
5
# This program is free software: you can redistribute it and/or modify
 
6
# it under the terms of the GNU General Public License version 3 as
 
7
# published by the Free Software Foundation.
 
8
#
 
9
# This program is distributed in the hope that it will be useful,
 
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
# GNU General Public License for more details.
 
13
#
 
14
# You should have received a copy of the GNU General Public License
 
15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
16
 
 
17
pkg_check_modules(GLIB REQUIRED glib-2.0)
 
18
find_package(GLESv2 REQUIRED)
 
19
 
 
20
function(png2header png header varname)
 
21
  add_custom_command(
 
22
    OUTPUT ${header}
 
23
    COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py ${png} ${varname} > ${header}
 
24
    DEPENDS ${png} ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py
 
25
  )
 
26
endfunction()
 
27
 
 
28
png2header(
 
29
  ${CMAKE_CURRENT_SOURCE_DIR}/spinner-glow.png
 
30
  ${CMAKE_CURRENT_BINARY_DIR}/spinner_glow.h
 
31
  spinner_glow
 
32
)
 
33
 
 
34
png2header(
 
35
  ${CMAKE_CURRENT_SOURCE_DIR}/spinner-logo.png
 
36
  ${CMAKE_CURRENT_BINARY_DIR}/spinner_logo.h
 
37
  spinner_logo
 
38
)
 
39
 
 
40
include_directories(
 
41
  ${GLIB_INCLUDE_DIRS}
 
42
  ${GLESv2_INCLUDE_DIRS}
 
43
  ${MIRCLIENT_INCLUDE_DIRS}
 
44
  ${CMAKE_CURRENT_BINARY_DIR}
 
45
)
 
46
 
 
47
link_directories(${MIRCLIENT_LIBRARY_DIRS})
 
48
 
 
49
add_library(miral-spinner STATIC
 
50
  eglapp.cpp
 
51
  eglapp.h
 
52
  eglspinner.cpp
 
53
  miregl.h
 
54
  miregl.cpp
 
55
  ${CMAKE_CURRENT_BINARY_DIR}/spinner_logo.h
 
56
  ${CMAKE_CURRENT_BINARY_DIR}/spinner_glow.h
 
57
)
 
58
 
 
59
target_link_libraries(miral-spinner
 
60
  EGL
 
61
  ${GLIB_LDFLAGS}
 
62
  ${GLESv2_LIBRARIES}
 
63
  ${MIRCLIENT_LDFLAGS}
 
64
)