~alcinnz/slingshot/performance

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Main configuration
cmake_minimum_required (VERSION 2.6)
cmake_policy (VERSION 2.6)
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

# Project information
project (slingshot)
set (INDICATORTITLE "Slingshot")
set (INDICATORDESCRIPTION "Application menu")

# Set some variables
include (GNUInstallDirs)
set (DATADIR "${CMAKE_INSTALL_FULL_LIBDIR}/wingpanel")
set (PKGDATADIR "${DATADIR}")
set (GETTEXT_PACKAGE "${CMAKE_PROJECT_NAME}")
set (RELEASE_NAME "Donatello")
set (VERSION "2.1.1")
set (VERSION_INFO "Release")
set (CMAKE_C_FLAGS "-ggdb")

# Files
file (GLOB applications_menu "${CMAKE_CURRENT_SOURCE_DIR}/data/pantheon-applications.menu")

# Configuration file
configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/lib/synapse-core/config.h)

# Add 'make dist' command for creating release tarball
set (CPACK_PACKAGE_VERSION ${VERSION})
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set (CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;/.bzrignore;~$;${CPACK_SOURCE_IGNORE_FILES}")

# Include CPack
include (CPack)
add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)

# Option to configure the use of the unity integration
option (USE_UNITY "Use Unity integration" ON)
if (USE_UNITY)
  message ("-- Unity integration enabled")
  set (UNITY_DEPS unity)
  set (UNITY_OPTIONS --define=HAVE_UNITY)
else ()
  message ("-- Unity integration disabled")
endif ()

# Option to configure the use of the zeitgeist integration
option (USE_ZEITGEIST "Use Zeitgeist integration" ON)
if (USE_ZEITGEIST)
  message ("-- Zeitgeist integration enabled")
  set (ZEITGEIST_DEPS zeitgeist-2.0)
  set (ZEITGEIST_OPTIONS --define=HAVE_ZEITGEIST)
else ()
  message ("-- Zeitgeist integration disabled")
endif ()

# Gettext package
add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")

# Comment this out to enable C compiler warnings
add_definitions (-w)

# Load PkgConfig
find_package (PkgConfig)

# Check for Vala
 
pkg_check_modules(PLANK011 QUIET plank>=0.10.9)
if (PLANK011_FOUND)
  set (PLANK_DEPS plank)
  set (PLANK_OPTIONS --define=HAS_PLANK --define=HAS_PLANK_0_11)
else ()
  pkg_check_modules(PLANK QUIET plank>=0.9.0)
  if (PLANK_FOUND)
    set (PLANK_DEPS plank)
    set (PLANK_OPTIONS --define=HAS_PLANK)
  endif ()
endif ()

set (CORE_DEPS "gobject-2.0;glib-2.0;gio-2.0;gio-unix-2.0;libsoup-2.4;gee-0.8;libgnome-menu-3.0;json-glib-1.0;${UNITY_DEPS};${PLANK_DEPS};")
set (UI_DEPS "wingpanel-2.0;gtk+-3.0>=3.12.0;granite;${ZEITGEIST_DEPS};")

pkg_check_modules (DEPS REQUIRED "${CORE_DEPS}${UI_DEPS}" gthread-2.0)

find_package (Vala REQUIRED)
include (ValaVersion)
ensure_vala_version ("0.32.1" MINIMUM)

# Include vala precompile
include (ValaPrecompile)

# Synapse libraries
include_directories (${CMAKE_BINARY_DIR}/lib/synapse-core)
include_directories (${CMAKE_BINARY_DIR}/lib/synapse-plugins)

# Link some libraries
add_definitions (${DEPS_CFLAGS} -DGMENU_I_KNOW_THIS_IS_UNSTABLE -include config.h)
link_libraries (${DEPS_LIBRARIES})
link_directories (${DEPS_LIBRARY_DIRS})

# Installation
install (TARGETS ${APPNAME} RUNTIME DESTINATION bin)
install (FILES ${applications_menu} DESTINATION /etc/xdg/menus)
file (GLOB resources "${CMAKE_CURRENT_SOURCE_DIR}/data/*")

# Settings schema
include (GSettings)
add_schema ("org.pantheon.desktop.slingshot.gschema.xml")

# Directories
add_subdirectory (lib/synapse-core)
add_subdirectory (lib/synapse-plugins)
add_subdirectory (src)
add_subdirectory (po)