CMakeLists.txt 9.37 KB
Newer Older
1

2
# cmake helps to compile "masschroq"
3
4
5
6
7
# please install the cmake package depending on your linux distribution
# and type in the beads root directory :
# cmake .
# make
# make install
8
cmake_minimum_required(VERSION 2.6)
Olivier Langella's avatar
   
Olivier Langella committed
9

10
11
12
# The name of this project is "masschroq". CMakeLists files in this project can
# refer to the root source directory of the project as ${masschroq_SOURCE_DIR}
# and to the root binary directory of the project as ${masschroq_BINARY_DIR}.
Olivier Langella's avatar
   
Olivier Langella committed
13

14
PROJECT(masschroq CXX C)
Olivier Langella's avatar
   
Olivier Langella committed
15

16
17
18


#depending on libpappsomspp version :
Olivier Langella's avatar
Olivier Langella committed
19
SET(LIBPAPPSOMSPP_VERSION "0.2.36-1")
20
21
configure_file (${CMAKE_SOURCE_DIR}/debian/control.cmake ${CMAKE_SOURCE_DIR}/debian/control  @ONLY)

Edlira Nano's avatar
Edlira Nano committed
22
# Project version
23
#
Edlira Nano's avatar
Edlira Nano committed
24

Edlira Nano's avatar
Edlira Nano committed
25
SET (MASSCHROQ_MAJOR_VERSION 2)
26
SET (MASSCHROQ_MINOR_VERSION 2)
Olivier Langella's avatar
Olivier Langella committed
27
SET (MASSCHROQ_PATCH_LEVEL   2)
Edlira Nano's avatar
Edlira Nano committed
28
29
30
SET (MASSCHROQ_VERSION
  "${MASSCHROQ_MAJOR_VERSION}.${MASSCHROQ_MINOR_VERSION}.${MASSCHROQ_PATCH_LEVEL}")
SET (MASSCHROQ_LIB_NAME "masschroq")
31
32
SET (MASSCHROQ_LIB_VERSION ${MASSCHROQ_VERSION})
SET (MASSCHROQ_LIB_SOVERSION ${MASSCHROQ_MAJOR_VERSION})
Edlira Nano's avatar
Edlira Nano committed
33

34
SET (MASSCHROQ_SCHEMA_VERSION "${MASSCHROQ_MAJOR_VERSION}.2")
35
#SET (masschroq_BINARY_DIR "bin")
Edlira Nano's avatar
Edlira Nano committed
36
37
38

#SET (CMAKE_INSTALL_SO_NO_EXE "0")

39
40
#IF (MINGW32)
#ELSE (MINGW32)
41
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
42
#ENDIF(MINGW32)
43

44

45
46
47
48
49
IF (CMAKE_SYSTEM_NAME MATCHES "Windows")
  SET( WIN32 1)
ELSE (CMAKE_SYSTEM_NAME MATCHES "Windows")
  SET( WIN32 0)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Windows")
50

Olivier Langella's avatar
   
Olivier Langella committed
51
52
53
54
55
56
57
58
59
60
# cross compilation Win32 :
#cd build_win32
#export CC=/usr/bin/i586-mingw32msvc-gcc
#export CXX=/usr/bin/i586-mingw32msvc-g++
#INCLUDE(${populations_SOURCE_DIR}/win32/Toolchain-mingw32.cmake)
#cmake -DCMAKE_TOOLCHAIN_FILE=../win32/Toolchain-mingw32.cmake ..
#SET( QT_QMAKE_EXECUTABLE "C:/Qt/4.4.3/qmake/qmake.exe")
#SET ( QTDIR "C:/Qt/4.4.3/")
#SET ( CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "C:/Qt/4.4.3/qmake/lib" "C:/Qt/4.4.3/qmake/" "C:/Qt/4.4.3/")
#SET ( CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "C:/Qt/4.4.3/include")
Olivier Langella's avatar
   
Olivier Langella committed
61
#IF (MINGW32)
Olivier Langella's avatar
   
Olivier Langella committed
62
#	LINK_LIBRARIES(${QTDIR}/lib/libqtcore4.a)
Olivier Langella's avatar
   
Olivier Langella committed
63
#	ADD_LIBRARY(${QTDIR}/lib/libqtcore4.a STATIC)
Olivier Langella's avatar
   
Olivier Langella committed
64
65
#ELSE (MINGW32)
#ENDIF(MINGW32)
Olivier Langella's avatar
   
Olivier Langella committed
66

Edlira Nano's avatar
Edlira Nano committed
67
68
69
70
71

