CMakeLists.txt 10.8 KB
Newer Older
Olivier Langella's avatar
Olivier Langella committed
1
2
3
4
5
# CMake script for xtpcpp
# Author: Olivier Langella
# Created: 03/03/2015


6
SET(xtpcpp_RCCS xtpcpp.qrc)
Olivier Langella's avatar
Olivier Langella committed
7
8
9
10
11
12
13
14
15
# Appeler automatique le moc quand nécessaire
#SET(CMAKE_AUTOMOC ON)
# Les fichiers générés par le moc sont générés dans le dossier bin, dire à CMake de toujours 	
# inclure les entêtes de ce dossier
#SET(CMAKE_INCLUDE_CURRENT_DIR ON)

#FIND_PACKAGE(Boost REQUIRED)
#INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS})

16
FIND_PACKAGE( Qt5 COMPONENTS Core Gui Svg Xml PrintSupport Network REQUIRED )
Langella Olivier's avatar
Langella Olivier committed
17
QT5_ADD_RESOURCES(xtpcpp_RCC_SRCS ${xtpcpp_RCCS})
Olivier Langella's avatar
Olivier Langella committed
18

Langella Olivier's avatar
Langella Olivier committed
19
20
FIND_PACKAGE( ZLIB REQUIRED )

21
if (QCustomPlot_FOUND)
22
    MESSAGE("QCustomPlot_INCLUDES found ${QCustomPlot_INCLUDES}")
23
24
25
else (QCustomPlot_FOUND)
    FIND_PACKAGE( QCustomPlot REQUIRED )
endif (QCustomPlot_FOUND)
26
    
Langella Olivier's avatar
Langella Olivier committed
27
28
29
30
31
if (ODSSTREAM_QT5_FOUND)
else (ODSSTREAM_QT5_FOUND)
    FIND_PACKAGE( Odsstream REQUIRED ) #ODSSTREAM_INCLUDE_DIR AND ODSSTREAM_LIBRARY
endif (ODSSTREAM_QT5_FOUND)

Langella Olivier's avatar
Langella Olivier committed
32
33
34
#SET (ODSSTREAM_DIR  "/home/olivier/eclipse/git/libodsstream")
#SET (ODSSTREAM_INCLUDE_DIR "${ODSSTREAM_DIR}/src")
#SET (ODSSTREAM_QT5_LIBRARY "${ODSSTREAM_DIR}/build/src/libodsstream-qt5.so")
Olivier Langella's avatar
Olivier Langella committed
35
36
37
38

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} ${Qt5Gui_EXECUTABLE_COMPILE_FLAGS} ${Qt5Svg_EXECUTABLE_COMPILE_FLAGS}")


Olivier Langella's avatar
Olivier Langella committed
39
40

#sudo apt-get install libpappsomspp-dev
Langella Olivier's avatar
Langella Olivier committed
41
42
if (PAPPSOMSPP_QT5_FOUND)
else (PAPPSOMSPP_QT5_FOUND)
43
    MESSAGE("looking for PAPPSOms++ library")
Langella Olivier's avatar
Langella Olivier committed
44
45
	FIND_PACKAGE( Pappsomspp REQUIRED )
endif (PAPPSOMSPP_QT5_FOUND)
46

Langella Olivier's avatar
Langella Olivier committed
47
48
49
50
51
52
53
54
55
56
57
IF (PAPPSOMSPP_QT5_FOUND)
ELSE (PAPPSOMSPP_QT5_FOUND)
  MESSAGE("PAPPSOms++ library not found")
  MESSAGE("did you apt-get install libpappsomspp-dev ?")
ENDIF (PAPPSOMSPP_QT5_FOUND)

IF (PAPPSOMSPP_WIDGET_QT5_FOUND)
ELSE (PAPPSOMSPP_WIDGET_QT5_FOUND)
  MESSAGE("PAPPSOms++ widget library not found")
  MESSAGE("did you apt-get install libpappsomspp-widget-dev ?")
ENDIF (PAPPSOMSPP_WIDGET_QT5_FOUND)
Olivier Langella's avatar
Olivier Langella committed
58

59
MESSAGE("PAPPSOms++ library : ${PAPPSOMSPP_QT5_LIBRARY}")
Olivier Langella's avatar
Olivier Langella committed
60
61
62

set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules)

Langella Olivier's avatar
Langella Olivier committed
63
64
if (Pwiz_FOUND)
else (Pwiz_FOUND)
Langella Olivier's avatar
Langella Olivier committed
65
    FIND_PACKAGE(Pwiz REQUIRED COMPONENTS chrono filesystem iostreams program_options serialization system thread)
