check_cmake_version.cpp 675 B

123456789101112131415161718192021222324252627
  1. // Check whether the version in CMakeLists.txt is up to date
  2. //
  3. // Copyright 2018 Peter Dimov
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. //
  7. // See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt
  9. #include <boost/core/lightweight_test.hpp>
  10. #include <boost/version.hpp>
  11. #include <cstdio>
  12. int main( int ac, char const* av[] )
  13. {
  14. BOOST_TEST_EQ( ac, 2 );
  15. if( ac >= 2 )
  16. {
  17. char version[ 64 ];
  18. std::sprintf( version, "%d.%d.%d", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100 );
  19. BOOST_TEST_CSTR_EQ( av[1], version );
  20. }
  21. return boost::report_errors();
  22. }