diff --git a/.travis.yml b/.travis.yml index 043232c..57b44e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -223,7 +223,7 @@ matrix: env: TOOLSET=clang COMPILER=clang++ CXXSTD=11,14,1z - os: linux - compiler: clang + compiler: clang++ env: CMAKE=1 install: true script: @@ -231,6 +231,16 @@ matrix: - cmake .. - cmake --build . --target check + - os: linux + compiler: clang++ + env: CMAKE_SUBDIR_TEST=1 + install: true + script: + - cd test/cmake_subir_test && mkdir __build__ && cd __build__ + - cmake .. + - cmake --build . + - cmake --build . --target check + install: - BOOST_BRANCH=develop && [ "$TRAVIS_BRANCH" == "master" ] && BOOST_BRANCH=master || true - cd .. diff --git a/test/cmake_subdir_test/CMakeLists.txt b/test/cmake_subdir_test/CMakeLists.txt new file mode 100644 index 0000000..a2007ea --- /dev/null +++ b/test/cmake_subdir_test/CMakeLists.txt @@ -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) + +project(cmake_subdir_test LANGUAGES CXX) + +add_subdirectory(../.. boostorg/mp11) + +add_executable(main main.cpp) +target_link_libraries(main Boost::mp11) + +enable_testing() +add_test(NAME main COMMAND main) + +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_subdir_test/main.cpp b/test/cmake_subdir_test/main.cpp new file mode 100644 index 0000000..da23712 --- /dev/null +++ b/test/cmake_subdir_test/main.cpp @@ -0,0 +1,8 @@ +#include +using namespace boost::mp11; + +int main() +{ + using L1 = mp_list; + return mp_size>::value == 2? 0: 1; +}