summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 44b77cddb61c163733923759a12198047a13aa61 (plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#################################################
#
#  (C) 2016 Slávek Banko
#  slavek.banko (AT) axis.cz
#
#  Improvements and feedback are welcome
#
#  This file is released under GPL >= 2
#
#################################################

cmake_minimum_required( VERSION 2.8 )


##### general package setup #####################

project( tellico )
set( VERSION R14.0.9 )


##### include essential cmake modules ###########

include( FindPkgConfig )
include( CheckIncludeFile )
include( CheckLibraryExists )
include( CheckSymbolExists )
include( CheckTypeSize )
# EXAMPLE:
# include( CheckCSourceCompiles )
# include( CheckCXXSourceCompiles )

enable_testing()


##### include our cmake modules #################

set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )


##### setup install paths #######################

include( TDESetupPaths )
tde_setup_paths( )


##### optional stuff ############################

option( WITH_ALL_OPTIONS   "Enable all sane supported options" OFF )

option( WITH_LIBKCDDB      "Enable FreeDB integration" ${WITH_ALL_OPTIONS} )
option( WITH_LIBKCAL       "Enable KOrganizer integration" ${WITH_ALL_OPTIONS} )
option( WITH_LIBBTPARSE    "Use btparse shared library" ${WITH_ALL_OPTIONS} )
option( WITH_SAX_LOADER    "Use SAX document loading (experimental)" ${WITH_ALL_OPTIONS} )


##### options comments ##########################

# WITH_LIBKCDDB       enable searching via freedb
# WITH_LIBKCAL        enable integration with KOrganizer
# WITH_LIBBTPARSE     if enabled use system library btparse instead of build-in
# WITH_SAX_LOADER     if enabled documents will be openned using SAX loader


##### user requested modules ####################

option( BUILD_DOC "Build documentation" ON )
option( BUILD_TRANSLATIONS "Build translations" ON )
option( BUILD_XMLCATALOG "" OFF )

option( BUILD_AMAZON_SUPPORT "Build Amazon.com searching support" ON )
option( BUILD_IMDB_SUPPORT "Build IMDb searching support" ON )
option( BUILD_CDTEXT_SUPPORT "Build CD-Text support (Linux only)" ON )
option( BUILD_OOO_SUPPORT "Build LibreOffice/OpenOffice.org support" OFF )
option( BUILD_EXEMPI_SUPPORT "Build exempi support" ON )
option( BUILD_POPPLER_SUPPORT "Build poppler support" ON )
option( BUILD_WEBCAM_SUPPORT "Build support for scanning barcodes (experimental)" ON )


##### configure checks ##########################

include( ConfigureChecks.cmake )


###### global compiler settings #################

add_definitions(
  -DHAVE_CONFIG_H
)

set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )


##### tellico directories #######################

add_subdirectory( src )
add_subdirectory( icons )
add_subdirectory( xslt )
tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
tde_conditional_add_subdirectory( BUILD_DOC doc )


##### other data ################################

install( FILES tellico.desktop
  DESTINATION ${XDG_APPS_INSTALL_DIR}
)
install( FILES tellico.xml
  DESTINATION ${XDG_MIME_INSTALL_DIR}
)
install( FILES x-tellico.desktop
  DESTINATION ${MIME_INSTALL_DIR}/application
)
install( FILES tellico.dtd tellico.tips
  DESTINATION ${DATA_INSTALL_DIR}/${CMAKE_PROJECT_NAME}
)


##### write configure files #####################

configure_file( config.h.cmake config.h @ONLY )