forked from boostorg/assert
Add cmake_install_test, cmake_subdir_test
This commit is contained in:
25
.travis.yml
25
.travis.yml
@@ -289,9 +289,32 @@ matrix:
|
||||
env: CMAKE=1
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 ..
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_DEBUG=1 ..
|
||||
- ctest --output-on-failure -R boost_assert
|
||||
|
||||
- os: linux
|
||||
env: CMAKE_SUBDIR=1
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- git clone -b $BOOST_BRANCH https://github.com/boostorg/config.git ../config
|
||||
script:
|
||||
- cd test/cmake_subdir_test && mkdir __build__ && cd __build__
|
||||
- cmake ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
- os: linux
|
||||
env: CMAKE_INSTALL=1
|
||||
script:
|
||||
- mkdir __build__ && cd __build__
|
||||
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_DEBUG=1 -DBOOST_INCLUDE_LIBRARIES=assert,config -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||
- cmake --build . --target install
|
||||
- cd ../test/cmake_install_test && mkdir __build__ && cd __build__
|
||||
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||
- cmake --build .
|
||||
- cmake --build . --target check
|
||||
|
||||
|
||||
install:
|
||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||
- cd ..
|
||||
|
17
test/cmake_install_test/CMakeLists.txt
Normal file
17
test/cmake_install_test/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
# Copyright 2018 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(cmake_install_test LANGUAGES CXX)
|
||||
|
||||
find_package(boost_assert REQUIRED)
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main Boost::assert)
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME main COMMAND main)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
7
test/cmake_install_test/main.cpp
Normal file
7
test/cmake_install_test/main.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
int x = 5;
|
||||
BOOST_ASSERT( x > 4 );
|
||||
}
|
18
test/cmake_subdir_test/CMakeLists.txt
Normal file
18
test/cmake_subdir_test/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
# Copyright 2018 Peter Dimov
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
cmake_minimum_required(VERSION 3.5...3.16)
|
||||
|
||||
project(cmake_subdir_test LANGUAGES CXX)
|
||||
|
||||
add_subdirectory(../../../assert boostorg/assert)
|
||||
add_subdirectory(../../../config boostorg/config)
|
||||
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main Boost::assert)
|
||||
|
||||
enable_testing()
|
||||
add_test(NAME main COMMAND main)
|
||||
|
||||
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
7
test/cmake_subdir_test/main.cpp
Normal file
7
test/cmake_subdir_test/main.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
int x = 5;
|
||||
BOOST_ASSERT( x > 4 );
|
||||
}
|
Reference in New Issue
Block a user