~elementary-pantheon/pantheon-plugs/plank-plug

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
# This a sample CMakeLists.txt for compiling plug for Switchboard
# For any question contact me at random.cpp@gmail.com and have a 
# look at elementary cmake reference: 
#         http://elementaryos.org/docs/developer-guide/cmake 

cmake_minimum_required (VERSION 2.6)
cmake_policy (VERSION 2.6)

set (PLUGNAME "plank-plug")

project (${PLUGNAME})

set (DATADIR "${CMAKE_INSTALL_PREFIX}/lib/plugs")
set (PKGDATADIR "${DATADIR}/pantheon/${PLUGNAME}")
set (GETTEXT_PACKAGE "${PLUGNAME}")

list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

# Configure file
configure_file (${CMAKE_SOURCE_DIR}/config.vala.cmake ${CMAKE_SOURCE_DIR}/src/config.vala)
add_definitions (-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")

# Files
file (GLOB resources "${CMAKE_CURRENT_SOURCE_DIR}/data/*")

# Info-plug

set (PLUG_DEPS "gtk+-3.0;pantheon")

find_package (PkgConfig)
pkg_check_modules (DEPS REQUIRED ${PLUG_DEPS} gthread-2.0)

add_definitions (${DEPS_CFLAGS})
link_libraries (${DEPS_LIBRARIES})
link_directories (${DEPS_LIBRARY_DIRS})

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

include (ValaPrecompile)
vala_precompile (VALA_C
    src/plank-plug.vala
PACKAGES
    ${PLUG_DEPS}
OPTIONS
    --thread
)

# Traslation stuff
add_subdirectory (po)

add_executable (${PLUGNAME} ${VALA_C})

# Installation
install (TARGETS ${PLUGNAME} DESTINATION ${PKGDATADIR})
install (FILES ${resources} DESTINATION ${PKGDATADIR})