Skip to content

Commit

Permalink
BUILD: Add Travis-CI metadata, also detect C++11 compiler flags to wo…
Browse files Browse the repository at this point in the history
…rk with gcc-4.6.
  • Loading branch information
berenm committed Dec 4, 2012
1 parent d27f667 commit 9f09591
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
!.cproject
!.project
!.dep.inc
!.travis.yml
build
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: cpp
script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TESTS=1 ..
- make
- make test
compiler:
- clang
- gcc
before_install:
- sudo apt-get update
- sudo apt-get install libboost1.48-all-dev
12 changes: 11 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(GNUInstallDirs)
include(ParseVersion)
include(AddSubmodule)
include(CheckCXXCompilerFlag)

project(libtenum CXX)
parse_version(libtenum VERSION 0.9.5)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

check_cxx_compiler_flag("-std=c++11" TENUM_COMPILER_KNOWS_CXX11)
if(TENUM_COMPILER_KNOWS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
check_cxx_compiler_flag("-std=c++0x" TENUM_COMPILER_KNOWS_CXX0X)
if(TENUM_COMPILER_KNOWS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif()
endif()

find_package(Boost COMPONENTS unit_test_framework test_exec_monitor REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
Expand Down

0 comments on commit 9f09591

Please sign in to comment.