Skip to content

Commit

Permalink
Fix boost::any bug with Boost 1.54.
Browse files Browse the repository at this point in the history
  • Loading branch information
jobermayr authored and wwmayer committed May 2, 2016
1 parent 5edeb99 commit 1e061b5
Show file tree
Hide file tree
Showing 7 changed files with 378 additions and 6 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Expand Up @@ -50,11 +50,10 @@ endif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")

# ================================================================================

# Issues with boost::any on older versions with C++11 enabled.
set(BOOST_MIN_VERSION 1.55)
IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_COMPILER_VERSION VERSION_LESS 4.7)
UNSET(BOOST_MIN_VERSION) # For Ubuntu 12.04
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_COMPILER_VERSION VERSION_LESS 4.7)
# Allow developers to use Boost < 1.48
if(NOT ${BOOST_MIN_VERSION})
set(BOOST_MIN_VERSION 1.48)
endif()

# Enabled C++11 for Freecad 0.17 and later
IF(FREECAD_VERSION VERSION_GREATER 0.16)
Expand Down
2 changes: 2 additions & 0 deletions src/App/CMakeLists.txt
Expand Up @@ -12,6 +12,8 @@ IF(DOCDIR)
add_definitions(-DDOCDIR="${DOCDIR}")
ENDIF(DOCDIR)

add_definitions(-DBOOST_${Boost_VERSION})

include_directories(
${CMAKE_BINARY_DIR}/src
${CMAKE_SOURCE_DIR}/src
Expand Down
4 changes: 4 additions & 0 deletions src/App/ObjectIdentifier.h
Expand Up @@ -26,7 +26,11 @@

#include <vector>
#include <string>
#ifndef BOOST_105400
#include <boost/any.hpp>
#else
#include <boost_any_1_55.hpp>
#endif

namespace App
{
Expand Down
6 changes: 5 additions & 1 deletion src/App/Property.h
Expand Up @@ -27,7 +27,11 @@
// Std. configurations

#include <Base/Persistence.h>
#include <boost/any.hpp>
#ifndef BOOST_105400
#include <boost/any.hpp>
#else
#include <boost_any_1_55.hpp>
#endif
#include <string>
#include <bitset>

Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Assembly/App/CMakeLists.txt
Expand Up @@ -4,6 +4,8 @@ else(MSVC)
add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H)
endif(MSVC)

add_definitions(-DBOOST_${Boost_VERSION})

include_directories(
${CMAKE_SOURCE_DIR}/src
${CMAKE_BINARY_DIR}/src
Expand Down
4 changes: 4 additions & 0 deletions src/Mod/Assembly/App/opendcm/core/constraint.hpp
Expand Up @@ -32,7 +32,11 @@
#include <boost/mpl/size.hpp>
#include <boost/mpl/for_each.hpp>

#ifndef BOOST_105400
#include <boost/any.hpp>
#else
#include <boost_any_1_55.hpp>
#endif
#include <boost/fusion/include/as_vector.hpp>

#include <boost/preprocessor.hpp>
Expand Down

0 comments on commit 1e061b5

Please sign in to comment.