Skip to content

Commit 0bfc93f

Browse files
author
Julianus Pfeuffer
committed
Addressed comments and try sth else for cmake on travis.
1 parent 40070ad commit 0bfc93f

File tree

7 files changed

+59
-31
lines changed

7 files changed

+59
-31
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ addons:
88
sources:
99
- ubuntu-toolchain-r-test
1010
- boost-latest
11+
- george-edison55-precise-backports
1112
packages:
13+
- cmake
14+
- cmake-data
1215
- g++-4.8
1316
- libboost-chrono1.55-dev
1417
- libboost-date-time1.55-dev

cmake/setup_lib_find_paths.cmake

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,17 @@
3939
#------------------------------------------------------------------------------
4040

4141
#------------------------------------------------------------------------------
42-
# emit warning if CMAKE_FIND_ROOT_PATH is used instead of CMAKE_PREFIX_PATH
43-
if(NOT "${CMAKE_FIND_ROOT_PATH}" STREQUAL "" AND "${CMAKE_PREFIX_PATH}" STREQUAL "")
44-
set(CMAKE_PREFIX_PATH "${CMAKE_FIND_ROOT_PATH}")
45-
message(STATUS "Please use CMAKE_PREFIX_PATH instead of CMAKE_FIND_ROOT_PATH ")
42+
# Specify the path to the contrib-build. Will be added to CMAKE_PREFIX_PATH
43+
# for searching and as first entry in the includes/libraries to avoid
44+
# mismatches with installed system libraries
45+
if(NOT OPENMS_CONTRIB_LIBS)
46+
message(WARNING "Unless you are certain that you have all contributing libraries in system paths, please specify an explicit path to the built contrib libraries via
47+
-DOPENMS_CONTRIB_LIBS")
48+
else()
49+
list(INSERT CMAKE_PREFIX_PATH 0 ${OPENMS_CONTRIB_LIBS})
50+
list(REMOVE_DUPLICATES CMAKE_PREFIX_PATH)
4651
endif()
4752

48-
#------------------------------------------------------------------------------
49-
# add contrib location of source package <source>/contrib
50-
list(APPEND CMAKE_PREFIX_PATH ${OPENMS_HOST_DIRECTORY}/contrib/)
51-
5253
#------------------------------------------------------------------------------
5354
# Ensure Qt includes it's libs as SYSTEM
5455
set(QT_INCLUDE_DIRS_NO_SYSTEM Off)

doc/doxygen/install/install-linux.doxygen

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@
189189
<tt>HAS_XSERVER=Off</tt>, especially as you may not have compiled Qt with
190190
OpenGL and you may not have an X server.
191191
If you want to use your own qt installation, be sure to set the <tt>QT_QMAKE_EXECUTABLE=/path/to/qmake</tt> flag when using cmake to configure %OpenMS.
192-
Finally, you may have to remove any system libraries from the <tt>CMAKE_PREFIX_PATH</tt> to ensure that the correct version of each library is used.
193192

194193
@section install_linux_openms Configuring and building OpenMS/TOPP
195194

@@ -216,9 +215,15 @@
216215
<tt>/usr;/usr/local</tt> part of the path:
217216

218217
\code
219-
cmake -DCMAKE_PREFIX_PATH="/PATH/TO/contrib-build;/usr;/usr/local" -DBOOST_USE_STATIC=OFF ../OpenMS
218+
cmake -DOPENMS_CONTRIB_LIBS="/PATH/TO/contrib-build" -DBOOST_USE_STATIC=OFF ../OpenMS
220219
\endcode
221220

221+
If CMake has problems finding system libraries, you might consider adding:
222+
\code
223+
-DCMAKE_PREFIX_PATH="/usr;/usr/local"
224+
\endcode
225+
to the CMake options.
226+
222227
In order to <i>build</i> the %OpenMS library, the TOPP tools, tests, and this
223228
documentation, execute the following command:
224229

@@ -304,14 +309,18 @@
304309
<BR>
305310
<b>Note:</b> Moving these directories after installing is not supported.
306311

307-
<b>For development, install prefixes are not supported. In this case %OpenMS must
308-
be built in place!</b>
312+
<b>For development, install prefixes are not supported. In this case %OpenMS must
313+
be built in place!</b>
309314
</td>
310315
</tr>
316+
<tr>
317+
<td valign="top">\c OPENMS_CONTRIB_LIBS</td>
318+
<td>Seperate search path for the contrib libraries from github.com/OpenMS/contrib that is internally considered before
319+
CMAKE_PREFIX_PATH for searching, linking and adding include directories.</td>
320+
</tr>
311321
<tr>
312322
<td valign="top">\c CMAKE_PREFIX_PATH</td>
313-
<td>Additional search path for the contrib libraries.
314-
If not set the location is assumed to be <pre>contrib/</pre> as packaged in the Release tar.gz.</td>
323+
<td>Additional search path for the contrib libraries.</td>
315324
</tr>
316325
<tr>
317326
<td valign="top">\c QT_QMAKE_EXECUTABLE</td>

doc/doxygen/install/install-macs.doxygen

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186

187187
\code
188188
cd <path_to_OpenMS_build>
189-
cmake -DCMAKE_PREFIX_PATH=<path_to_contrib_build> <path_to_OpenMS>
189+
cmake -DOPENMS_CONTRIB_LIBS=<path_to_contrib_build> <path_to_OpenMS>
190190
\endcode
191191

192192
You can set CMake variables using the <code>-DVARIABLE=VALUE</code> option.
@@ -204,20 +204,34 @@
204204
The most important CMake variables are:
205205

206206
<table style="border-style:solid; border-collapse:collapse; border-color:#c0c0c0;">
207+
<tr>
208+
<td valign="top">\c CMAKE_INSTALL_PREFIX</td>
209+
<td>the path where the bin/ and lib/ directories should be installed to
210+
(when <pre>sudo make install</pre> is wished for a system-wide
211+
install: e.g. -DCMAKE_INSTALL_PREFIX=/usr/local/)
212+
<BR>
213+
<b>Note:</b> Moving these directories after installing is not supported.
214+
215+
<b>For development, install prefixes are not supported. In this case %OpenMS must
216+
be built in place!</b>
217+
</td>
218+
</tr>
219+
<tr>
220+
<td valign="top">\c OPENMS_CONTRIB_LIBS</td>
221+
<td>Seperate search path for the contrib libraries from github.com/OpenMS/contrib that is internally considered before
222+
CMAKE_PREFIX_PATH for searching, linking and adding include directories.</td>
223+
</tr>
207224
<tr>
208225
<td valign="top">\c CMAKE_PREFIX_PATH</td>
209226
<td>Additional search path for the contrib libraries.
210-
If not set the the location is assumed to be
211-
<tt>&lt;path_to_OpenMS&gt;/contrib</tt>.
212227
If you want to use libraries installed via Homebrew or MacPorts you might
213228
need to provide the corresponding paths
214229

215230
<code>-DCMAKE_PREFIX_PATH=/usr/local/Cellar</code> for Homebrew
216231
<code>-DCMAKE_PREFIX_PATH=/opt/local</code> for MacPorts
217232

218233
Please keep in mind that both Homebrew and MacPorts do not provide all libraries so
219-
you also need to specify the path to your self-build contrib.
220-
<code>-DCMAKE_PREFIX_PATH="/opt/local;~/openms-development/contrib-build"</code>
234+
you also need to specify the path to your self-build contrib via -DOPENMS_CONTRIB_LIBS
221235
</td>
222236
</tr>
223237
<tr>

doc/doxygen/install/install-win.doxygen

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
otherwise VS might crash during the compilation of the contrib package.
3939
<br><b>Not supported are MinGW (g++ based compiler) and VS2003 (and earlier). Do not use a MinGW-enabled shell since CMake will get confused!</b>
4040
Other compilers which are close to the VS toolchain might work, but are not tested.
41-
<li>Have CMake 2.8.10 or greater installed (see http://www.cmake.org).<br>
41+
<li>Have CMake 3.0.2 or greater installed (see http://www.cmake.org).<br>
4242
CMake's Generator (-G flag) must support your version of Visual Studio.<br>
4343
[VS2012 requires CMake 2.8.10 or later, VS2013 needs CMake 2.8.11.2, etc...]
4444
<li>To extract archives within submodules of the contrib you will need <tt>7-Zip</tt> (see http://www.7-zip.org/)
@@ -217,15 +217,15 @@
217217
<li>Call CMake to create the build system
218218
\code
219219
cd <path_to_OpenMS_build>
220-
cmake -D CMAKE_PREFIX_PATH="<path_to_contrib_build>" -G "<generator>" "<path_to_OpenMS>"
220+
cmake -D OPENMS_CONTRIB_LIBS="<path_to_contrib_build>" -G "<generator>" "<path_to_OpenMS>"
221221
\endcode
222222

223223
The choice of <tt>&lt;generator&gt;</tt> is dependent on your system. Type <tt>cmake</tt> to see a list of available generators.
224224
@note We strongly recommend the Visual Studio Generator and it should be identical to the one used for building the contrib. Other generators (such as nmake) are not tested! If you need compiling on the command line, you can use <tt>msbuild</tt> also on VS solution files!
225225
Example:
226226
\code
227227
cd c:\dev\OpenMS_Win64
228-
cmake -D CMAKE_PREFIX_PATH="C:\dev\contrib_win64_build" -G "Visual Studio 9 2008 Win64" ..\OpenMS
228+
cmake -D OPENMS_CONTRIB_LIBS="C:\dev\contrib_win64_build" -G "Visual Studio 9 2008 Win64" ..\OpenMS
229229
\endcode
230230
</ol>
231231

src/openms/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,22 @@ if (WITH_CRAWDAD)
108108
list(APPEND OPENMS_DEP_LIBRARIES ${Crawdad_LIBRARY})
109109
endif()
110110

111+
list(REMOVE_DUPLICATES OPENMS_DEP_LIBRARIES)
112+
113+
set (OPENMS_CONTRIB_INCLUDE_DIRS "")
114+
if (OPENMS_CONTRIB_LIBS)
115+
set (OPENMS_CONTRIB_INCLUDE_DIRS ${OPENMS_CONTRIB_LIBS}/include)
116+
endif()
117+
111118
openms_add_library(TARGET_NAME OpenMS
112119
SOURCE_FILES ${OpenMS_sources}
113120
HEADER_FILES ${OpenMS_sources_h}
114121
${OpenMS_configured_headers}
115122
INTERNAL_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/include
116123
${CMAKE_CURRENT_BINARY_DIR}/include
117-
PRIVATE_INCLUDES ${EOL_BSPLINE_INCLUDE_DIRECTORY}
118-
EXTERNAL_INCLUDES ${QT_INCLUDES}
119-
${GSL_INCLUDE_DIRS}
124+
PRIVATE_INCLUDES ${EOL_BSPLINE_INCLUDE_DIRECTORY}
125+
EXTERNAL_INCLUDES ${OPENMS_CONTRIB_INCLUDE_DIRS}
126+
${QT_INCLUDES}
120127
${Boost_INCLUDE_DIRS}
121128
${SEQAN_INCLUDE_DIRS}
122129
${SQLITE_INCLUDE_DIR}

tools/travis/lnx-cibuild.before.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#!/bin/bash
22

3-
mkdir cmake_tmp
4-
cd cmake_tmp
5-
wget --no-check-certificate https://cmake.org/files/v3.0/cmake-3.0.2-Linux-i386.tar.gz
6-
tar xf cmake-3.0.2-Linux-i386.tar.gz
7-
sudo cp -r cmake-3.0.2-Linux-i386/* /usr
8-
93
function build_contrib {
104
cmake . -DBUILD_TYPE=$1
115

0 commit comments

Comments
 (0)