~writer-devs/writer/trunk

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Tuur Dutoit
  • Date: 2014-08-14 18:42:13 UTC
  • Revision ID: me@tuurdutoit.be-20140814184213-1txyepd3vqw2vknl
First commit. Made basic structure

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
project (writer)
 
2
cmake_minimum_required (VERSION 2.8)
 
3
cmake_policy (VERSION 2.6)
 
4
 
 
5
set (DATADIR "${CMAKE_INSTALL_PREFIX}/share/writer")
 
6
set (PKGDATADIR "${DATADIR}/writer")
 
7
set (GETTEXT_PACKAGE "writer")
 
8
set (RELEASE_NAME "Writer")
 
9
set (VERSION "0.1")
 
10
set (VERSION_INFO "Release")
 
11
set (PREFIX ${CMAKE_INSTALL_PREFIX})
 
12
set (DOLLAR "$")
 
13
 
 
14
list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
 
15
 
 
16
file(GLOB_RECURSE sources src/*.vala)
 
17
 
 
18
# Some configuration
 
19
configure_file (${CMAKE_SOURCE_DIR}/src/config.vala.cmake ${CMAKE_SOURCE_DIR}/src/config.vala)
 
20
 
 
21
# Vala
 
22
find_package (Vala REQUIRED)
 
23
include (ValaVersion)
 
24
ensure_vala_version ("0.18" MINIMUM)
 
25
include (ValaPrecompile)
 
26
 
 
27
# Definitions
 
28
add_definitions (-DGETTEXT_PACKAGE="writer")
 
29
 
 
30
find_package(PkgConfig)
 
31
pkg_check_modules(DEPS REQUIRED granite gtk+-3.0 gthread-2.0)
 
32
add_definitions(${DEPS_CFLAGS})
 
33
link_libraries(${DEPS_LIBRARIES})
 
34
link_directories(${DEPS_LIBRARY_DIRS})
 
35
 
 
36
find_package(Vala REQUIRED)
 
37
include(ValaVersion)
 
38
ensure_vala_version("0.16.0" MINIMUM)
 
39
 
 
40
include(ValaPrecompile)
 
41
vala_precompile(VALA_C
 
42
    src/Writer.vala
 
43
    src/MainWindow.vala
 
44
    src/Widgets/TitleBar.vala
 
45
    src/Widgets/WelcomeView.vala
 
46
    src/config.vala
 
47
PACKAGES
 
48
    gtk+-3.0
 
49
    granite
 
50
OPTIONS
 
51
    --thread
 
52
)
 
53
 
 
54
add_subdirectory (po)
 
55
 
 
56
add_executable(writer ${VALA_C})
 
57
 
 
58
install (TARGETS writer RUNTIME DESTINATION bin)
 
59
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/writer.desktop DESTINATION share/applications)
 
60
IF (EXISTS (${CMAKE_CURRENT_SOURCE_DIR}/data/writer.svg))
 
61
    install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/writer.svg DESTINATION share/icons/hicolor/48x48/apps)
 
62
ENDIF ()