Langella Olivier's avatar
Langella Olivier committed
66
67
endif (Pwiz_FOUND)

Langella Olivier's avatar
Langella Olivier committed
68
69
70
71
72
73
74
75
if (Boost_FOUND)
else (Boost_FOUND)
    FIND_PACKAGE(Boost REQUIRED)
endif (Boost_FOUND)



if (Boost_FOUND)
Langella Olivier's avatar
Langella Olivier committed
76
    MESSAGE("Boost_LIBRARIES found ${Boost_LIB_VERSION}")
Langella Olivier's avatar
Langella Olivier committed
77
endif (Boost_FOUND)
Langella Olivier's avatar
Langella Olivier committed
78
79


Olivier Langella's avatar
Olivier Langella committed
80
IF (Pwiz_FOUND)
81
  #INCLUDE_DIRECTORIES( ${Pwiz_INCLUDE_DIR})
Olivier Langella's avatar
Olivier Langella committed
82
83
84
85
86
87
88
89
90
91
92
  #FIND_PACKAGE(Boost REQUIRED)
  #INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS})
ELSE (Pwiz_FOUND)
  MESSAGE("Proteowizard library not found")
  MESSAGE("did you apt-get install libpwiz-dev libboost-dev ?")
ENDIF (Pwiz_FOUND)

configure_file (${CMAKE_SOURCE_DIR}/src/config.h.cmake ${CMAKE_SOURCE_DIR}/src/config.h)

# File list
SET(CPP_FILES
Olivier Langella's avatar
Olivier Langella committed
93
  core/automaticfilterparameters.cpp
Olivier Langella's avatar
Olivier Langella committed
94
  core/identificationgroup.cpp
95
  core/identification_sources/identificationdatasource.cpp
Langella Olivier's avatar
Langella Olivier committed
96
  core/identification_sources/identificationmascotdatfile.cpp
Langella Olivier's avatar
Langella Olivier committed
97
  core/identification_sources/identificationpepxmlfile.cpp
98
  core/identification_sources/identificationpwizfile.cpp
99
  core/identification_sources/identificationxtandemfile.cpp
Olivier Langella's avatar
Olivier Langella committed
100
101
  core/labeling/label.cpp
  core/labeling/labelingmethod.cpp
Langella Olivier's avatar
Langella Olivier committed
102
  core/qvalue/computeqvalues.cpp
103
  core/tandem_run/tandembatchprocess.cpp
Olivier Langella's avatar
Olivier Langella committed
104
  core/tandem_run/tandemcondorprocess.cpp
105
  core/tandem_run/tandemparameters.cpp
106
  core/msrun.cpp
107
  core/peptideevidence.cpp
Olivier Langella's avatar
Olivier Langella committed
108
  core/peptidematch.cpp
109
  core/peptidextp.cpp
110
  core/project.cpp
Olivier Langella's avatar
Olivier Langella committed
111
  core/proteinmatch.cpp
112
113
  core/proteinxtp.cpp
  core/sequencedatabase.cpp
114
  files/fastafile.cpp
115
  files/tandemparametersfile.cpp
116
  files/xpipfile.cpp
117
  grouping/groupingexperiment.cpp
118
  grouping/groupinggroup.cpp
Olivier Langella's avatar
Olivier Langella committed
119
  grouping/groupingpeptidemass.cpp
Olivier Langella's avatar
Olivier Langella committed
120
121
  grouping/ptm/ptmgroupingexperiment.cpp
  grouping/ptm/ptmisland.cpp
Olivier Langella's avatar
Olivier Langella committed
122
  grouping/ptm/ptmislandgroup.cpp
123
  grouping/ptm/ptmislandsubgroup.cpp
124
  grouping/ptm/ptmsamplescan.cpp
Langella Olivier's avatar
Langella Olivier committed
125
126
  input/mascot/mascotdatparser.cpp
  input/mascot/mimeparser.cpp
Langella Olivier's avatar
Langella Olivier committed
127
  input/condorqxmlsaxhandler.cpp
128
  input/identificationpwizreader.cpp
Langella Olivier's avatar
Langella Olivier committed
129
  input/pepxmlsaxhandler.cpp
Olivier Langella's avatar
Olivier Langella committed
130
  input/xpipsaxhandler.cpp
131
  input/xtandemparamsaxhandler.cpp
Olivier Langella's avatar
Olivier Langella committed
132
  input/xtandemsaxhandler.cpp
133
  input/xtpxpipsaxhandler.cpp
134
135
  output/mcqr/mcqrscprotein.cpp
  output/mcqr/mcqrscpeptide.cpp
136
  output/ods/ptm/ptmislandsheet.cpp
137
  output/ods/ptm/ptmspectrasheet.cpp
Olivier Langella's avatar
Olivier Langella committed
138
  output/ods/comparbasesheet.cpp
Olivier Langella's avatar
Olivier Langella committed
139
  output/ods/comparspecificspectrasheet.cpp
140
  output/ods/comparspectrabypeptide.cpp
Olivier Langella's avatar
Olivier Langella committed
141
  output/ods/comparspectrasheet.cpp
Olivier Langella's avatar
Olivier Langella committed
142
  output/ods/groupingsheet.cpp
Olivier Langella's avatar
Olivier Langella committed
143
  output/ods/infosheet.cpp
Olivier Langella's avatar
Olivier Langella committed
144
  output/ods/odsexport.cpp
Olivier Langella's avatar
Olivier Langella committed
145
  output/ods/peptidepossheet.cpp
Olivier Langella's avatar
Olivier Langella committed
146
  output/ods/peptidesheet.cpp
147
  output/ods/proteinsheet.cpp
148
  output/ods/qvaluessheet.cpp
149
  output/ods/samplesheet.cpp
Olivier Langella's avatar
Olivier Langella committed
150
  output/ods/simplesheet.cpp
151
  output/ods/spectrasheet.cpp
152
  output/exportfastafile.cpp
Langella Olivier's avatar
Langella Olivier committed
153
  output/masschroqml.cpp
Langella Olivier's avatar
Langella Olivier committed
154
  output/masschroqprm.cpp
155
  output/mcqrspectralcount.cpp
Langella Olivier's avatar
Langella Olivier committed
156
157
  output/proticdbml.cpp
  output/xpip.cpp
Olivier Langella's avatar
Olivier Langella committed
158
  utils/fastafilestore.cpp
159
  utils/identificationdatasourcestore.cpp
160
  utils/groupstore.cpp
161
  utils/httpversion.cpp
162
  utils/msrunstatisticshandler.cpp
163
  utils/msrunstore.cpp
164
  utils/peptideevidencestore.cpp
Olivier Langella's avatar
Olivier Langella committed
165
  utils/peptidestore.cpp
Olivier Langella's avatar
Olivier Langella committed
166
  utils/proteinstore.cpp
Olivier Langella's avatar
Olivier Langella committed
167
  utils/utils.cpp
Olivier Langella's avatar
Olivier Langella committed
168
169
)

