forked from KDE/labplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
193 lines (175 loc) · 5.22 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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
project(labplot2)
# minimum 3.2.0 for FindGSL.cmake
cmake_minimum_required(VERSION 3.2.0)
find_package(ECM 1.3.0 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS
Concurrent
Gui
PrintSupport
Svg
Widgets
)
find_package(KF5 REQUIRED COMPONENTS
Archive
Completion
Config
ConfigWidgets
CoreAddons
DocTools
I18n
IconThemes
KDELibs4Support
KIO
NewStuff
TextWidgets
WidgetsAddons
XmlGui
OPTIONAL_COMPONENTS
SyntaxHighlighting
)
IF (KF5SyntaxHighlighting_FOUND)
MESSAGE (STATUS "Found KF5 syntax highlighting")
add_definitions (-DHAVE_KF5_SYNTAX_HIGHLIGHTING)
ELSE ()
MESSAGE (STATUS "KF5 syntax highlighting not found")
ENDIF ()
find_package(BISON REQUIRED)
include(FeatureSummary)
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECompilerSettings)
include(KDECMakeSettings)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align -Wunreachable-code -Wunused -Wswitch-enum -fno-omit-frame-pointer -fstack-protector -fno-exceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -Wundef -Wpointer-arith -Wcast-align -Wunreachable-code -Wunused -Wswitch-enum -fno-omit-frame-pointer -fstack-protector -fno-exceptions")
add_definitions (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS})
include_directories (${QDBUS_INCLUDE_DIRS} ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
add_definitions (-DLVERSION=\"2.4.0\")
# add_definitions (-DLDEBUG='1')
set(BUILD_SHARED_LIBS true)
add_definitions(-fvisibility=default)
cmake_policy(SET CMP0002 OLD)
#cmake_policy(SET CMP0063 NEW)
### Options ######################################
option(ENABLE_CANTOR "Build with Cantor support" ON)
option(ENABLE_FFTW "Build with FFTW support" ON)
option(ENABLE_HDF5 "Build with HDF5 support" ON)
option(ENABLE_NETCDF "Build with NetCDF support" ON)
option(ENABLE_FITS "Build with FITS support" ON)
### OS macros ####################################
IF (WIN32)
add_definitions (-DHAVE_WINDOWS)
ENDIF ()
### GSL (required) ###############################
FIND_PACKAGE(GSL REQUIRED)
### Cantorlibs (optional) ###############################
IF (ENABLE_CANTOR)
FIND_LIBRARY (CANTOR_LIBS cantorlibs)
FIND_PATH (CANTOR_INCLUDE_DIR worksheetaccess.h
/usr/include/cantor
/usr/local/include/cantor
)
IF (CANTOR_LIBS AND CANTOR_INCLUDE_DIR)
SET (CANTOR_LIBS_FOUND TRUE)
ELSE ()
SET (CANTOR_LIBS_FOUND FALSE)
SET (CANTOR_LIBS "")
ENDIF()
IF (CANTOR_LIBS_FOUND)
MESSAGE (STATUS "Found Cantor Library: ${CANTOR_INCLUDE_DIR} ${CANTOR_LIBS}")
add_definitions (-DHAVE_CANTOR_LIBS)
ELSE ()
MESSAGE (STATUS "Cantor Library not found.")
ENDIF ()
ENDIF ()
### FFTW (optional) #####################################
IF (ENABLE_FFTW)
FIND_LIBRARY (FFTW_LIBRARIES fftw3
PATHS
/usr/lib
/usr/local/lib
)
FIND_PATH (FFTW_INCLUDE_DIR fftw3.h
/usr/include
/usr/local/include
)
IF (FFTW_LIBRARIES AND FFTW_INCLUDE_DIR)
SET (FFTW_FOUND TRUE)
ELSE ()
SET (FFTW_FOUND FALSE)
ENDIF ()
IF (FFTW_FOUND)
MESSAGE (STATUS "Found FFTW 3 Library: ${FFTW_INCLUDE_DIR} ${FFTW_LIBRARIES}")
add_definitions (-DHAVE_FFTW3)
ELSE ()
MESSAGE (STATUS "FFTW 3 Library not found.")
ENDIF ()
ENDIF ()
### HDF5 (optional) ##############################
IF (ENABLE_HDF5)
FIND_PACKAGE(HDF5 COMPONENTS C)
IF (HDF5_FOUND)
MESSAGE (STATUS "Found Hierarchical Data Format (HDF5) Library: ${HDF5_INCLUDE_DIRS} ${HDF5_LIBRARIES}")
add_definitions (-DHAVE_HDF5)
include_directories (${HDF5_INCLUDE_DIRS})
ELSE ()
MESSAGE (STATUS "Hierarchical Data Format (HDF5) Library not found.")
ENDIF ()
ENDIF ()
### NETCDF (optional) #############################
IF(ENABLE_NETCDF)
FIND_LIBRARY (NETCDF_LIBRARY netcdf
PATHS
/usr/lib
/usr/local/lib
)
FIND_PATH (NETCDF_INCLUDE_DIR netcdf.h
/usr/include/
/usr/local/include/
)
IF(NETCDF_LIBRARY AND NETCDF_INCLUDE_DIR)
SET (NETCDF_FOUND TRUE)
ELSE ()
SET (NETCDF_FOUND FALSE)
ENDIF ()
IF (NETCDF_FOUND)
MESSAGE (STATUS "Found Network Common Data Format (NetCDF) Library: ${NETCDF_INCLUDE_DIR} ${NETCDF_LIBRARY}")
add_definitions (-DHAVE_NETCDF)
ELSE ()
MESSAGE (STATUS "Network Common Data Format (NetCDF) Library not found.")
ENDIF ()
ENDIF ()
### FITS (optional) ###############################
IF (ENABLE_FITS)
FIND_LIBRARY (CFITSIO_LIBRARY cfitsio
PATHS
/usr/lib
/usr/local/lib
$ENV{CFITSIO}
)
FIND_PATH (CFITSIO_INCLUDE_DIR fitsio.h
/usr/include/
/usr/include/cfitsio/
/usr/local/include/
$ENV{CFITSIO}
)
IF(CFITSIO_LIBRARY AND CFITSIO_INCLUDE_DIR)
SET (CFITSIO_FOUND TRUE)
ELSE()
SET (CFITSIO_FOUND FALSE)
ENDIF()
IF (CFITSIO_FOUND)
MESSAGE (STATUS "Found Flexible Image Transport System Data Format (FITS) Library: ${CFITSIO_INCLUDE_DIR} ${CFITSIO_LIBRARY}")
add_definitions (-DHAVE_FITS)
include_directories (${CFITSIO_INCLUDE_DIR})
ELSE ()
MESSAGE (STATUS "Flexible Image Transport System Data Format (FITS) Library not found.")
ENDIF ()
ENDIF ()
#################################################
add_subdirectory(icons)
add_subdirectory(src)
add_subdirectory(doc)
install(FILES org.kde.labplot2.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)