-
Notifications
You must be signed in to change notification settings - Fork 54
/
CMakeLists.txt
85 lines (78 loc) · 3.37 KB
/
CMakeLists.txt
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
# project name
project (indicator-kdeconnect)
# the oldest stable cmake version we support
cmake_minimum_required (VERSION 2.6)
# tell cmake where its modules can be found in our project directory
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# where we install data directory (if we have any)
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share")
# what to call that directory where we install data too
set (PKGDATADIR "${DATADIR}/indicator-kdeconnect")
set (RELEASE_NAME "whats up world")
set (VERSION_INFO "Indicator for KDE Connect daemon")
set (VERSION "0.1")
set (CONSTANTS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/Constants.vala)
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/src/Constants.vala.cmake ${CONSTANTS_FILE})
# we're about to use pkgconfig to make sure dependencies are installed so let's find pkgconfig first
find_package(PkgConfig)
# now let's actually check for the required dependencies
pkg_check_modules(DEPS REQUIRED gtk+-3.0 appindicator3-0.1)
add_definitions(${DEPS_CFLAGS})
link_libraries(${DEPS_LIBRARIES})
link_directories(${DEPS_LIBRARY_DIRS})
# make sure we have vala
find_package(Vala REQUIRED)
# make sure we use vala
include(ValaVersion)
# make sure it's the desired version of vala
ensure_vala_version("0.20" MINIMUM)
# files we want to compile
include(ValaPrecompile)
#indicator
set (INDICATOR_EXEC "indicator-kdeconnect")
vala_precompile(INDICATOR_VALA_C ${INDICATOR_EXEC}
# TODO: dont know why but this one doenst work
# ${CONSTANTS_FILE}
src/Constants.vala
src/main.vala
src/Device.vala
src/KDEConnectManager.vala
src/DeviceIndicator.vala
src/FirstTimeWizard.vala
src/StartupManager.vala
PACKAGES
gtk+-3.0
appindicator3-0.1
)
# tell cmake what to call the executable we just made
add_executable(${INDICATOR_EXEC} ${INDICATOR_VALA_C})
# install the binaries we just made
install (TARGETS ${INDICATOR_EXEC} RUNTIME DESTINATION bin)
# install our .desktop file so the Applications menu will see it
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/indicator-kdeconnect.desktop DESTINATION ${DATADIR}/applications/)
# contractor binary
set (CONTRACTOR_EXEC "kdeconnect-send")
vala_precompile(VALA_C ${CONTRACTOR_EXEC}
src/contractor/Contractor.vala
src/Device.vala
PACKAGES
gtk+-3.0
)
add_executable(${CONTRACTOR_EXEC} ${VALA_C})
install (TARGETS ${CONTRACTOR_EXEC} RUNTIME DESTINATION bin)
# install .contract file
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/kdeconnect.contract DESTINATION ${DATADIR}/contractor/)
#install icons
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/smartphone-symbolic.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/devices/)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/tablet-symbolic.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/devices/)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/computer-symbolic.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/devices/)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/laptop-symbolic.svg DESTINATION ${DATADIR}/icons/hicolor/scalable/devices/)
#install FTW image
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/indicator.jpg DESTINATION ${DATADIR}/indicator-kdeconnect/)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/startup.jpg DESTINATION ${DATADIR}/indicator-kdeconnect/)
install(
CODE
"execute_process (COMMAND gtk-update-icon-cache -t -f ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)"
CODE
"message (STATUS \"Updated icon cache in ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor\")"
)