if (NOT CMAKE_INSTALL_PREFIX)
  SET (CMAKE_INSTALL_PREFIX /usr/local)
endif (NOT CMAKE_INSTALL_PREFIX)

Olivier Langella's avatar
Olivier Langella committed
72

73
if (NOT CMAKE_BUILD_TYPE)
74
#SET(CMAKE_BUILD_TYPE "Release")
Edlira Nano's avatar
Edlira Nano committed
75
#SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
76
SET( CMAKE_BUILD_TYPE "Debug")
77
78
endif (NOT CMAKE_BUILD_TYPE)
MESSAGE("CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}")
Edlira Nano's avatar
Edlira Nano committed
79

80
81
82
IF(CMAKE_BUILD_TYPE MATCHES "Release")
  MESSAGE("compiling as release version")
  ADD_DEFINITIONS("-DQT_NO_DEBUG_OUTPUT")
83
84
85
ENDIF( CMAKE_BUILD_TYPE MATCHES "Release" )

IF(CMAKE_BUILD_TYPE MATCHES "Debug")
86
  MESSAGE("compiling as debug version")
Olivier Langella's avatar
Olivier Langella committed
87
ENDIF( CMAKE_BUILD_TYPE MATCHES "Debug" )
Olivier Langella's avatar
   
Olivier Langella committed
88

89
90
91
IF(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
  MESSAGE("compiling as release with debug info version")
ENDIF( CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
92

Edlira Nano's avatar
Edlira Nano committed
93

Olivier Langella's avatar
   
Olivier Langella committed
94
IF (WIN32)
95
  SET(MASSCHROQ_ICON "masschroq.ico")
Edlira Nano's avatar
Edlira Nano committed
96
  #SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
Edlira Nano's avatar
Edlira Nano committed
97
ELSE (WIN32)
Edlira Nano's avatar
Edlira Nano committed
98
99
100
  SET(CMAKE_CXX_FLAGS_DEBUG "-O3 -g -Wall")
  SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -Wall")
  SET (CMAKE_CXX_FLAGS_RELEASE  "-s ${CMAKE_CXX_FLAGS_RELEASE}")
101
  SET(MASSCHROQ_ICON "${CMAKE_INSTALL_PREFIX}/share/masschroq/masschroq.svg")
Edlira Nano's avatar
Edlira Nano committed
102
ENDIF (WIN32)
Edlira Nano's avatar
Edlira Nano committed
103

104

Olivier Langella's avatar
   
Olivier Langella committed
105
106
107
SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
SET(CPACK_GENERATOR "STGZ;TGZ;TZ")
SET(CPACK_OUTPUT_CONFIG_FILE "./CPackConfig.cmake")
Edlira Nano's avatar
Edlira Nano committed
108
#SET(CPACK_PACKAGE_DESCRIPTION_FILE ${masschroq_SOURCE_DIR}/COPYING)
109
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MassChroQ : Mass Chromatogram Quantification")
110
SET(CPACK_PACKAGE_EXECUTABLES "masschroq")
111
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "masschroq-${MASSCHROQ_VERSION}")
Edlira Nano's avatar
Edlira Nano committed
112
113
SET(CPACK_SYSTEM_NAME "Linux-i686")
SET(CPACK_PACKAGE_FILE_NAME "masschroq-${MASSCHROQ_VERSION}-${CPACK_SYSTEM_NAME}")
114
115
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "masschroq ${MASSCHROQ_VERSION}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "masschroq ${MASSCHROQ_VERSION}")
116
SET(CPACK_PACKAGE_NAME "masschroq")
Edlira Nano's avatar
Edlira Nano committed
117
SET(CPACK_PACKAGE_VENDOR "PAPPSO")
118
SET(CPACK_PACKAGE_VERSION ${MASSCHROQ_VERSION})
Edlira Nano's avatar
Edlira Nano committed
119
SET(CPACK_RESOURCE_FILE_LICENSE ${masschroq_SOURCE_DIR}/debian/copyright)
Edlira Nano's avatar
Edlira Nano committed
120
SET(CPACK_RESOURCE_FILE_README ${masschroq_SOURCE_DIR}/README)
Edlira Nano's avatar
Edlira Nano committed
121
SET(CPACK_RESOURCE_FILE_WELCOME ${masschroq_SOURCE_DIR}/README)
Olivier Langella's avatar
   
Olivier Langella committed
122
123
124
125
126
SET(CPACK_SOURCE_GENERATOR "TGZ;TZ")
SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "./CPackSourceConfig.cmake")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_SYSTEM_NAME "Linux-i686")
SET(CPACK_TOPLEVEL_TAG "Linux-i686")
Edlira Nano's avatar
Edlira Nano committed
127
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "masschroq-${MASSCHROQ_VERSION}")
Olivier Langella's avatar
   
