forked from boostorg/move
Add CMake install support, tests
This commit is contained in:
@ -178,6 +178,15 @@ jobs:
|
|||||||
- cd $BOOST_ROOT/libs/$SELF
|
- cd $BOOST_ROOT/libs/$SELF
|
||||||
- ci/travis/valgrind.sh
|
- ci/travis/valgrind.sh
|
||||||
|
|
||||||
|
- os: linux
|
||||||
|
env:
|
||||||
|
- COMMENT=cmake
|
||||||
|
script:
|
||||||
|
- cd $BOOST_ROOT
|
||||||
|
- mkdir __build__ && cd __build__
|
||||||
|
- cmake -DBOOST_ENABLE_CMAKE=1 -DBoost_VERBOSE=1 -DBOOST_INCLUDE_LIBRARIES=move ..
|
||||||
|
- ctest --output-on-failure -R boost_move
|
||||||
|
|
||||||
#################### Jobs to run on pushes to master, develop ###################
|
#################### Jobs to run on pushes to master, develop ###################
|
||||||
|
|
||||||
# Coverity Scan
|
# Coverity Scan
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
# Copyright 2018 Mike Dev
|
# Copyright 2018 Mike Dev
|
||||||
|
# Copyright 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
|
||||||
#
|
#
|
||||||
# NOTE: CMake support for Boost.Move is currently experimental at best
|
cmake_minimum_required(VERSION 3.5...3.16)
|
||||||
# and the interface is likely to change in the future
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.5)
|
project(boost_move VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
|
||||||
project(BoostMove LANGUAGES CXX)
|
|
||||||
|
|
||||||
add_library(boost_move INTERFACE)
|
add_library(boost_move INTERFACE)
|
||||||
add_library(Boost::move ALIAS boost_move)
|
add_library(Boost::move ALIAS boost_move)
|
||||||
@ -14,10 +13,22 @@ add_library(Boost::move ALIAS boost_move)
|
|||||||
target_include_directories(boost_move INTERFACE include)
|
target_include_directories(boost_move INTERFACE include)
|
||||||
|
|
||||||
target_link_libraries(boost_move
|
target_link_libraries(boost_move
|
||||||
INTERFACE
|
INTERFACE
|
||||||
Boost::assert
|
Boost::assert
|
||||||
Boost::config
|
Boost::config
|
||||||
Boost::core
|
Boost::core
|
||||||
Boost::static_assert
|
Boost::static_assert
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(BOOST_SUPERPROJECT_VERSION)
|
||||||
|
|
||||||
|
include(BoostInstall)
|
||||||
|
boost_install(TARGETS boost_move HEADER_DIRECTORY include/)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
|
||||||
|
add_subdirectory(test)
|
||||||
|
|
||||||
|
endif()
|
||||||
|
19
test/CMakeLists.txt
Normal file
19
test/CMakeLists.txt
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# 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(BoostTest OPTIONAL RESULT_VARIABLE HAVE_BOOST_TEST)
|
||||||
|
|
||||||
|
if(NOT HAVE_BOOST_TEST)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
file(GLOB tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
|
||||||
|
|
||||||
|
set(BOOST_TEST_LINK_LIBRARIES Boost::move Boost::assert Boost::config Boost::container Boost::core Boost::static_assert Boost::timer)
|
||||||
|
|
||||||
|
foreach(test IN LISTS tests)
|
||||||
|
|
||||||
|
boost_test(SOURCES ${test})
|
||||||
|
|
||||||
|
endforeach()
|
Reference in New Issue
Block a user