Skip to content

cmake: Also build the test programs in BUILD_TESTING=Y mode#108

Open
nigels-com wants to merge 1 commit into
boostorg:developfrom
nigels-com:cmake-test-programs
Open

cmake: Also build the test programs in BUILD_TESTING=Y mode#108
nigels-com wants to merge 1 commit into
boostorg:developfrom
nigels-com:cmake-test-programs

Conversation

@nigels-com

@nigels-com nigels-com commented Jun 20, 2026

Copy link
Copy Markdown

Extending the cmake build to also build the test programs.

Requires BUILD_TESTING mode and an installed boost that cmake can find via find_package.
Also requires using the tests/all ninja target.

Ideally this test coverage could be adapted as cmake tests, but this is the first step.

$ /opt/cmake-4.1.1-linux-x86_64/bin/cmake -G Ninja -DCMAKE_CXX_COMPILER=g++-14 .. -DBUILD_TESTING=Y
-- The CXX compiler identification is GNU 14.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-14 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using CMake version 4.1.1
-- Found Boost 1.90.0 at /opt/boost-1.90.0/lib/cmake/Boost-1.90.0
--   Requested configuration: REQUIRED COMPONENTS assert;config;core;optional;smart_ptr;throw_exception;utility
-- BoostConfig: find_package(boost_headers 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_headers 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_headers-1.90.0
-- BoostConfig: find_package(boost_assert 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_assert 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_assert-1.90.0
-- Found boost_config 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_config-1.90.0
-- BoostConfig: find_package(boost_config 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_config 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_config-1.90.0
-- BoostConfig: find_package(boost_core 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_core 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_core-1.90.0
-- Found boost_throw_exception 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_throw_exception-1.90.0
-- BoostConfig: find_package(boost_optional 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_optional 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_optional-1.90.0
-- Found boost_type_traits 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_type_traits-1.90.0
-- Found boost_static_assert 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_static_assert-1.90.0
-- BoostConfig: find_package(boost_smart_ptr 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_smart_ptr 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_smart_ptr-1.90.0
-- BoostConfig: find_package(boost_throw_exception 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_throw_exception 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_throw_exception-1.90.0
-- BoostConfig: find_package(boost_utility 1.90.0 EXACT CONFIG REQUIRED  HINTS /opt/boost-1.90.0/lib/cmake)
-- Found boost_utility 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_utility-1.90.0
-- Found boost_io 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_io-1.90.0
-- Found boost_preprocessor 1.90.0 at /opt/boost-1.90.0/lib/cmake/boost_preprocessor-1.90.0
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/nigels/dev/format/build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant