Skip to content

Commit

Permalink
Avoid tr1 with VS2017.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdembia committed Feb 1, 2018
1 parent 99fe9bc commit 2b7a9a8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Code/Common/btkIMU.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace btk
BTK_COMMON_EXPORT Analog::ConstPointer GetChannel(int id) const;
BTK_COMMON_EXPORT Analog::Pointer GetChannel(const std::string& label);
BTK_COMMON_EXPORT Analog::ConstPointer GetChannel(const std::string& label) const;
BTK_COMMON_EXPORT int GetChannelNumber() const {return this->m_Channels.size();};
BTK_COMMON_EXPORT int GetChannelNumber() const {return (int)this->m_Channels.size();};

int GetType() const {return this->m_Type;};

Expand Down
16 changes: 11 additions & 5 deletions Code/Common/btkSharedPtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@
#define btkSharedPtr std::shared_ptr
using std::static_pointer_cast;
#endif
#elif defined(_MSC_VER) && (_MSC_VER >= 1500)
/* included with MSVC 2008 SP1 */
#if defined(HAVE_SYS_MEMORY_H)
#elif defined(_MSC_VER)
#if (_MSC_VER >= 1910)
#include <memory>
#define btkSharedPtr std::tr1::shared_ptr
using std::tr1::static_pointer_cast;
#define btkSharedPtr std::shared_ptr
using std::static_pointer_cast;
#elif (_MSC_VER >= 1500)
/* included with MSVC 2008 SP1 */
#if defined(HAVE_SYS_MEMORY_H)
#include <memory>
#define btkSharedPtr std::tr1::shared_ptr
using std::tr1::static_pointer_cast;
#endif
#endif
#elif defined(HAVE_BOOST_MEMORY_HPP)
#include <boost/memory.hpp>
Expand Down
8 changes: 4 additions & 4 deletions Packaging/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ADD_CUSTOM_TARGET(package)
ADD_CUSTOM_TARGET(packaging)

SET(BTK_MODULES_LOCATION "")
IF(BTK_BUILD_SHARED_LIBS)
Expand All @@ -11,18 +11,18 @@ ENDIF(BTK_BUILD_SHARED_LIBS)
IF(BTK_WRAP_MATLAB)
ADD_CUSTOM_TARGET(Package_Matlab
COMMAND ${CMAKE_COMMAND} -D BTK_VERSION_STRING:STRING=${BTK_VERSION_STRING} -D BTK_BINARY_DIR:STRING=${BTK_BINARY_DIR} -D BTK_SOURCE_DIR:STRING=${BTK_SOURCE_DIR} -P "${BTK_SOURCE_DIR}/Packaging/Matlab/btkPackageMatlabBinding.cmake")
ADD_DEPENDENCIES(package Package_Matlab)
ADD_DEPENDENCIES(packaging Package_Matlab)
ENDIF(BTK_WRAP_MATLAB)

IF(BTK_WRAP_OCTAVE)
ADD_CUSTOM_TARGET(Package_Octave
COMMAND ${CMAKE_COMMAND} -D BTK_VERSION_STRING:STRING=${BTK_VERSION_STRING} -D BTK_BINARY_DIR:STRING=${BTK_BINARY_DIR} -D BTK_SOURCE_DIR:STRING=${BTK_SOURCE_DIR} -P "${BTK_SOURCE_DIR}/Packaging/Octave/btkPackageOctaveBinding.cmake")
ADD_DEPENDENCIES(package Package_Octave)
ADD_DEPENDENCIES(packaging Package_Octave)
ENDIF(BTK_WRAP_OCTAVE)

IF(BTK_WRAP_PYTHON)
GET_TARGET_PROPERTY(BTK_SWIG_PYTHON_MODULE_LOCATION "_btk" LOCATION)
ADD_CUSTOM_TARGET(Package_Python
COMMAND ${CMAKE_COMMAND} -D BTK_SWIG_PYTHON_MODULE_LOCATION:STRING=${BTK_SWIG_PYTHON_MODULE_LOCATION} -D ARCH_64_BIT:BOOL=${HAVE_64_BIT} -D BTK_VERSION_STRING:STRING=${BTK_VERSION_STRING} -D BTK_BINARY_DIR:STRING=${BTK_BINARY_DIR} -D BTK_SOURCE_DIR:STRING=${BTK_SOURCE_DIR} -P "${BTK_SOURCE_DIR}/Packaging/Python/btkPackagePythonBinding.cmake")
ADD_DEPENDENCIES(package Package_Python)
ADD_DEPENDENCIES(packaging Package_Python)
ENDIF(BTK_WRAP_PYTHON)

0 comments on commit 2b7a9a8

Please sign in to comment.