-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
149 lines (124 loc) · 3.89 KB
/
CMakeLists.txt
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
#set(CMAKE_AUTOMOC ON)
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
set(CMAKE_CXX_STANDARD 14)
ELSE ()
add_compile_options(-std=c++11)
ENDIF ()
project( openBibleViewer )
cmake_minimum_required( VERSION 2.8.12 )
set( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" )
MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} )
MESSAGE( STATUS "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} )
include(InstallRequiredSystemLibraries)
#### debug or release ####
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif(NOT CMAKE_BUILD_TYPE)
message(STATUS "Using build type: ${CMAKE_BUILD_TYPE}")
if(CMAKE_BUILD_TYPE STREQUAL "Release")
option( OBV_NO_DEBUG_OUTPUT "Do not show Debug output" ON )
else()
option( OBV_NO_DEBUG_OUTPUT "Do not show Debug output" OFF )
option( OBV_DEBUG "Do not show Debug output" ON )
endif()
#### options ####
option( OBV_PORTABLE_VERSION "Build a portable version" OFF )
option( OBV_SWORD_SUPPORT "Build with sword support" OFF )
option( OBV_USE_QUAZIP "Use QuaZip" OFF)
#we have to use toStdWString() on linux
if(MSVC)
add_definitions(-DUNICODE -D_UNICODE)
option( OBV_USE_WSTRING "Use toStdWString and fromWCharArray" OFF)
else()
option( OBV_USE_WSTRING "Use toStdWString and fromWCharArray" ON)
endif()
#### constants ####
set(OBV_VERSION_NUMBER "0.9.0")
set(OBV_VERSION_STATUS "stable")
set(OBV_BUILD_DATE "2017-11-21")
#### packages ####
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Sql REQUIRED)
find_package(Qt5Script REQUIRED)
find_package(Qt5WebKitWidgets REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
if(NOT MSVC)
find_package( CLucene1 REQUIRED)
endif()
# optional quazip, we are using by default unzip or 7za.exe on windows
IF(OBV_USE_QUAZIP)
find_package( QuaZip REQUIRED)
endif()
if(NOT MSVC)
include(FindZLIB)
endif()
#### config paths ####
IF(MSVC)
#nmake definitions for less output
#add_definitions( "/nologo /w" )
#set path to zlib dll
MESSAGE( STATUS "CLUCENE_SOURCE: " ${CLUCENE_SOURCE} )
MESSAGE( STATUS "CLUCENE_INSTALL: " ${CLUCENE_INSTALL} )
SET( MCLUCENE_BUILD_SHARED "${CLUCENE_SOURCE}\\build\\src\\shared")
SET( CLUCENE1_INCLUDE_DIRS "${CLUCENE_INSTALL}\\include")
SET( MCLUCENE_DLL_SHARED "${CLUCENE_INSTALL}\\\\lib\\\\clucene-shared.dll")
set( MCLUCENE_DLL_CORE "${CLUCENE_INSTALL}\\\\lib\\\\clucene-core.dll")
set( CL_LIBS "${CLUCENE_INSTALL}\\lib\\clucene-shared.lib" "${CLUCENE_INSTALL}\\lib\\clucene-core.lib")
# no need to change
set( UNZIP_EXE "${CMAKE_SOURCE_DIR}\\\\src\\\\extern\\\\7za.exe")
endif()
## Sword
if(OBV_SWORD_SUPPORT)
include (FindSword)
if (NOT SWORD_NOT_FOUND)
ADD_DEFINITIONS(-DBUILD_WITH_SWORD)
else()
set(OBV_SWORD_SUPPORT FALSE)
endif()
endif(OBV_SWORD_SUPPORT)
if(OBV_SWORD_SUPPORT)
set(SW_LIBS ${CURL_LIBRARIES} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES} ${SWORD_LIBRARY})
include_directories(
${SWORD_INCLUDE_DIR}
)
else(OBV_SWORD_SUPPORT)
set(SW_LIBS "")
endif(OBV_SWORD_SUPPORT)
include_directories(
${CMAKE_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Sql_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
${Qt5Network_INCLUDE_DIRS}
${Qt5Script_INCLUDE_DIRS}
${Qt5WebKitWidgets_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIR}
${openBibleViewer_BINARY_DIR}/src # for config file
${CLUCENE1_INCLUDE_DIRS}
${MCLUCENE_BIN_SHARED}
${MCLUCENE_INCLUDE}
${QuaZip_INCLUDE_DIR}
)
#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
add_subdirectory( src/extern )
add_subdirectory( src/core )
# sources
include(sources)
if(APPLE)
include(osx)
elseif(WIN32)
include(windows)
else()
include(linux)
endif()