From 92f2d85b65a0638dc314b5a61e33e05063a15f9f Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Tue, 5 May 2009 15:25:31 +0000 Subject: [PATCH] Refines the test so that it fails at link when using a wrong std::string, since std::string appears in the ABI of Boost.PO. This happens with GCC's parallel or debug mode. (admittedly, a further refinement could be to have 2 test programs, but it's probably an overkill). --- .../support/test_BOOST_PROGRAM_OPTIONS.cpp | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Installation/config/support/test_BOOST_PROGRAM_OPTIONS.cpp b/Installation/config/support/test_BOOST_PROGRAM_OPTIONS.cpp index 51d797e81ee..17350ac9166 100644 --- a/Installation/config/support/test_BOOST_PROGRAM_OPTIONS.cpp +++ b/Installation/config/support/test_BOOST_PROGRAM_OPTIONS.cpp @@ -1,8 +1,5 @@ -// Copyright (c) 2006, 2007 Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), -// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg -// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), -// and Tel-Aviv University (Israel). All rights reserved. +// Copyright (c) 2006, 2007, 2009 Stanford University (USA), +// INRIA Sophia-Antipolis (France). All rights reserved. // // This file is part of CGAL (www.cgal.org); you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License as @@ -17,29 +14,35 @@ // // $URL$ // $Id$ -// // -// Author(s) : Daniel Russel +// Author(s) : Daniel Russel, Sylvain Pion // Tests if BOOST_PROGRAM_OPTIONS is available. #include +#include #include +namespace po = boost::program_options; + int main(int ac, char *av[]) { std::cout << "version=" << BOOST_VERSION/100000 << "." << ((BOOST_VERSION / 100) % 100) << "." << BOOST_VERSION % 100 << std::endl; - boost::program_options::options_description desc("Allowed options"); + std::string str; + + po::options_description desc("Allowed options"); desc.add_options() ("help", "produce help message") + ("input-file,f", po::value(&str)->default_value("blabla.txt"), + "name of file") ; - boost::program_options::variables_map vm; - boost::program_options::store(boost::program_options::parse_command_line(ac, av, desc), vm); - boost::program_options::notify(vm); + po::variables_map vm; + po::store(po::parse_command_line(ac, av, desc), vm); + po::notify(vm); if (vm.count("help")) { std::cout << "Help" << "\n";