forked from boostorg/bind
Add CMake tests, instal support
This commit is contained in:
25
.travis.yml
25
.travis.yml
@ -278,14 +278,37 @@ matrix:
|
|||||||
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: g++
|
env: CMAKE_TEST=1
|
||||||
|
script:
|
||||||
|
- mkdir __build__ && cd __build__
|
||||||
|
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=bind ..
|
||||||
|
- ctest --output-on-failure -R boost_bind
|
||||||
|
|
||||||
|
- os: linux
|
||||||
env: CMAKE_SUBDIR_TEST=1
|
env: CMAKE_SUBDIR_TEST=1
|
||||||
|
install:
|
||||||
|
- BOOST_BRANCH=develop
|
||||||
|
- if [ "$TRAVIS_BRANCH" = "master" ]; then BOOST_BRANCH=master; fi
|
||||||
|
- git clone -b $BOOST_BRANCH https://github.com/boostorg/assert.git ../assert
|
||||||
|
- git clone -b $BOOST_BRANCH https://github.com/boostorg/config.git ../config
|
||||||
|
- git clone -b $BOOST_BRANCH https://github.com/boostorg/core.git ../core
|
||||||
script:
|
script:
|
||||||
- cd libs/bind/test/cmake_subdir_test && mkdir __build__ && cd __build__
|
- cd libs/bind/test/cmake_subdir_test && mkdir __build__ && cd __build__
|
||||||
- cmake ..
|
- cmake ..
|
||||||
- cmake --build .
|
- cmake --build .
|
||||||
- cmake --build . --target check
|
- cmake --build . --target check
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env: CMAKE_INSTALL_TEST=1
|
||||||
|
script:
|
||||||
|
- mkdir __build__ && cd __build__
|
||||||
|
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES="assert;bind;config;core" -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||||
|
- cmake --build . --target install
|
||||||
|
- cd ../libs/core/test/cmake_install_test && mkdir __build__ && cd __build__
|
||||||
|
- cmake -DCMAKE_INSTALL_PREFIX=~/.local ..
|
||||||
|
- cmake --build .
|
||||||
|
- cmake --build . --target check
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
|
||||||
- cd ..
|
- cd ..
|
||||||
|
@ -1,12 +1,10 @@
|
|||||||
# Copyright 2018 Mike Dev
|
# Copyright 2018, 2019 Peter Dimov
|
||||||
# Distributed under the Boost Software License, Version 1.0.
|
# 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
|
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
# Partial (add_subdirectory only) and experimental CMake support
|
cmake_minimum_required(VERSION 3.5...3.16)
|
||||||
# Subject to change; please do not rely on the contents of this file yet
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
project(boost_bind VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||||
project(BoostBind LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_library(boost_bind INTERFACE)
|
add_library(boost_bind INTERFACE)
|
||||||
add_library(Boost::bind ALIAS boost_bind)
|
add_library(Boost::bind ALIAS boost_bind)
|
||||||
@ -14,7 +12,20 @@ add_library(Boost::bind ALIAS boost_bind)
|
|||||||
target_include_directories(boost_bind INTERFACE include)
|
target_include_directories(boost_bind INTERFACE include)
|
||||||
|
|
||||||
target_link_libraries(boost_bind
|
target_link_libraries(boost_bind
|
||||||
INTERFACE
|
INTERFACE
|
||||||
Boost::config
|
Boost::config
|
||||||
Boost::core
|
Boost::core
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(BOOST_SUPERPROJECT_VERSION)
|
||||||
|
|
||||||
|
include(BoostInstall)
|
||||||
|
boost_install(TARGETS boost_bind HEADER_DIRECTORY include/)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
|
||||||
|
add_subdirectory(test)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
11
test/CMakeLists.txt
Normal file
11
test/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Copyright 2018, 2019 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
|
||||||
|
|
||||||
|
include(BoostTestJamfile OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
|
||||||
|
|
||||||
|
if(HAVE_BOOST_TEST)
|
||||||
|
|
||||||
|
boost_test_jamfile(FILE Jamfile.v2 LINK_LIBRARIES Boost::bind Boost::core Boost::function Boost::smart_ptr)
|
||||||
|
|
||||||
|
endif()
|
18
test/cmake_install_test/CMakeLists.txt
Normal file
18
test/cmake_install_test/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Copyright 2018, 2019 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_bind REQUIRED)
|
||||||
|
find_package(boost_core REQUIRED)
|
||||||
|
|
||||||
|
add_executable(quick ../quick.cpp)
|
||||||
|
target_link_libraries(quick Boost::bind Boost::core)
|
||||||
|
|
||||||
|
enable_testing()
|
||||||
|
add_test(quick quick)
|
||||||
|
|
||||||
|
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)
|
@ -2,7 +2,7 @@
|
|||||||
# Distributed under the Boost Software License, Version 1.0.
|
# 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
|
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.5...3.16)
|
||||||
|
|
||||||
project(cmake_subdir_test LANGUAGES CXX)
|
project(cmake_subdir_test LANGUAGES CXX)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user