Initial commit. Travis, dune and cmake support.

This commit is contained in:
Jørgen Kvalsvik
2016-02-22 16:03:25 +01:00
commit 0881fece8b
8 changed files with 104 additions and 0 deletions

33
.travis.yml Normal file
View File

@@ -0,0 +1,33 @@
language: cpp
compiler:
- gcc
addons:
apt:
sources:
- boost-latest
- ubuntu-toolchain-r-test
packages:
- libboost1.55-all-dev
- gcc-4.8
- g++-4.8
- gfortran-4.8
- liblapack-dev
- libgmp3-dev
- libsuitesparse-dev
- libeigen3-dev
install:
- export CXX="g++-4.8" CC="gcc-4.8" FC="gfortran-4.8"
- cd ..
- git clone https://github.com/OPM/opm-common.git
- git clone https://github.com/OPM/opm-parser.git
- opm-parser/travis/clone-and-build-ert.sh
- opm-common/travis/build-opm-common.sh
- opm-parser/travis/build-opm-parser.sh
script: opm-output/travis/build-and-test-opm-core.sh

View File

@@ -0,0 +1,29 @@
#
# Module to check whether the file system is case sensitive or not
#
# Sets the following variable:
#
# HAVE_CASE_SENSITIVE_FILESYSTEM True if the file system honors the case of files
message(STATUS "Checking whether the file system is case-sensitive")
# create a file containing uppercase characters
file(WRITE "${CMAKE_BINARY_DIR}/UPPER" "Foo")
# check if the all-lowercase file with the same name can be opened
set(FooContents "")
if (EXISTS "${CMAKE_BINARY_DIR}/upper")
file(READ "${CMAKE_BINARY_DIR}/upper" FooContents)
endif()
# remove the file again in order not to have it dangling around...
file(REMOVE "${CMAKE_BINARY_DIR}/UPPER")
# check the contents of the file opened with lower-case. If it is
# empty, the file system is case sensitive.
if ("${FooContents}" STREQUAL "Foo")
message(STATUS "File system is not case-sensitive")
set(HAVE_CASE_SENSITIVE_FILESYSTEM 0)
else()
message(STATUS "File system is case-sensitive")
set(HAVE_CASE_SENSITIVE_FILESYSTEM 1)
endif()

View File

@@ -0,0 +1,8 @@
function ( install_headers header-list prefix )
foreach (header ${header-list})
set( abs_path "${CMAKE_CURRENT_SOURCE_DIR}/${header}")
get_filename_component( path ${abs_path} PATH )
file( RELATIVE_PATH rel_path "${PROJECT_SOURCE_DIR}" "${path}")
install ( FILES ${header} DESTINATION ${prefix}/include/${rel_path} )
endforeach()
endfunction()

16
opm/output/CMakeLists.txt Normal file
View File

@@ -0,0 +1,16 @@
set( SOURCE_FILES
Output.cpp
)
set( HEADER_FILES
Output.hpp
)
add_library(opmoutput ${SOURCE_FILES})
target_link_libraries(opmoutput ${ERT_LIBRARIES})
set_target_properties(opmoutput PROPERTIES VERSION ${opm-output_VERSION_MAJOR}.${opm-output_VERSION_MINOR}
SOVERSION ${opm-output_VERSION_MAJOR})
include(${PROJECT_SOURCE_DIR}/cmake/Modules/install_headers.cmake)
install_headers("${HEADER_FILES}" "${CMAKE_INSTALL_PREFIX}")
install(TARGETS opmoutput DESTINATION ${CMAKE_INSTALL_LIBDIR})

0
opm/output/Output.cpp Normal file
View File

0
opm/output/Output.hpp Normal file
View File

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -e
pushd . > /dev/null
opm-output/travis/build-opmoutput-
cd opm-core/build
ctest --output-on-failure
popd > /dev/null

10
travis/build-opm-output.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -e
pushd . > /dev/null
cd opm-output
mkdir build
cd build
cmake ../
make
popd > /dev/null