From 3b6dcc34bb07ec6149e27bee9bab8621d8fd577f Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Mon, 31 Aug 2015 11:52:52 +0200 Subject: [PATCH] Add Travis script --- .travis.yml | 24 ++++++++++++++++++++++++ CMakeLists.txt | 9 +++++++-- README.md | 2 ++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..efa2bde --- /dev/null +++ b/.travis.yml @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fa13a3..1c7a67c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -145,10 +145,15 @@ SET ( NLOPT_SOURCES OPTION(BUILD_SHARED_LIBS "Build NLOPT as a shared library" OFF ) -IF(BUILD_SHARED_LIBS) +if (BUILD_SHARED_LIBS) ADD_DEFINITIONS(-DNLOPT_DLL) ADD_DEFINITIONS(-DNLOPT_DLL_EXPORT ) -ENDIF(BUILD_SHARED_LIBS) + + if (NOT CMAKE_INSTALL_PREFIX MATCHES "^/usr") + set (CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) + set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + endif () +endif () INSTALL ( FILES ${NLOPT_HEADERS} DESTINATION include ) diff --git a/README.md b/README.md index 922be16..a8c34af 100644 --- 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 -- 2.30.2