chiark / gitweb /
Add Travis script
authorJulien Schueller <schueller@phimeca.com>
Mon, 31 Aug 2015 09:52:52 +0000 (11:52 +0200)
committerJulien Schueller <schueller@phimeca.com>
Wed, 2 Sep 2015 16:09:16 +0000 (18:09 +0200)
.travis.yml [new file with mode: 0644]
CMakeLists.txt
README.md

diff --git a/.travis.yml b/.travis.yml
new file mode 100644 (file)
index 0000000..efa2bde
--- /dev/null
@@ -0,0 +1,24 @@
+language: cpp
+sudo: false
+
+addons:
+  apt:
+    packages:
+    - swig
+    - python-dev
+    - python-numpy
+    - guile-2.0-dev
+    - octave3.2-headers
+    - cmake
+
+script:
+  - ./autogen.sh --no-configure
+  - mkdir build && pushd build
+  - ../configure --prefix=$HOME/.local --enable-shared --enable-maintainer-mode --enable-cxx
+  - make -j2
+  - make install
+  - python ../test/test_std.py
+  - rm -rf * ~/.local
+  - cmake -DCMAKE_INSTALL_PREFIX=~/.local -DBUILD_SHARED_LIBS=ON ..
+  - make install -j2
+  - python ../test/test_std.py
index 1fa13a32799ae31273776e0d163cc33021495de8..1c7a67c0ee39f3f9134ceae7a1fa00ccb9859ca8 100644 (file)
@@ -145,10 +145,15 @@ SET ( NLOPT_SOURCES
 \r
 OPTION(BUILD_SHARED_LIBS "Build NLOPT as a shared library" OFF )\r
 \r
-IF(BUILD_SHARED_LIBS)\r
+if (BUILD_SHARED_LIBS)\r
   ADD_DEFINITIONS(-DNLOPT_DLL)\r
   ADD_DEFINITIONS(-DNLOPT_DLL_EXPORT )\r
-ENDIF(BUILD_SHARED_LIBS)\r
+  \r
+  if (NOT CMAKE_INSTALL_PREFIX MATCHES "^/usr")\r
+    set (CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})\r
+    set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)\r
+  endif ()\r
+endif ()\r
 \r
 INSTALL ( FILES ${NLOPT_HEADERS} DESTINATION include )\r
 \r
index 922be16d26c75e00093e85d8e2267ec630fb26c9..a8c34af8cbf8e2d165f795957b636aa1dd28f589 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+[![Build Status](https://travis-ci.org/stevengj/nlopt.svg?branch=master)](https://travis-ci.org/stevengj/nlopt)
+
 NLopt is a library for nonlinear local and global optimization, for
 functions with and without gradient information.  It is designed as
 as simple, unified interface and packaging of several free/open-source