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

9
10
11
# 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
12

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

15
16
IF (CMAKE_BASE_NAME MATCHES "cl")
  SET( WIN32 "true")
17
18
ELSE (CMAKE_BASE_NAME MATCHES "cl")
  SET( WIN32 "false")
19
20
21
ENDIF(CMAKE_BASE_NAME MATCHES "cl")


Olivier Langella's avatar
   
Olivier Langella committed
22
23
24
25
26
27
28
29
30
31
# 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
32
#IF (MINGW32)
Olivier Langella's avatar
   
Olivier Langella committed
33
#	LINK_LIBRARIES(${QTDIR}/lib/libqtcore4.a)
Olivier Langella's avatar
   
Olivier Langella committed
34
#	ADD_LIBRARY(${QTDIR}/lib/libqtcore4.a STATIC)
Olivier Langella's avatar
   
Olivier Langella committed
35
36
#ELSE (MINGW32)
#ENDIF(MINGW32)
Olivier Langella's avatar
   
Olivier Langella committed
37

Edlira Nano's avatar
Edlira Nano committed
38
39
40
41
42

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

Edlira Nano's avatar
Edlira Nano committed
43
44
#SET(CMAKE_BUILD_TYPE "Release")
SET(CMAKE_BUILD_TYPE "RelWithDebInfo")
Edlira Nano's avatar
Edlira Nano committed
45
46
#SET( CMAKE_BUILD_TYPE "Release")

47
48
49
IF(CMAKE_BUILD_TYPE MATCHES "Release")
  MESSAGE("compiling as release version")
  ADD_DEFINITIONS("-DQT_NO_DEBUG_OUTPUT")
50
51
52
ENDIF( CMAKE_BUILD_TYPE MATCHES "Release" )

IF(CMAKE_BUILD_TYPE MATCHES "Debug")
53
  MESSAGE("compiling as debug version")
Olivier Langella's avatar
Olivier Langella committed
54
ENDIF( CMAKE_BUILD_TYPE MATCHES "Debug" )
Olivier Langella's avatar
   
Olivier Langella committed
55

56
57
58
IF(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
  MESSAGE("compiling as release with debug info version")
ENDIF( CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" )
59

Edlira Nano's avatar
Edlira Nano committed
60

Olivier Langella's avatar
   
Olivier Langella committed
61
IF (WIN32)
Edlira Nano's avatar
Edlira Nano committed
62
63
64
65
66

  SET(MASSCHROQ_XSD_DIR ${CMAKE_INSTALL_PREFIX})
  SET(MASSCHROQ_XSD ${MASSCHROQ_XSD_DIR}/masschroq.xsd)
  #SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
  
Edlira Nano's avatar
Edlira Nano committed
67
ELSE (WIN32)
Edlira Nano's avatar
Edlira Nano committed
68
69
70
71
72
73
  
  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}")
  SET(MASSCHROQ_XSD_DIR ${CMAKE_INSTALL_PREFIX}/share/xml/schema)
  SET(MASSCHROQ_XSD ${MASSCHROQ_XSD_DIR}/masschroq.xsd)
Olivier Langella's avatar
   
Olivier Langella committed
74

Edlira Nano's avatar
Edlira Nano committed
75
ENDIF (WIN32)
Edlira Nano's avatar
Edlira Nano committed
76

77

78
SET (MASSCHROQ_VERSION "1.0")
79
SET (MASSCHROQ_XML_VERSION "1.0")
80

Olivier Langella's avatar
   
Olivier Langella committed
81
82
83
84

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
85
#SET(CPACK_PACKAGE_DESCRIPTION_FILE ${masschroq_SOURCE_DIR}/COPYING)
86
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MassChroQ : Mass Chromatogram Quantification")
87
SET(CPACK_PACKAGE_EXECUTABLES "masschroq")
88
89
90
91
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "masschroq-${MASSCHROQ_VERSION}")
SET(CPACK_PACKAGE_FILE_NAME "masschroq-${MASSCHROQ_VERSION}-Linux-i686")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "masschroq ${MASSCHROQ_VERSION}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "masschroq ${MASSCHROQ_VERSION}")
92
SET(CPACK_PACKAGE_NAME "masschroq")
Edlira Nano's avatar
Edlira Nano committed
93
SET(CPACK_PACKAGE_VENDOR "PAPPSO")
94

95
SET(CPACK_PACKAGE_VERSION ${MASSCHROQ_VERSION})
Edlira Nano's avatar
Edlira Nano committed
96
SET(CPACK_PACKAGE_VERSION_MAJOR "1")
Olivier Langella's avatar
   
