Skip to content

Commit abea1a2

Browse files
vslashgcvvergara
authored andcommitted
Remove the Boost_VERSION_MACRO define from C++
Boost provides a header, <boost/version.hpp>, which provides a BOOST_VERSION macro with the same semantics. This change simplifies the build process and makes this project easier to incorporate in other build systems.
1 parent 0b3dcd6 commit abea1a2

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ find_package(Boost ${BOOST_MINIMUM_VERSION} REQUIRED)
8787
if (NOT Boost_VERSION_MACRO)
8888
set(Boost_VERSION_MACRO ${Boost_VERSION})
8989
endif()
90-
add_definitions(-DBoost_VERSION_MACRO=${Boost_VERSION_MACRO})
9190
set(BOOST_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
9291

9392
include(CheckCCompilerFlag)

include/coloring/pgr_edgeColoring.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3333

3434
#include <boost/config.hpp>
3535
#include <boost/graph/adjacency_list.hpp>
36+
#include <boost/version.hpp>
3637

3738
#include "cpp_common/edge_t.hpp"
3839
#include "c_types/ii_t_rt.h"
@@ -59,7 +60,7 @@ class Pgr_edgeColoring : public Pgr_messages {
5960
explicit Pgr_edgeColoring(const std::vector<Edge_t>&);
6061
Pgr_edgeColoring() = delete;
6162

62-
#if Boost_VERSION_MACRO >= 106800
63+
#if BOOST_VERSION >= 106800
6364
friend std::ostream& operator<<(std::ostream &, const Pgr_edgeColoring&);
6465
#endif
6566

include/tsp/tsp.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3737

3838
#include <boost/config.hpp>
3939
#include <boost/graph/adjacency_list.hpp>
40+
#include <boost/version.hpp>
4041

4142
#include "c_types/iid_t_rt.h"
4243
#include "cpp_common/coordinate_t.hpp"
@@ -77,7 +78,7 @@ class TSP : public Pgr_messages {
7778
explicit TSP(const std::vector<Coordinate_t>&);
7879
TSP() = delete;
7980

80-
#if Boost_VERSION_MACRO >= 106800
81+
#if BOOST_VERSION >= 106800
8182
friend std::ostream& operator<<(std::ostream &, const TSP&);
8283
#endif
8384
bool has_vertex(int64_t id) const;

src/alpha_shape/pgr_alphaShape.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4141
#include <boost/geometry/algorithms/num_points.hpp>
4242
#include <boost/geometry/algorithms/append.hpp>
4343
#include <boost/geometry/algorithms/area.hpp>
44-
#if Boost_VERSION_MACRO >= 107500
44+
#include <boost/version.hpp>
45+
#if BOOST_VERSION >= 107500
4546
# include <boost/geometry/strategies/strategies.hpp>
4647
#else
4748
# include <boost/geometry/strategies/agnostic/point_in_point.hpp>

src/tsp/tsp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3737
#include <boost/graph/connected_components.hpp>
3838
#include <boost/graph/dijkstra_shortest_paths.hpp>
3939
#include <boost/graph/graph_utility.hpp>
40+
#include <boost/version.hpp>
4041

4142
#include "cpp_common/identifiers.hpp"
4243
#include "cpp_common/pgr_messages.hpp"
@@ -503,7 +504,7 @@ TSP::get_edge_id(E e) const {
503504

504505

505506

506-
#if Boost_VERSION_MACRO >= 106800
507+
#if BOOST_VERSION >= 106800
507508
std::ostream& operator<<(std::ostream &log, const TSP& data) {
508509
log << "Number of Vertices is:" << num_vertices(data.graph) << "\n";
509510
log << "Number of Edges is:" << num_edges(data.graph) << "\n";

0 commit comments

Comments
 (0)