~elementary-apps/noise/master

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Victor Eduardo
  • Date: 2012-09-25 06:56:04 UTC
  • Revision ID: git-v1:ded5267817bd4b73595bddaa6ccdeec760055b9d
CMake cleanup. Make the CMakeLists.txt files easier to read and understand; remove redundant uses of names (especially "noise"), and clean up dependency lists

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
project(noise)
6
6
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
7
7
 
8
 
find_package(PkgConfig)
9
 
pkg_check_modules(DEPS
10
 
    REQUIRED
 
8
set(GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME})
 
9
set(RELEASE_NAME "Luna-Beta-1")
 
10
set(VERSION "1.0")
 
11
set(VERSION_INFO "Pre-Release")
 
12
 
 
13
set(DATADIR ${CMAKE_INSTALL_PREFIX}/share)
 
14
set(PKG_DATADIR ${DATADIR}/${CMAKE_PROJECT_NAME})
 
15
set(ICON_DIR ${DATADIR}/${CMAKE_PROJECT_NAME}/icons)
 
16
set(PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/lib/${CMAKE_PROJECT_NAME}/plugins)
 
17
 
 
18
add_definitions("-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"")
 
19
 
 
20
set(SRC_TARGET ${CMAKE_PROJECT_NAME})
 
21
set(CORE_LIBRARY_NAME ${SRC_TARGET}-core)
 
22
 
 
23
set(CORE_PACKAGES
11
24
    glib-2.0
 
25
    gio-2.0
 
26
    gee-1.0
 
27
    libpeas-1.0
 
28
    libpeas-gtk-1.0
12
29
    gtk+-3.0
13
 
    gdk-x11-3.0
 
30
    granite
 
31
)
 
32
 
 
33
set(DEPS_PACKAGES
 
34
    ${CORE_LIBRARY_NAME}
 
35
    ${CORE_PACKAGES}
 
36
    gstreamer-0.10
 
37
    gstreamer-interfaces-0.10
 
38
    gstreamer-pbutils-0.10
 
39
    gstreamer-tag-0.10
 
40
    taglib_c
 
41
)
 
42
 
 
43
 
 
44
find_package(PkgConfig)
 
45
 
 
46
pkg_check_modules(DEPS REQUIRED
 
47
    glib-2.0>=2.32
 
48
    gio-2.0
14
49
    gee-1.0
15
50
    gstreamer-0.10
16
51
    gstreamer-interfaces-0.10
 
52
    gstreamer-tag-0.10
17
53
    gstreamer-pbutils-0.10
18
 
    gstreamer-cdda-0.10
19
54
    taglib_c
20
 
    gio-2.0
21
 
    libxml-2.0
22
 
    libnotify # FIXME should be a soft dependency
23
 
    libsoup-2.4
24
 
    json-glib-1.0
25
 
    gio-unix-2.0
 
55
    gtk+-3.0>=3.4.2
26
56
    granite
27
57
    libpeas-gtk-1.0
28
 
    libpeas-1.0)
 
58
    libpeas-1.0
 
59
)
29
60
 
30
 
# Check if we have sqlheavy-0.2
31
 
pkg_check_modules(SQLHEAVY2 sqlheavy-0.2)
32
 
if(${SQLHEAVY2_FOUND})
33
 
    set(ADD_PKG ${ADD_PKG} sqlheavy-0.2)
 
61
#
 
62
# SQLHeavy: Use version 0.2 if it is available; otherwise, fall back to 0.1
 
63
#
 
64
pkg_check_modules(SQLHEAVY2 QUIET sqlheavy-0.2)
 
65
if (SQLHEAVY2_FOUND)
34
66
    message("-- Will use sqlheavy-0.2")
 
67
    set(DEPS_PACKAGES ${DEPS_PACKAGES} sqlheavy-0.2)
35
68
    set(SQLHEAVY_CFLAGS ${SQLHEAVY2_CFLAGS})
36
69
    set(SQLHEAVY_LIBRARY_DIRS ${SQLHEAVY2_LIBRARY_DIRS})
37
70
    set(SQLHEAVY_LIBRARIES ${SQLHEAVY2_LIBRARIES})
38
 
else()
 
71
else ()
 
72
    message("-- Will use sqlheavy-0.1")
39
73
    pkg_check_modules(SQLHEAVY REQUIRED sqlheavy-0.1)
40
 
    set(ADD_PKG ${ADD_PKG} sqlheavy-0.1)
