CMakeLists.txt 10.9 KB
Newer Older
Olivier Langella's avatar
   
Olivier Langella committed
1
2
3
4
5
6

# this command finds Qt4 libraries and sets all required variables
# note that it's Qt4, not QT4 or qt4

SET (QT_USE_QTXML true)
SET (QT_USE_QTXMLPATTERNS true)
7

8
9
SET(masschroq_RCCS resources.qrc)

10
11
12
if (MINGW32)
  FIND_PACKAGE( Qt4 REQUIRED )
ELSE (MINGW32)
13
  FIND_PACKAGE( Qt4 REQUIRED )
14
15
endif (MINGW32)

16
if (NOT ODSSTREAM_INCLUDE_DIR) 
Olivier Langella's avatar
Olivier Langella committed
17
FIND_PACKAGE( Odsstream REQUIRED )
18
endif (NOT ODSSTREAM_INCLUDE_DIR) 
Olivier Langella's avatar
Olivier Langella committed
19
20
21

INCLUDE_DIRECTORIES(${ODSSTREAM_INCLUDE_DIR})

Olivier Langella's avatar
   
Olivier Langella committed
22
23
24
25

# (QT_USE_FILE is a variable defined by FIND_PACKAGE( Qt4 ) that contains a path to CMake script)
INCLUDE( ${QT_USE_FILE} )

26
#sudo apt-get install libpappsomspp-dev
27
28
29
if (NOT PAPPSOMSPP_DIR) 
	FIND_PACKAGE( Pappsomspp REQUIRED )
endif (NOT PAPPSOMSPP_DIR)
Olivier Langella's avatar
Olivier Langella committed
30
#SET (PAPPSOMSPP_DIR  "/home/olivier/eclipse/git/pappsomspp")
31
32
33
#  SET (PAPPSOMSPP_DIR  "/home/langella/developpement/git/pappsomspp")
#  SET (PAPPSOMSPP_INCLUDE_DIR "${PAPPSOMSPP_DIR}/src")
#  SET (PAPPSOMSPP_QT4_LIBRARY "${PAPPSOMSPP_DIR}/build/src/libpappsomspp-qt4.so")
34

35
INCLUDE_DIRECTORIES( ${PAPPSOMSPP_INCLUDE_DIR})
36
37


38
39
40
41
SET (GUI_UIS
	./gui/mcqgui.ui
)

42
SET(MASSCHROQ_LIB_MOC_HDRS
43
   ./masschroq_cli.h
44
45
)

Olivier Langella's avatar
   