Olivier Langella committed
128
129


130
SET(CPACK_SOURCE_IGNORE_FILES
Olivier Langella's avatar
Olivier Langella committed
131
  ".*\\\\.tar\\\\.gz"
132
  "moc_.*cxx"
Edlira Nano's avatar
Edlira Nano committed
133
  "\\\\.#.*"
134
135
136
137
138
139
  ".*\\\\.aux"
  ".*\\\\.bbl"
  ".*\\\\.blg"
  ".*\\\\.log"
  ".*\\\\.out"
  ".*\\\\.toc"
Olivier Langella's avatar
Olivier Langella committed
140
  "/.kdev4/"
141
  "/devel_archives/"
142
143
  "/doc\\\\/misc/"
  "/doc\\\\/slides/"
144
  "/doc\\\\/examples/"
145
   "/figures/"
146
147
148
149
150
151
152
153
154
155
156
157
  "/Soumis/"
  "Makefile"
  "install_manifest.txt"
  "CMakeCache.txt"
  "CPackConfig.cmake"
  "CPackSourceConfig.cmake"
  "/CMakeFiles/"
  "/_CPack_Packages/"
  "/Debug/"
  "/Release/"
  "/tests/"
  "/\\\\.externalToolBuilders/"
Olivier Langella's avatar
Olivier Langella committed
158
  "/\\\\.git/"
159
160
161
162
163
  "/\\\\.settings/"
  "Makefile"
  "\\\\.cdtbuild"
  "\\\\.cdtproject"
  "\\\\.project"
164
  "\\\\.cproject"
165
  "/win32/"
166
  "/win64/"
167
168
  "/build/"
  "/buildmingw/"
169
  "masschroq$"
170
  "libmasschroq.so"
171
172
173
174
  "mzxml2lmat$"
  "align_mzxml$"
  "viewxic$"
  "xicextractor$"
Olivier Langella's avatar
Olivier Langella committed
175
176
177
178
  ".gitignore"
  ".*~"
  "masschroq_manual.pdf"
  "masschroq_manual.tex.backup"
Olivier Langella's avatar
Olivier Langella committed
179
180
181
182
  ".*masschroqML"
  "/time/"
  "/buildwin32/"
  "/buildwin64/"
183
  )
Edlira Nano's avatar
Edlira Nano committed
184
# to create a TGZ archive of the  source code type shell command
185
# cpack -G TGZ --config CPackSourceConfig.cmake
Edlira Nano's avatar
Edlira Nano committed
186

187
# dpkg-buildpackage -rfakeroot -k7BEF3B25
Olivier Langella's avatar
   
Olivier Langella committed
188

Olivier Langella's avatar
   
Olivier Langella committed
189
190
191
192
193
194
195
196
197
198
199
#.dput.cf
#[olivier-langella]
#fqdn = ppa.launchpad.net
#method = ftp
#incoming = ~olivier-langella/ubuntu/
#login = olivier-langella
#allow_unsigned_uploads = 0
#
#  debuild -S -sa
# dput -f olivier-langella *changes

Olivier Langella's avatar
   
Olivier Langella committed
200

201
202
203
204
205
206
207
208
#dch -Dwheezy "message"
#cmake ..
#make deb
# scp masschroq* proteus:/var/www/apt/incoming
# reprepro -Vb /var/www/apt processincoming default



Olivier Langella's avatar
Olivier Langella committed
209
MESSAGE("configuring file ${masschroq_SOURCE_DIR}/src/config.h.cmake")
210

Olivier Langella's avatar
Olivier Langella committed
211
configure_file (${masschroq_SOURCE_DIR}/src/config.h.cmake ${masschroq_SOURCE_DIR}/src/config.h)
212
213
configure_file (${CMAKE_SOURCE_DIR}/doc/scripts/masschroq-condor.pl.cmake ${CMAKE_BINARY_DIR}/src/masschroq-condor.pl @ONLY)
configure_file (${CMAKE_SOURCE_DIR}/doc/scripts/masschroq-split.py.cmake ${CMAKE_BINARY_DIR}/src/masschroq-split.py)
Olivier Langella's avatar
   
Olivier Langella committed
214

215

Olivier Langella's avatar
Olivier Langella committed
216

217
SET(CPACK_PACKAGE_EXECUTABLES "masschroq" "masschroq")
Olivier Langella's avatar
   
