Skip to content

Commit 3777e67

Browse files
committed
Add cmake_install_test, cmake_subdir_test
1 parent c8cd11d commit 3777e67

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2018, 2019 Peter Dimov
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
4+
5+
cmake_minimum_required(VERSION 3.5...3.16)
6+
7+
project(cmake_install_test LANGUAGES CXX)
8+
9+
find_package(boost_program_options REQUIRED)
10+
find_package(boost_core REQUIRED)
11+
12+
add_executable(quick ../quick.cpp)
13+
target_link_libraries(quick Boost::program_options Boost::core)
14+
15+
enable_testing()
16+
add_test(NAME quick COMMAND quick --path=initial)
17+
18+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

test/cmake_subdir_test/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2018, 2019 Peter Dimov
2+
# Distributed under the Boost Software License, Version 1.0.
3+
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt
4+
5+
cmake_minimum_required(VERSION 3.5...3.16)
6+
7+
project(cmake_subdir_test LANGUAGES CXX)
8+
9+
set(BOOST_INCLUDE_LIBRARIES program_options)
10+
add_subdirectory(../../../.. boostorg/boost)
11+
12+
add_executable(quick ../quick.cpp)
13+
target_link_libraries(quick Boost::program_options Boost::core)
14+
15+
enable_testing()
16+
add_test(NAME quick COMMAND quick --path=initial)
17+
18+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $<CONFIG>)

0 commit comments

Comments
 (0)