CMake project restructuring.

This commit is contained in:
Patrick Lühne 2016-11-29 02:43:17 +01:00
parent 8b069d8149
commit 9b49b8ebe7
Signed by: patrick
GPG Key ID: 05F3611E97A70ABF
5 changed files with 19 additions and 13 deletions

View File

@ -34,9 +34,13 @@ matrix:
- *default_packages
- g++-6
script:
- git submodule init
- git submodule update
- mkdir build
- cd build
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON -DCMAKE_CXX_COMPILER=$_CXX
- make -j3 && make -j3 run-tests
- if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.7/cmake-3.7.0-Linux-x86_64.tar.gz";
mkdir cmake-bin && wget --quiet --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake-bin;
export PATH=${PWD}/cmake-bin/bin:${PATH};
fi
- git submodule update --recursive --init
- mkdir -p build/debug
- cd build/debug
- cmake ../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=$_CXX -DPLASP_BUILD_TESTS=ON
- make -j3 plasp-app && make -j3 run-tests

View File

@ -1,20 +1,23 @@
cmake_minimum_required(VERSION 2.6)
project(plasp CXX)
option(BUILD_TESTS "Build unit tests" OFF)
option(PLASP_BUILD_TESTS "Build unit tests" OFF)
find_package(Boost 1.55.0 COMPONENTS program_options iostreams system filesystem REQUIRED)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
add_definitions(-std=c++14)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
add_subdirectory(src)
add_subdirectory(apps)
if(BUILD_TESTS)
add_subdirectory(app)
if(PLASP_BUILD_TESTS)
add_subdirectory(tests)
endif(BUILD_TESTS)
endif(PLASP_BUILD_TESTS)

View File

@ -1,4 +1,4 @@
set(target plasp_app)
set(target plasp-app)
file(GLOB core_sources "*.cpp")
file(GLOB core_headers "*.h")

View File

@ -1 +0,0 @@
add_subdirectory(plasp-app)