Olivier Langella's avatar
Olivier Langella committed
170
171
172
173
# we need this to be able to include headers produced by uic in our code
# (CMAKE_BINARY_DIR holds a path to the build directory, while INCLUDE_DIRECTORIES() works just like INCLUDEPATH from qmake)

SET(XTPCPP_SRCS
174
  ./gui/about_dialog/aboutdialog.cpp
Olivier Langella's avatar
Olivier Langella committed
175
  ./gui/choose_modification_dialog/choosemodificationdialog.cpp
176
177
  ./gui/edit/edit_label_methods/editlabelmethods.cpp
  ./gui/edit/edit_modifications/editmodifications.cpp
178
  ./gui/edit/edit_settings/editsettings.cpp
179
  ./gui/edit/edit_tandem_preset_dialog/edittandempresetdialog.cpp
180
  ./gui/export/export_masschroq_dialog/exportmasschroqdialog.cpp
181
  ./gui/export/export_masschroq_dialog/masschroqfileparameters.cpp
182
  ./gui/export/export_spreadsheet_dialog/exportspreadsheetdialog.cpp
183
  ./gui/load_results_dialog/loadresultsdialog.cpp
184
185
186
  ./gui/lists/ms_identification_run_list_view/msidentificationlistwindow.cpp
  ./gui/lists/ms_identification_run_list_view/msidentificationtablemodel.cpp
  ./gui/lists/ms_identification_run_list_view/msidentificationtableproxymodel.cpp
Olivier Langella's avatar
Olivier Langella committed
187
  ./gui/mainwindow.cpp
Olivier Langella's avatar
Olivier Langella committed
188
  ./gui/peptide_detail_view/peptidewindow.cpp
Olivier Langella's avatar
Olivier Langella committed
189
190
  ./gui/peptide_list_view/peptidelistwindow.cpp
  ./gui/peptide_list_view/peptidetablemodel.cpp
Olivier Langella's avatar
Olivier Langella committed
191
  ./gui/peptide_list_view/peptidetableproxymodel.cpp
Olivier Langella's avatar
Olivier Langella committed
192
  ./gui/project_view/identification_group_widget/identificationgroupwidget.cpp
193
  ./gui/project_view/projectwindow.cpp
Olivier Langella's avatar
Olivier Langella committed
194
  ./gui/protein_view/proteinwindow.cpp
Olivier Langella's avatar
Olivier Langella committed
195
  ./gui/protein_list_view/proteinlistwindow.cpp
196
  ./gui/protein_list_view/proteintablemodel.cpp
Olivier Langella's avatar
Olivier Langella committed
197
  ./gui/protein_list_view/proteintableproxymodel.cpp
Olivier Langella's avatar
Olivier Langella committed
198
199
200
  ./gui/ptm_island_list_view/ptmislandlistwindow.cpp
  ./gui/ptm_island_list_view/ptmislandtablemodel.cpp
  ./gui/ptm_island_list_view/ptmislandproxymodel.cpp
201
202
203
  ./gui/ptm_peptide_list_view/ptmpeptidelistwindow.cpp
  ./gui/ptm_peptide_list_view/ptmpeptidetablemodel.cpp
  ./gui/ptm_peptide_list_view/ptmpeptidetableproxymodel.cpp
204
  ./gui/ptm_peptide_list_view/ptmsequencedelegate.cpp
205
  ./gui/tandem_run_dialog/tandemrundialog.cpp
206
  ./gui/waiting_message_dialog/waitingmessagedialog.cpp
207
  ./gui/widgets/automatic_filter_widget/automaticfilterwidget.cpp
208
  ./gui/widgets/contaminant_widget/contaminantwidget.cpp
Langella Olivier's avatar
Langella Olivier committed
209
  ./gui/widgets/decoy_widget/decoywidget.cpp
210
  ./gui/widgets/xic_extraction_method_widget/xicextractionmethodwidget.cpp
211
  ./gui/widgets/massitemdelegate.cpp
Langella Olivier's avatar
Langella Olivier committed
212
  ./gui/xic_view/xic_box/xicbox.cpp
213
  ./gui/xic_view/xic_widgets/zivydialog.cpp
214
  ./gui/xic_view/xic_widgets/zivywidget.cpp
Langella Olivier's avatar
Langella Olivier committed
215
  ./gui/xic_view/xicwindow.cpp
Langella Olivier's avatar
Langella Olivier committed
216
  ./gui/xic_view/xicworkerthread.cpp
217
  ./gui/workerthread.cpp
218
  ./utils/workmonitor.cpp
Olivier Langella's avatar
Olivier Langella committed
219
220
)