41
 
    message("-- Will use sqlheavy-0.1")
42
 
endif()
43
 
 
44
 
 
45
 
set(NORMAL_CFLAGS ${DEPS_CFLAGS} ${SQLHEAVY_CFLAGS})
46
 
set(NORMAL_LIBRARIES ${DEPS_LIBRARIES} ${SQLHEAVY_LIBRARIES})
47
 
set(NORMAL_LINK_DIRS ${DEPS_LIBRARY_DIRS} ${SQLHEAVY_LIBRARY_DIRS})
 
74
    set(DEPS_PACKAGES ${DEPS_PACKAGES} sqlheavy-0.1)
 
75
endif ()
 
76
 
 
77
set(DEPS_CFLAGS ${DEPS_CFLAGS} ${SQLHEAVY_CFLAGS})
 
78
set(DEPS_LIBRARIES ${DEPS_LIBRARIES} ${SQLHEAVY_LIBRARIES})
 
79
set(DEPS_LIBRARY_DIRS ${DEPS_LIBRARY_DIRS} ${SQLHEAVY_LIBRARY_DIRS})
 
80
 
 
81
#
 
82
# Libnotify
 
83
#
 
84
pkg_check_modules(LIBNOTIFY QUIET libnotify)
 
85
if (LIBNOTIFY_FOUND)
 
86
    message("-- libnotify enabled")
 
87
 
 
88
    set(GLOBAL_VALAC_OPTIONS ${GLOBAL_VALAC_OPTIONS} --define=HAVE_LIBNOTIFY)
 
89
 
 
90
    set(DEPS_PACKAGES ${DEPS_PACKAGES} libnotify)
 
91
 
 
92
    set(DEPS_CFLAGS ${DEPS_CFLAGS} ${LIBNOTIFY_CFLAGS})
 
93
    set(DEPS_LIBRARIES ${DEPS_LIBRARIES} ${LIBNOTIFY_LIBRARIES})
 
94
    set(DEPS_LIBRARY_DIRS ${DEPS_LIBRARY_DIRS} ${LIBNOTIFY_LIBRARY_DIRS})
 
95
else ()
 
96
    message("-- libnotify disabled")
 
97
endif ()
48
98
 
49
99
 
50
100
find_package(Vala REQUIRED)
52
102
ensure_vala_version("0.16.0" MINIMUM)
53
103
include(ValaPrecompile)
54
104
 
55
 
set(DATADIR "${CMAKE_INSTALL_PREFIX}/share")
56
 
set(PKG_DATADIR "${CMAKE_INSTALL_PREFIX}/share/noise")
57
 
set(GETTEXT_PACKAGE "noise")
58
 
set(RELEASE_NAME "Luna-Beta-1")
59
 
set(VERSION "1.0")
60
 
set(VERSION_INFO "Pre-Release")
61
 
set(PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/lib/noise/plugins")
62
 
set(ICON_DIR "${CMAKE_INSTALL_PREFIX}/share/noise/icons")
63
 
add_definitions(-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\")
 
105
set(GLOBAL_VALAC_OPTIONS
 
106
    --vapidir=${CMAKE_SOURCE_DIR}/vapi
 
107
    --vapidir=${CMAKE_BINARY_DIR}/core
 
108
    --vapidir=${CMAKE_BINARY_DIR}/src
 
109
    --target-glib=2.32
 
110
    --thread
 
111
)
 
112
 
 
113
add_subdirectory(schemas)
64
114
 
65
115
add_subdirectory(core)
 
116
 
 
117
set(DEPS_LIBRARIES ${DEPS_LIBRARIES} ${CORE_LIBRARY_NAME})
66
118
add_subdirectory(src)
 
119
 
 
120
set(DEPS_PACKAGES ${DEPS_PACKAGES} ${SRC_TARGET})
 
121
add_subdirectory(plugins)
 
122
 
 
123
add_subdirectory(po)
67
124
add_subdirectory(data)
68
 
add_subdirectory(schemas)
69
 
add_subdirectory(po)
70
 
 
71
 
option(BUILD_PLUGINS "Whether to build plugins or not." ON)
72
 
if(BUILD_PLUGINS)
73
 
    message("-- Plugins will be built")
74
 
    add_subdirectory(plugins)
75
 
else()
76
 
    message("-- Plugins will NOT be built")
77
 
endif()
78
 
 
79
125
add_subdirectory(images)