Skip to content

Commit bff5cb6

Browse files
committed
Boost super-project tests target
fix #53
1 parent 42bb99e commit bff5cb6

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ endif ()
2323
# Options
2424
if (NOT BOOST_SUPERPROJECT_VERSION)
2525
option(BOOST_STATIC_STRING_INSTALL "Install boost::static_string files" ${BOOST_STATIC_STRING_IS_ROOT})
26-
option(BOOST_STATIC_STRING_BUILD_TESTS "Build boost::static_string tests" ${BUILD_TESTING})
26+
option(BOOST_STATIC_STRING_BUILD_TESTS "Build boost::static_string tests" OFF)
2727
else ()
2828
set(BOOST_STATIC_STRING_BUILD_TESTS ${BUILD_TESTING})
2929
endif ()
@@ -112,7 +112,7 @@ if (BOOST_STATIC_STRING_INSTALL AND NOT BOOST_SUPERPROJECT_VERSION)
112112
endif ()
113113

114114

115-
if (BOOST_STATIC_STRING_BUILD_TESTS)
115+
if (BUILD_TESTING OR BOOST_STATIC_STRING_BUILD_TESTS)
116116
add_subdirectory(test)
117117
endif ()
118118

meta/libraries.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"String"
1212
],
1313
"maintainers": [
14+
"Krystian Stasiowski <[email protected]>",
1415
"Alan de Freitas <[email protected]>",
1516
"Vinnie Falco <[email protected]>"
1617
],

test/CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
# Official repository: https://github.com/boostorg/static_string
88
#
99

10+
# Custom target used by the boost super-project
11+
if(NOT TARGET tests)
12+
add_custom_target(tests)
13+
set_property(TARGET tests PROPERTY FOLDER _deps)
14+
endif()
15+
1016
set(BOOST_STATIC_STRING_TESTS_FILES
1117
CMakeLists.txt
1218
Jamfile
@@ -23,3 +29,4 @@ add_executable(boost_static_string_tests ${BOOST_STATIC_STRING_TESTS_FILES})
2329
# See: BOOST_STATIC_STRING_UNIT_TEST_LIBRARIES
2430
target_link_libraries(boost_static_string_tests PRIVATE Boost::static_string)
2531
add_test(NAME boost_static_string_tests COMMAND boost_static_string_tests)
32+
add_dependencies(tests boost_static_string_tests)

0 commit comments

Comments
 (0)