Olivier Langella committed
46
SET(MASSCHROQ_LIB_SRCS
47
  ./masschroq_cli.cpp
Olivier Langella's avatar
Olivier Langella committed
48
  ./lib/consoleout.cpp
Olivier Langella's avatar
   
Olivier Langella committed
49
  ./lib/mcq_error.h
Edlira Nano's avatar
Edlira Nano committed
50
51
52
53
54
55
56
57
  ./lib/share/utilities.cpp

  ./lib/peptides/protein.cpp
  ./lib/peptides/peptide.cpp
  ./lib/peptides/peptide_isotope.cpp
  ./lib/peptides/peptide_observed_in.cpp
  ./lib/peptides/peptide_list.cpp
  ./lib/peptides/isotope_label.cpp
58
  ./lib/peptides/peptidert.cpp
59

Edlira Nano's avatar
Edlira Nano committed
60
61
62
  ./lib/quanti_items/quantiItemBase.cpp
  ./lib/quanti_items/quantiItemMzRt.cpp
  ./lib/quanti_items/quantiItemPeptide.cpp
63
  ./lib/quanti_items/quantiitempeptidenaturalisotope.cpp
Edlira Nano's avatar
Edlira Nano committed
64
65
66
67

  ./lib/msrun/spectrum.cpp
  ./lib/msrun/precursor.cpp

68
69
  ./lib/msrun/msrun.cpp
  ./lib/msrun/msrun_classic.cpp
70
  ./lib/msrun/slice.cpp
Edlira Nano's avatar
Edlira Nano committed
71
72
  ./lib/msrun/slicer.cpp
  ./lib/msrun/msrun_sliced.cpp
Olivier Langella's avatar
   
Olivier Langella committed
73
  ./lib/msrun/ms_run_hash_group.cpp
74

Olivier Langella's avatar
   
Olivier Langella committed
75
  ./lib/quantifications/quantificationMethod.cpp
Olivier Langella's avatar
Olivier Langella committed
76
  ./lib/quantifications/mapquanti.cpp
Olivier Langella's avatar
Olivier Langella committed
77
  ./lib/quantifications/mapquantirealxic.cpp
Edlira Nano's avatar
Edlira Nano committed
78
  ./lib/quantificator.cpp
79
80
  ./lib/mass_chroq.cpp

Olivier Langella's avatar
   
Olivier Langella committed
81
82
83
84
  ./lib/alignments/alignment_base.cpp
  ./lib/alignments/alignment_obiwarp.cpp
  ./lib/alignments/alignment_ms2.cpp
  ./lib/alignments/lmatreader.cpp
85

86
87
  ./lib/alignments/monitors/monitor_alignment_base.cpp
  ./lib/alignments/monitors/monitor_alignment_time.cpp
Edlira Nano's avatar
Edlira Nano committed
88
  ./lib/alignments/monitors/monitor_alignment_plot.cpp
89

Olivier Langella's avatar
   
Olivier Langella committed
90
91
92
  ./lib/xicExtractionMethods/xicExtractionMethodBase.cpp
  ./lib/xicExtractionMethods/xicExtractionMethodMzRange.cpp
  ./lib/xicExtractionMethods/xicExtractionMethodPpmRange.cpp
93

Olivier Langella's avatar
Olivier Langella committed
94
  ./lib/xic/alignedxicpeak.cpp
Olivier Langella's avatar
   
Olivier Langella committed
95
  ./lib/xic/xic_base.cpp
Olivier Langella's avatar
Olivier Langella committed
96
  ./lib/xic/xicfilterdetectmatch.cpp
Olivier Langella's avatar
Olivier Langella committed
97
  ./lib/xic/xicfilterdetectmatchrealrt.cpp
98
99
  ./lib/xic/xictracebase.cpp
  ./lib/xic/xictracepeptide.cpp
Olivier Langella's avatar
Olivier Langella committed
100
  ./lib/xic/xictracepeptidenaturalisotope.cpp
101
  ./lib/monitors/mcq_qxmlstreamwriter.cpp
Olivier Langella's avatar
   
Olivier Langella committed
102
  ./lib/monitors/masschroqWriter.cpp
103
  ./lib/monitors/monitorspeedinterface.cpp
Olivier Langella's avatar
Olivier Langella committed
104
  ./lib/monitors/monitorodsoutput.cpp
105
  ./lib/monitors/monitorspeedlist.cpp
Olivier Langella's avatar
Olivier Langella committed
106
  ./lib/monitors/monitorcomparoutput.cpp
Olivier Langella's avatar
   
Olivier Langella committed
107
  ./reporters/ReporterConsole.cpp
108

Olivier Langella's avatar
   
Olivier Langella committed
109
110
111
  )

SET(SAXLIB_SRCS
112
  ./encode/decodeBinary.cpp
113
114
115
  ./saxparsers/xmlSimpleParser.cpp
  ./saxparsers/mzxmlSimpleParser.cpp
  ./saxparsers/mzmlSimpleParser.cpp
Edlira Nano's avatar
Edlira Nano committed
116
117
118
  ./saxparsers/xmlSpectrumParser.cpp
  ./saxparsers/mzxmlSpectrumParser.cpp
  ./saxparsers/mzmlSpectrumParser.cpp
119
  ./saxparsers/xmlParserFactory.cpp
120
121
122
  ./saxparsers/xmlToLmatParser.cpp
  ./saxparsers/mzxmlToLmatParser.cpp
  ./saxparsers/mzmlToLmatParser.cpp
123
  ./saxparsers/masschroqmlParser.cpp
Olivier Langella's avatar
   
Olivier Langella committed
124
  ./pepfileparser/masschroq_dom_engine.cpp
125
126
  ./pepfileparser/pepParser.cpp
  )
Olivier Langella's avatar
   
Olivier Langella committed
127

128
SET(OBIWARP_SRCS
Olivier Langella's avatar
   
Olivier Langella committed
129
130
131
132
133
134
  ./libobiwarp/lmat.cpp
  ./libobiwarp/vec.cpp
  ./libobiwarp/mat.cpp
  ./libobiwarp/dynprog.cpp
  )

135
SET(GUI_SRCS
136
137
   ./gui/launcherMainWindow.cpp
   ./gui/thread/mcqThread.cpp
138
   ./gui/thread/masschroqRunningThread.cpp
139

140
   ./gui/logQIODevice.cpp
141
  )
