The build system now checks for TR1 or Boost for a shared_ptr implementation
instead of assuming that TR1 is present.
INCLUDE(CheckIncludeFile)
+INCLUDE(CheckIncludeFileCXX)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
SET(GENELIBS GeneSort)
ENDIF(HAVE_FANN)
+
+CHECK_INCLUDE_FILE_CXX("tr1/memory" HAVE_TR1)
+
+IF(HAVE_TR1)
+ ADD_DEFINITIONS(-DHAVE_TR1)
+ELSE(HAVE_TR1)
+ CHECK_INCLUDE_FILE_CXX("boost/shared_ptr.hpp" HAVE_BOOST)
+ IF(NOT HAVE_BOOST)
+ MESSAGE(FATAL_ERROR "Neither Boost nor TR1 found, need a shared_ptr implementation")
+ ENDIF(NOT HAVE_BOOST)
+ENDIF(HAVE_TR1)
+
TARGET_LINK_LIBRARIES(germs ${GENELIBS})
SUBDIRS(test)
#ifndef __MODEL_H__
#define __MODEL_H__
-#include <tr1/memory>
+#include "shared_ptr.h"
#include <string>
class SortAction;
*/
class Model{
public:
- typedef std::tr1::shared_ptr<Models::ModelImpl> ModelPointer;
+ typedef shared_ptr<Models::ModelImpl> ModelPointer;
/**
* Constructs a new model.
--- /dev/null
+#if HAVE_TR1
+#include <tr1/memory>
+using std::tr1::shared_ptr;
+#else
+#include <boost/shared_ptr.hpp>
+using boost::shared_ptr;
+#endif
#ifndef __SORTACTION_H__
#define __SORTACTION_H__
-#include <tr1/memory>
+#include "shared_ptr.h"
#include <string>
class GeneOrder;
*/
class SortAction{
public:
- typedef std::tr1::shared_ptr<SortActionImpl> ActionPointer;
+ typedef shared_ptr<SortActionImpl> ActionPointer;
/**
* Creates a new sort action, given a specified action.