~ximion/listaller-gnome/listaller-gnome

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
project (listaller-gtk)
cmake_minimum_required(VERSION 2.8)

#
# Base bits
#
set (PROJECT_NAME "listaller-gtk")
set (LIGTK_MAJOR 0)
set (LIGTK_MINOR 1)
set (LIGTK_MICRO 2)
set (LIGTK_VERSION "${LIGTK_MAJOR}.${LIGTK_MINOR}.${LIGTK_MICRO}")
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/data/cmake)

# Don't allow in-tree building
if(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})
      message(STATUS "Please do an out-of-tree build:")
      message(STATUS "rm -f CMakeCache.txt && mkdir build && cd build; cmake .. && make")
      message(FATAL_ERROR "In-tree-build detected!")
endif(${CMAKE_SOURCE_DIR} MATCHES ${CMAKE_BINARY_DIR})

#
# config.h
#
set (PREFIXDIR "${CMAKE_INSTALL_PREFIX}")
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share/listaller-gtk")
set (GETTEXT_PACKAGE "listaller-gtk")
set (LOCALEDIR "${DATADIR}/locale")
set (PROJECT_VERSION "${LIGTK_VERSION}")
set (BUILDDIR "${CMAKE_BINARY_DIR}")

configure_file (${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
add_definitions ("--include config.h")

#
# Options
#
option (ENABLE_NLS "Enable localisation" ON)

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
  set(CMAKE_INSTALL_PREFIX
    "/usr" CACHE PATH "Listaller-GNOME default install prefix" FORCE)
endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
add_definitions(-DCMAKE_INSTALL_PREFIX="\\\"${CMAKE_INSTALL_PREFIX}\\\"")

set(XDG_APPS_INSTALL_DIR share/applications)

#
# i18n
#
find_package (Gettext REQUIRED)

if (${GETTEXT_FOUND} STREQUAL "TRUE" AND (ENABLE_NLS))
	set (BUILD_TRANSLATION true)
endif (${GETTEXT_FOUND} STREQUAL "TRUE" AND (ENABLE_NLS))

#
# src
#
find_package(PkgConfig REQUIRED)
find_package(Vala REQUIRED)
include(${VALA_USE_FILE})
ensure_vala_version("0.12" MINIMUM)

add_subdirectory (src)
add_subdirectory (data)
if (BUILD_TRANSLATION)
	add_subdirectory (po)
endif (BUILD_TRANSLATION)