142
143

SET(STUDIO_SRCS
144
   ./gui/parameterMainWindow.cpp
145

146
   ./gui/logQIODevice.cpp
Benoit Valot's avatar
Benoit Valot committed
147
   ./gui/masschroQWidget.cpp
148
   ./gui/runningQLabel.cpp
Benoit Valot's avatar
Benoit Valot committed
149
   ./gui/dom_methods/masschroqDomDocument.cpp
Benoit Valot's avatar
Benoit Valot committed
150
   ./gui/quantificationwidget/masschroqml_selection_widget.cpp
151
   ./gui/quantificationwidget/xicSelectionWidget.cpp
Benoit Valot's avatar
Benoit Valot committed
152
   ./gui/quantificationwidget/peptideSelectionWidget.cpp
153
154
155
156
157
158
159
160
   ./gui/quantificationwidget/filterBackgroundWidget.cpp
   ./gui/quantificationwidget/filterSpikeWidget.cpp
   ./gui/quantificationwidget/filterSmoothWidget.cpp
   ./gui/quantificationwidget/filterMinMaxWidget.cpp
   ./gui/quantificationwidget/filterMaxMinWidget.cpp
   ./gui/quantificationwidget/detectionZivyWidget.cpp
   ./gui/quantificationwidget/msrun_selection_widget.cpp
   ./gui/quantificationwidget/plot.cpp
Benoit Valot's avatar
Benoit Valot committed
161
162
163
164
   ./gui/alignementwidget/plot_aligned.cpp
   ./gui/alignementwidget/alignment_widget.cpp
   ./gui/alignementwidget/obiwarp_alignment_widget.cpp
   ./gui/alignementwidget/ms2_alignment_widget.cpp
165
166
   ./gui/thread/mcqThread.cpp
   ./gui/thread/msrunLoaderThread.cpp
Benoit Valot's avatar
Benoit Valot committed
167
   ./gui/thread/msrunSimpleLoaderThread.cpp
Benoit Valot's avatar
Benoit Valot committed
168
169
   ./gui/thread/masschroqmlLoaderThread.cpp
   ./gui/thread/masschroqml_gui_parser.cpp
Benoit Valot's avatar
Benoit Valot committed
170
   ./gui/thread/alignment_thread.cpp
171
   ./gui/engine/masschroq_gui_engin.cpp
Benoit Valot's avatar
Benoit Valot committed
172
   ./gui/engine/masschroq_gui_data.cpp
Benoit Valot's avatar
Benoit Valot committed
173
174
175
176
177
   ./gui/treatment/treatment_box.cpp
   ./gui/treatment/treatment_box_xic_extract.cpp
   ./gui/treatment/treatment_box_xic_filter.cpp
   ./gui/treatment/treatment_box_xic_detect.cpp
   ./gui/treatment/treatment_chain.cpp
Edlira Nano's avatar
Edlira Nano committed
178
179
180
181
   )

 # another list, this time it includes all header files that should be treated with moc
 SET(GUI_MOC_HDRS
182

183
   ./gui/logQIODevice.h
184
185
186
187
188
189
190
   ./gui/launcherMainWindow.h
   ./gui/thread/mcqThread.h
   ./gui/thread/masschroqRunningThread.h
  )

 SET(STUDIO_MOC_HDRS
   ./gui/parameterMainWindow.h
Benoit Valot's avatar
Benoit Valot committed
191
   ./gui/quantificationwidget/masschroqml_selection_widget.h
192
   ./gui/quantificationwidget/xicSelectionWidget.h
Benoit Valot's avatar
Benoit Valot committed
193
   ./gui/quantificationwidget/peptideSelectionWidget.h
194
195
196
197
198
199
200
201
   ./gui/quantificationwidget/filterBackgroundWidget.h
   ./gui/quantificationwidget/filterSpikeWidget.h
   ./gui/quantificationwidget/filterSmoothWidget.h
   ./gui/quantificationwidget/filterMinMaxWidget.h
   ./gui/quantificationwidget/filterMaxMinWidget.h
   ./gui/quantificationwidget/detectionZivyWidget.h
   ./gui/quantificationwidget/msrun_selection_widget.h
   ./gui/quantificationwidget/plot.h
Benoit Valot's avatar
Benoit Valot committed
202
203
204
205
   ./gui/alignementwidget/plot_aligned.h
   ./gui/alignementwidget/alignment_widget.h
   ./gui/alignementwidget/obiwarp_alignment_widget.h
   ./gui/alignementwidget/ms2_alignment_widget.h
206
207
   ./gui/thread/mcqThread.h
   ./gui/thread/msrunLoaderThread.h
Benoit Valot's avatar
Benoit Valot committed
208
   ./gui/thread/msrunSimpleLoaderThread.h
Benoit Valot's avatar
Benoit Valot committed
209
   ./gui/thread/masschroqmlLoaderThread.h
Benoit Valot's avatar
Benoit Valot committed
210
   ./gui/thread/alignment_thread.h
211

212
   ./gui/logQIODevice.h
Benoit Valot's avatar
Benoit Valot committed
213
   ./gui/runningQLabel.h
Benoit Valot's avatar
Benoit Valot committed
214
215
216
217
   ./gui/treatment/treatment_box.h
   ./gui/treatment/treatment_box_xic_extract.h
   ./gui/treatment/treatment_box_xic_filter.h
   ./gui/treatment/treatment_box_xic_detect.h
218
   )
