Compare commits

..

4 Commits

Author SHA1 Message Date
Peter Dimov
6c895e2419 Merge branch 'feature/min_cmake' of https://github.com/Mike-Devel/bind into feature/pr-15 2019-01-04 19:43:41 +02:00
Mike Dev
e2cf9f696a [CMake] Add note about experimental status 2018-12-05 12:14:04 +01:00
Mike Dev
6a6f61f847 [CMake] Add self-test for cmake script 2018-12-05 12:14:04 +01:00
Mike Dev
84c711bbe8 [CMake] Generate cmake target that other libraries can use
... to express their dependency on this library and retrieve any
configuration information such as the include directory, binary
to link to (if any), transitive dependencies, necessary compiler
options or the required c++ standards level.
2018-12-04 15:30:42 +01:00
5 changed files with 43 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
# Copyright 2016-2019 Peter Dimov
# Copyright 2016, 2017 Peter Dimov
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)
@@ -22,6 +22,20 @@ matrix:
- env: BOGUS_JOB=true
include:
# cmake self-test
- os: linux
env: TEST_CMAKE=TRUE #Only for easier identification in travis web gui
install:
- git clone --depth 1 https://github.com/boostorg/config.git ../config
- git clone --depth 1 https://github.com/boostorg/core.git ../core
- git clone --depth 1 https://github.com/boostorg/assert.git ../assert
script:
- mkdir __build__ && cd __build__
- cmake ../test/test_cmake
- cmake --build .
- os: linux
compiler: g++
env: TOOLSET=gcc COMPILER=g++ CXXSTD=03,11
@@ -250,15 +264,6 @@ matrix:
compiler: clang++
env: TOOLSET=clang COMPILER=clang++ CXXSTD=03,11,14,1z
- os: linux
compiler: g++
env: CMAKE_SUBDIR_TEST=1
script:
- cd libs/bind/test/cmake_subdir_test && mkdir __build__ && cd __build__
- cmake ..
- cmake --build .
- cmake --build . --target check
install:
- BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true
- cd ..

View File

@@ -1,9 +1,9 @@
# Copyright 2018 Mike Dev
# 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
# Partial (add_subdirectory only) and experimental CMake support
# Subject to change; please do not rely on the contents of this file yet
#
# NOTE: CMake support for Boost.Bind is currently experimental at best
# and the interface is likely to change in the future
cmake_minimum_required(VERSION 3.5)
project(BoostBind LANGUAGES CXX)

View File

@@ -1,20 +0,0 @@
# 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)
project(cmake_subdir_test LANGUAGES CXX)
add_subdirectory(../.. boostorg/bind)
add_subdirectory(../../../assert boostorg/assert)
add_subdirectory(../../../config boostorg/config)
add_subdirectory(../../../core boostorg/core)
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>)

View File

@@ -0,0 +1,20 @@
# Copyright 2018 Mike Dev
# 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
#
# NOTE: This does NOT run the unit tests for Boost.Bind.
# It only tests, if the CMakeLists.txt file in it's root works as expected
cmake_minimum_required( VERSION 3.5 )
project( BoostBindCMakeSelfTest )
add_subdirectory( ../../../config ${CMAKE_CURRENT_BINARY_DIR}/libs/config )
add_subdirectory( ../../../core ${CMAKE_CURRENT_BINARY_DIR}/libs/core )
add_subdirectory( ../../../assert ${CMAKE_CURRENT_BINARY_DIR}/libs/assert )
add_subdirectory( ../.. ${CMAKE_CURRENT_BINARY_DIR}/libs/boost_bind )
add_executable( boost_bind_cmake_self_test main.cpp )
target_link_libraries( boost_bind_cmake_self_test Boost::bind )

5
test/test_cmake/main.cpp Normal file
View File

@@ -0,0 +1,5 @@
#include <boost/bind.hpp>
int main() {
}