Olivier Langella's avatar
Olivier Langella committed
221
SET (GUI_UIS
222
  ./gui/about_dialog/about_dialog.ui
Olivier Langella's avatar
Olivier Langella committed
223
  ./gui/choose_modification_dialog/choose_modification_dialog.ui
224
225
  ./gui/edit/edit_label_methods/edit_label_methods.ui
  ./gui/edit/edit_modifications/edit_modifications.ui
226
  ./gui/edit/edit_settings/edit_settings.ui
227
  ./gui/edit/edit_tandem_preset_dialog/edit_tandem_preset_dialog.ui
228
  ./gui/export/export_masschroq_dialog/export_masschroq_dialog.ui
229
  ./gui/export/export_spreadsheet_dialog/export_spreadsheet_dialog.ui
230
  ./gui/lists/ms_identification_run_list_view/ms_identification_run_view.ui
231
  ./gui/load_results_dialog/load_results_dialog.ui
Olivier Langella's avatar
Olivier Langella committed
232
  ./gui/main.ui
Olivier Langella's avatar
Olivier Langella committed
233
  ./gui/peptide_detail_view/peptide_detail_view.ui
Olivier Langella's avatar
Olivier Langella committed
234
  ./gui/peptide_list_view/peptide_view.ui
Olivier Langella's avatar
Olivier Langella committed
235
  ./gui/project_view/identification_group_widget/identification_group_widget.ui
236
  ./gui/project_view/project_view.ui
Olivier Langella's avatar
Olivier Langella committed
237
  ./gui/protein_list_view/protein_view.ui
Olivier Langella's avatar
Olivier Langella committed
238
  ./gui/protein_view/protein_detail_view.ui
Olivier Langella's avatar
Olivier Langella committed
239
  ./gui/ptm_island_list_view/ptm_island_list_view.ui
240
  ./gui/ptm_peptide_list_view/ptm_peptide_list_view.ui
241
  ./gui/tandem_run_dialog/tandem_run_dialog.ui
242
  ./gui/waiting_message_dialog/waiting_message_dialog.ui
243
  ./gui/widgets/automatic_filter_widget/automatic_filter_widget.ui
244
  ./gui/widgets/contaminant_widget/contaminant_widget.ui
Langella Olivier's avatar
Langella Olivier committed
245
  ./gui/widgets/decoy_widget/decoy_widget.ui
Langella Olivier's avatar
Langella Olivier committed
246
  ./gui/xic_view/xic_box/xic_box.ui
247
  ./gui/xic_view/xic_widgets/zivy_widget.ui
Langella Olivier's avatar
Langella Olivier committed
248
  ./gui/xic_view/xic_window.ui
Olivier Langella's avatar
Olivier Langella committed
249
250
251
252
)