Edlira Nano's avatar
Edlira Nano committed
219

Olivier Langella's avatar
   
Olivier Langella committed
220
221
set(CMAKE_MODULE_PATH ${masschroq_SOURCE_DIR}/modules)

222
QT4_WRAP_CPP( MASSCHROQ_LIB_MOC_SRCS ${MASSCHROQ_LIB_MOC_HDRS} )
223
QT4_ADD_RESOURCES(MASSCHROQ_RCC_SRCS_QT4 ${masschroq_RCCS})
224

225
226
IF (NOGUI)
ELSE (NOGUI)
227
228
229
230

	# this will run uic on .ui files:
	QT4_WRAP_UI( GUI_UI_HDRS ${GUI_UIS} )

231
232
233
234
235
236
237
238
239
240
241
242
243
244
	QT4_WRAP_CPP( GUI_MOC_SRCS ${GUI_MOC_HDRS} )

	IF (NOQWT)
		INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR})
  	ELSE (NOQWT)
 		set(Qwt5_DIR ${masschroq_SOURCE_DIR}/Modules)
 		FIND_PACKAGE(Qwt5 REQUIRED)
 		# and finally this will run moc:
 		QT4_WRAP_CPP( STUDIO_MOC_SRCS ${STUDIO_MOC_HDRS} )
		# 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)
		INCLUDE_DIRECTORIES( ${CMAKE_BINARY_DIR} ${Qwt5_INCLUDE_DIR})
  	ENDIF (NOQWT)

245
246
247
  # this command will generate rules that will run rcc on all files from SAMPLE_RCS
  # in result SAMPLE_RC_SRCS variable will contain paths to files produced by rcc
  #QT4_ADD_RESOURCES( SAMPLE_RC_SRCS ${SAMPLE_RCS} )
248

249
 
250
251
ENDIF (NOGUI)

Olivier Langella's avatar
   
Olivier Langella committed
252

253
254
255
# 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)
  INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
Olivier Langella's avatar
   
Olivier Langella committed
256

257
IF (MINGW32)
258
  ADD_EXECUTABLE(masschroq main.cpp  ${MASSCHROQ_LIB_SRCS} ${MASSCHROQ_LIB_MOC_SRCS}
259
260
      ${SAXLIB_SRCS} ${OBIWARP_SRCS} ${MASSCHROQ_RCC_SRCS_QT4})
  TARGET_LINK_LIBRARIES(masschroq ${QT_LIBRARIES}  )
261
  SET_TARGET_PROPERTIES(masschroq PROPERTIES LINK_FLAGS "-Wl,--subsystem,console ${ADD_MINGW_EXE_LINKER_FLAGS}")
Olivier Langella's avatar
   
Olivier Langella committed
262

263
  IF (NOGUI)
264

265
  ELSE (NOGUI)
266

267
268
    ADD_EXECUTABLE(masschroq_gui gui/launcherGui.cpp ${GUI_SRCS} ${GUI_MOC_SRCS} ${MASSCHROQ_LIB_SRCS}  
    ${MASSCHROQ_LIB_MOC_SRCS} ${SAXLIB_SRCS} ${OBIWARP_SRCS} ${GUI_UI_HDRS} ${MASSCHROQ_RCC_SRCS_QT4})
269
    TARGET_LINK_LIBRARIES(masschroq_gui ${QT_LIBRARIES})
