summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
blob: 4604095ef4cbe1589191c7afcc62375d68bf81cf (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
124
125
126
127
128
129
130
131
#################################################
#
#  (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 3.5 )


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

project( tellico )
set( PACKAGE_VERSION 1.3.6 )


##### 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 #################

include( TDEMacros )


##### set version number ########################

tde_set_project_version( )


##### 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_ALL             "Build all"                                          ON )

option( BUILD_DOC             "Build documentation"                                ${BUILD_ALL} )
option( BUILD_TRANSLATIONS    "Build translations"                                 ${BUILD_ALL} )

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


##### 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 )


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

tde_conditional_add_project_docs( BUILD_DOC )
tde_conditional_add_project_translations( BUILD_TRANSLATIONS )

tde_create_translated_desktop( tellico.desktop )
tde_create_translated_desktop(
  SOURCE x-tellico.desktop
  DESTINATION ${MIME_INSTALL_DIR}/application
)
tde_create_translated_desktop(
  SOURCE tellico.xml
  KEYWORDS comment
  FORMAT xml
  DESTINATION ${XDG_MIME_INSTALL_DIR}
)
install( FILES tellico.dtd tellico.tips
  DESTINATION ${DATA_INSTALL_DIR}/${CMAKE_PROJECT_NAME}
)


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

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