# this will run uic on .ui files:
Langella Olivier's avatar
Langella Olivier committed
253
QT5_WRAP_UI( GUI_UI_HDRS ${GUI_UIS} )
Olivier Langella's avatar
Olivier Langella committed
254
255


Olivier Langella's avatar
Olivier Langella committed
256
MESSAGE("XTPCPP_SRCS:  ${XTPCPP_SRCS}")
Olivier Langella's avatar
Olivier Langella committed
257
258


Langella Olivier's avatar
Langella Olivier committed
259
ADD_EXECUTABLE(xtpcpp main.cpp ${CPP_FILES} ${XTPCPP_SRCS} ${GUI_UI_HDRS} ${xtpcpp_RCC_SRCS})
260

Langella Olivier's avatar
Langella Olivier committed
261
target_include_directories (xtpcpp PUBLIC ${Pwiz_INCLUDE_DIR} ${PAPPSOMSPP_INCLUDE_DIR} ${ODSSTREAM_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${QCustomPlot_INCLUDES} ${QUAZIP_INCLUDE_DIR})
Olivier Langella's avatar
Olivier Langella committed
262
263

target_compile_definitions(xtpcpp PUBLIC ${QT_DEFINITIONS})
Olivier Langella's avatar
Olivier Langella committed
264
265
266
  SET_TARGET_PROPERTIES(xtpcpp
    PROPERTIES OUTPUT_NAME xtpcpp
    CLEAN_DIRECT_OUTPUT 1
Olivier Langella's avatar
Olivier Langella committed
267
    #COMPILE_DEFINITIONS "${QT_DEFINITIONS}"
Olivier Langella's avatar
Olivier Langella committed
268
269
    #INCLUDE_DIRECTORIES "${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}"
    )
Langella Olivier's avatar
Langella Olivier committed
270
if (MINGW)
Langella Olivier's avatar
Langella Olivier committed
271
272
273
274
275
276
    TARGET_LINK_LIBRARIES(xtpcpp 
    ${PAPPSOMSPP_QT5_LIBRARY} 
    ${PAPPSOMSPP_WIDGET_QT5_LIBRARY} 
    ${Pwiz_LIBRARY} 
    ${ODSSTREAM_QT5_LIBRARY} 
    ${QCustomPlot_LIBRARIES}
Langella Olivier's avatar
Langella Olivier committed
277
278
279
280
281
282
283
284
    ${Boost_chrono_LIBRARY}
    ${Boost_filesystem_LIBRARY}
    ${Boost_iostreams_LIBRARY}
    ${Boost_program_options_LIBRARY}
    ${Boost_serialization_LIBRARY}
    ${Boost_system_LIBRARY}
    ${Boost_thread_LIBRARY}
    ${ZLIB_LIBRARIES}
285
    Qt5::Gui Qt5::Xml Qt5::Svg Qt5::PrintSupport Qt5::Network)
Langella Olivier's avatar
Langella Olivier committed
286
287
else (MINGW)
    TARGET_LINK_LIBRARIES(xtpcpp ${PAPPSOMSPP_QT5_LIBRARY} ${PAPPSOMSPP_WIDGET_QT5_LIBRARY} ${Pwiz_LIBRARY} ${ODSSTREAM_QT5_LIBRARY} ${QCustomPlot_LIBRARIES}
288
    Qt5::Gui Qt5::Xml Qt5::Svg Qt5::PrintSupport Qt5::Network)
Langella Olivier's avatar
Langella Olivier committed
289
endif (MINGW)
Olivier Langella's avatar
Olivier Langella committed
290
291
292

INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xtpcpp DESTINATION bin)

Olivier Langella's avatar
Olivier Langella committed
293
#configure_file (${CMAKE_SOURCE_DIR}/templates/share/applications/pt-peptideviewer.desktop.cmake ${CMAKE_BINARY_DIR}/templates/share/applications/pt-peptideviewer.desktop)
294