270
271
272
273
274
275
276
277
278
    SET_TARGET_PROPERTIES(masschroq_gui PROPERTIES LINK_FLAGS "-Wl,--subsystem,windows ${ADD_MINGW_EXE_LINKER_FLAGS}")

	IF (NOQWT)
  	ELSE (NOQWT)
  	    ADD_EXECUTABLE(masschroq_studio gui/parameterGui.cpp ${STUDIO_SRCS} ${STUDIO_MOC_SRCS} ${MASSCHROQ_LIB_SRCS}  ${MASSCHROQ_LIB_MOC_SRCS} ${SAXLIB_SRCS} ${OBIWARP_SRCS})
    	TARGET_LINK_LIBRARIES(masschroq_studio ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})
    	SET_TARGET_PROPERTIES(masschroq_studio PROPERTIES LINK_FLAGS "-Wl,--enable-auto-import  -Wl,--subsystem,windows ${ADD_MINGW_EXE_LINKER_FLAGS}")
  	ENDIF (NOQWT)

279
 ENDIF (NOGUI)
280

281
ELSE (MINGW32)
282

283
  ADD_LIBRARY(${MASSCHROQ_LIB_NAME} SHARED ${MASSCHROQ_LIB_SRCS}  ${MASSCHROQ_LIB_MOC_SRCS}
284
    ${SAXLIB_SRCS} ${OBIWARP_SRCS} ${MASSCHROQ_RCC_SRCS_QT4})
285
286

  SET_TARGET_PROPERTIES(${MASSCHROQ_LIB_NAME} PROPERTIES
Edlira Nano's avatar
Edlira Nano committed
287
288
289
    VERSION ${MASSCHROQ_LIB_VERSION}
    SOVERSION ${MASSCHROQ_LIB_SOVERSION}
    )
290

Olivier Langella's avatar
Olivier Langella committed
291
  ADD_EXECUTABLE(masschroq_main main.cpp)
Olivier Langella's avatar
Olivier Langella committed
292
  TARGET_LINK_LIBRARIES(masschroq_main ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${PAPPSOMSPP_QT4_LIBRARY} ${ODSSTREAM_QT4_LIBRARY})
Edlira Nano's avatar
Edlira Nano committed
293
  SET_TARGET_PROPERTIES(masschroq_main PROPERTIES OUTPUT_NAME masschroq)
294
295
296
  #add new executable called new_parseur
  #ADD_EXECUTABLE(new_parseur parseur.cpp)
  #TARGET_LINK_LIBRARIES(new_parseur ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES})
Olivier Langella's avatar
   
Olivier Langella committed
297

298
  INSTALL(TARGETS ${MASSCHROQ_LIB_NAME}  DESTINATION lib)
299
300
301
302

  IF (NOGUI)
  ELSE (NOGUI)

303

Olivier Langella's avatar
Olivier Langella committed
304
    ADD_EXECUTABLE(masschroq_gui gui/launcherGui.cpp ${GUI_SRCS} ${GUI_MOC_SRCS} ${GUI_UI_HDRS})
Olivier Langella's avatar
Olivier Langella committed
305
    TARGET_LINK_LIBRARIES(masschroq_gui ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY}  ${PAPPSOMSPP_QT4_LIBRARY} ${ODSSTREAM_QT4_LIBRARY})
306
307
308

    IF (NOQWT)
  	ELSE (NOQWT)
Olivier Langella's avatar
Olivier Langella committed
309
		ADD_EXECUTABLE(masschroq_studio gui/parameterGui.cpp ${STUDIO_SRCS} ${STUDIO_MOC_SRCS})
Olivier Langella's avatar
Olivier Langella committed
310
		TARGET_LINK_LIBRARIES(masschroq_studio ${MASSCHROQ_LIB_NAME} ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY}  ${PAPPSOMSPP_QT4_LIBRARY} ${ODSSTREAM_QT4_LIBRARY})
311
312
 	ENDIF (NOQWT)

313
  ENDIF (NOGUI)
314
ENDIF(MINGW32)
Edlira Nano's avatar
Edlira Nano committed
315

Edlira Nano's avatar
Edlira Nano committed
316
#if lib quanti is graphical
Olivier Langella's avatar
   
Olivier Langella committed
317
#TARGET_LINK_LIBRARIES(masschroq libmasschroq ${QT_LIBRARIES} ${Qwt5_Qt4_LIBRARY})