Olivier Langella committed
97
SET(CPACK_PACKAGE_VERSION_MINOR "0")
Edlira Nano's avatar
Edlira Nano committed
98
SET(CPACK_PACKAGE_VERSION_PATCH "0")
Edlira Nano's avatar
Edlira Nano committed
99
100
SET(CPACK_RESOURCE_FILE_LICENSE ${masschroq_SOURCE_DIR}/debian/copyright)
#SET(CPACK_RESOURCE_FILE_README ${masschroq_SOURCE_DIR}/README)
101
SET(CPACK_RESOURCE_FILE_WELCOME ${masschroq_SOURCE_DIR}/INSTALL)
Olivier Langella's avatar
   
Olivier Langella committed
102
103
SET(CPACK_SOURCE_GENERATOR "TGZ;TZ")
SET(CPACK_SOURCE_OUTPUT_CONFIG_FILE "./CPackSourceConfig.cmake")
Edlira Nano's avatar
Edlira Nano committed
104
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "masschroq-1.0")
Olivier Langella's avatar
   
Olivier Langella committed
105
106
107
108
109
110
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_SYSTEM_NAME "Linux-i686")
SET(CPACK_TOPLEVEL_TAG "Linux-i686")


SET(CPACK_SOURCE_IGNORE_FILES 
Olivier Langella's avatar
Olivier Langella committed
111
  ".*\\\\.tar\\\\.gz"
112
  "moc_.*cxx"
Edlira Nano's avatar
Edlira Nano committed
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
  "/devel_archives/"
  "/figures/"
  "/Soumis/"
  "Makefile"
  "install_manifest.txt"
  "cmake_install.cmake"
  "cmake_install.cmake"
  "CMakeCache.txt"
  "CPackConfig.cmake"
  "CPackSourceConfig.cmake"
  "install_manifest.txt"
  "/CMakeFiles/"
  "/_CPack_Packages/"
  "/Debug/"
  "/Release/"
  "/tests/"
  "/\\\\.externalToolBuilders/"
  "/\\\\.svn/"
  "/\\\\.settings/"
  "Makefile"
  "\\\\.cdtbuild"
  "\\\\.cdtproject"
  "\\\\.project"
  "/win32/"
  "masschroq$"
  "mzxml2lmat$"
  "align_mzxml$"
  "viewxic$"
  "xicextractor$"
  )
Edlira Nano's avatar
Edlira Nano committed
144
145
# to create a TGZ archive of the  source code type shell command
# cpack -G TGZ --config CPackSourceConfig.cmake 
Edlira Nano's avatar
Edlira Nano committed
146

Olivier Langella's avatar
   
Olivier Langella committed
147
148
# dpkg-buildpackage -rfakeroot

Olivier Langella's avatar
   
Olivier Langella committed
149
150
151
152
153
154
155
156
157
158
159
#.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
160

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

Olivier Langella's avatar
Olivier Langella committed
163
configure_file (${masschroq_SOURCE_DIR}/src/config.h.cmake ${masschroq_SOURCE_DIR}/src/config.h)
Olivier Langella's avatar
   
Olivier Langella committed
164

165

166
SET(CPACK_PACKAGE_EXECUTABLES "masschroq" "masschroq")
Olivier Langella's avatar
   
Olivier Langella committed
167
168
169
170
171


# for debian package :
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Olivier Langella <olivier.langella@moulon.inra.fr>")
SET(DEBIAN_PACKAGE_BUILDS_DEPENDS "Olivier Langella <olivier.langella@moulon.inra.fr>")
172

Olivier Langella's avatar
   
Olivier Langella committed
173
174
175

INCLUDE(CPack)

176
# Recurse into the "src" subdirectories.  This does not actually
Olivier Langella's avatar
   
Olivier Langella committed
177
178
179
# cause another cmake executable to run.  The same process will walk through
# the project's entire directory structure.
add_subdirectory (src)
180

181
182
INSTALL(PROGRAMS src/masschroq DESTINATION bin)
INSTALL(FILES doc/schema/masschroq.xsd DESTINATION share/xml/schema)
183
INSTALL(FILES doc/man1/masschroq.1.gz DESTINATION share/man/man1)
184

185
#INSTALL(PROGRAMS src/viewxic DESTINATION bin)
186
187
#INSTALL(PROGRAMS src/align_mzxml DESTINATION bin)
#INSTALL(PROGRAMS src/xicextractor DESTINATION bin)
188
189
190

#to apply the ignore file svnignores.txt recursively in a directory type
#svn -R propset svn:ignore -F svnignores.txt .