Olivier Langella committed
218
219
220
221


INCLUDE(CPack)

222
# Recurse into the "src" subdirectories.  This does not actually
Olivier Langella's avatar
   
Olivier Langella committed
223
224
# cause another cmake executable to run.  The same process will walk through
# the project's entire directory structure.
225
226
#MESSAGE("configuring debian/masschroq-common.install")
#configure_file (${masschroq_SOURCE_DIR}/templates/debian/masschroq-common.install.cmake ${masschroq_SOURCE_DIR}/debian/masschroq-common.install)
Olivier Langella's avatar
Olivier Langella committed
227
228
229
230
231
MESSAGE("configuring masschroq-gui.desktop")
configure_file (${masschroq_SOURCE_DIR}/templates/share/applications/masschroq-gui.desktop.cmake ${masschroq_SOURCE_DIR}/templates/share/applications/masschroq-gui.desktop)
MESSAGE("configuring masschroq-studio.desktop")
configure_file (${masschroq_SOURCE_DIR}/templates/share/applications/masschroq-studio.desktop.cmake ${masschroq_SOURCE_DIR}/templates/share/applications/masschroq-studio.desktop)

Olivier Langella's avatar
   
Olivier Langella committed
232
add_subdirectory (src)
Olivier Langella's avatar
Olivier Langella committed
233
add_subdirectory (doc)
234

235
#INSTALL library libmasschroq is in the src/CMakeLists file
236
INSTALL(PROGRAMS ${masschroq_BINARY_DIR}/src/masschroq DESTINATION bin)
237
238
239
240
241
242
243
244
245

IF (NOGUI)
ELSE (NOGUI)
  INSTALL(PROGRAMS ${masschroq_BINARY_DIR}/src/masschroq_gui DESTINATION bin)
  INSTALL(PROGRAMS ${masschroq_BINARY_DIR}/src/masschroq_studio DESTINATION bin)
  INSTALL(FILES ${masschroq_SOURCE_DIR}/templates/share/applications/masschroq-gui.desktop DESTINATION share/applications)
  INSTALL(FILES ${masschroq_SOURCE_DIR}/templates/share/applications/masschroq-studio.desktop DESTINATION share/applications)
ENDIF (NOGUI)

Olivier Langella's avatar
Olivier Langella committed
246
INSTALL(PROGRAMS ${masschroq_BINARY_DIR}/src/masschroq-condor.pl DESTINATION bin)
Olivier Langella's avatar
Olivier Langella committed
247
INSTALL(FILES ${masschroq_SOURCE_DIR}/doc/logo/masschroq.svg DESTINATION share/masschroq)
248
249
250
251
INSTALL(FILES ${masschroq_SOURCE_DIR}/doc/man1/masschroq.1.gz DESTINATION share/man/man1)
#INSTALL(FILES ${masschroq_SOURCE_DIR}/doc/manual/masschroq_manual.pdf DESTINATION share/doc/masschroq)
#INSTALL(FILES ${masschroq_SOURCE_DIR}/doc/debian/changelog DESTINATION share/doc/masschroq)
#INSTALL(FILES ${masschroq_SOURCE_DIR}/README DESTINATION share/doc/masschroq)
252

253
254
#to apply the ignore file svnignores.txt recursively in a directory type
#svn -R propset svn:ignore -F svnignores.txt .
255
256
257
258


#cross compilation of qwt :
# QMAKE_CXX = /usr/bin/i586-mingw32msvc-c++
259
260
261
262
263
264
265
266
267
268
269
270
# QMAKE_LINK = /usr/bin/i586-mingw32msvc-ld



add_custom_target(targz
	cpack -G TGZ --config CPackSourceConfig.cmake && tar xvfz masschroq-${MASSCHROQ_VERSION}.tar.gz
	WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
	COMMENT "Creating .tar.gz" VERBATIM
)


add_custom_target(deb
271
	cd masschroq-${MASSCHROQ_VERSION} && dpkg-buildpackage
272
273
274
	DEPENDS targz
	WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
	COMMENT "Creating Debian package" VERBATIM
275
276
277
278
279
280
281
)

add_custom_target(debtmp
	rm -rf /tmp/masschroq-${MASSCHROQ_VERSION} && cp -r masschroq-${MASSCHROQ_VERSION} /tmp && cd /tmp/masschroq-${MASSCHROQ_VERSION} && dpkg-buildpackage
	DEPENDS targz
	WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
	COMMENT "Creating Debian package" VERBATIM
282
)