]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Config.h.in
...
[cpPlugins.git] / lib / cpPlugins / Config.h.in
index 53b6242ddc47b050132446b31c0a44f8d07ec479..4e58a1d334576b4d23ddd44844aac41787491f1b 100644 (file)
-#ifndef __CPPLUGINS__CONFIG__H__
-#define __CPPLUGINS__CONFIG__H__
+#ifndef __cpPlugins__Config__h__
+#define __cpPlugins__Config__h__
 
-#include <cpPlugins/cpPlugins_Export.h>
-#include <string>
+#include <cpPlugins_Export.h>
+#include <stdexcept>
+#include <cpPlugins/RealConfig.h>
 
 /*
  * =========================================================================
  * Identify OS
  * =========================================================================
  */
-
-#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
-#  define cpPlugins_SYS_WINDOWS
-#  define cpPlugins_LIB_PREFIX ""
-#  define cpPlugins_LIB_EXT "dll"
-#  define cpPlugins_SEPARATOR ";"
+#define cpPlugins_OS_@CMAKE_SYSTEM_NAME@
+#ifdef cpPlugins_OS_Windows
+#  define cpPlugins_LIB_PREFIX     ""
+#  define cpPlugins_ENV_SEPARATOR  ";"
+#  define cpPlugins_PATH_SEPARATOR '\\'
+#  define cpPlugins_LIB_EXT        ".dll"
+#else // cpPlugins_OS_Windows
+#  define cpPlugins_LIB_PREFIX     "lib"
+#  define cpPlugins_ENV_SEPARATOR  ":"
 #  define cpPlugins_PATH_SEPARATOR '/'
+#  ifdef cpPlugins_OS_Linux
+#    define cpPlugins_LIB_EXT ".so"
+#  else // cpPlugins_OS_Linux
+#    define cpPlugins_LIB_EXT ".dylib"
+#  endif // cpPlugins_OS_Linux
+#endif // cpPlugins_OS_Windows
+
+#ifdef cpPlugins_OS_Windows
 #  ifndef WIN32_LEAN_AND_MEAN
 #    define WIN32_LEAN_AND_MEAN
-#  endif
+#  endif // WIN32_LEAN_AND_MEAN
 #  define NOMINMAX
 #  include <windows.h>
 #  include <tchar.h>
-#elif defined( linux ) || defined( __linux )
-#  define cpPlugins_SYS_LINUX
-#  define cpPlugins_LIB_PREFIX "lib"
-#  define cpPlugins_LIB_EXT "so"
-#  define cpPlugins_SEPARATOR ":"
-#  define cpPlugins_PATH_SEPARATOR '/'
-#elif defined( __APPLE__ ) || defined( MACOSX ) || defined( macintosh ) || defined( Macintosh )
-#  define cpPlugins_SYS_MACOS
-#  define cpPlugins_LIB_PREFIX "lib"
-#  define cpPlugins_LIB_EXT "dylib"
-#  define cpPlugins_SEPARATOR ":"
-#  define cpPlugins_PATH_SEPARATOR '/'
-#elif defined( __FreeBSD__ ) || defined( __FreeBSD_kernel__ )
-#  define cpPlugins_SYS_FREEBSD
-#  define cpPlugins_LIB_PREFIX "lib"
-#  define cpPlugins_LIB_EXT "so"
-#  define cpPlugins_SEPARATOR ":"
-#  define cpPlugins_PATH_SEPARATOR '/'
-#else
-#  error "This operating system is not supported by cpPlugins"
-#endif
+#endif // cpPlugins_OS_Windows
 
 /*
  * =========================================================================
  * Some global values
  * =========================================================================
  */
-
-#define cpPluginsObject
 #define cpPlugins_PATHS "cpPlugins_PATHS"
 #define cpPlugins_CONFIG "cpPlugins_Libraries.config"
-#define cpPlugins_QT4_USED @QT4_FOUND@
-#if cpPlugins_QT4_USED == 1
-#  define cpPlugins_QT4
-#else // cpPlugins_QT4_USED == 1
+
+#define cpPlugins_QT4_@QT4_FOUND@
+#ifdef cpPlugins_QT4_TRUE
+#  ifndef cpPlugins_QT4
+#    define cpPlugins_QT4
+#  endif // cpPlugins_QT4
+#else // cpPlugins_QT4_TRUE
 #  undef cpPlugins_QT4
-#endif // cpPlugins_QT4_USED == 1
+#endif // cpPlugins_QT4_TRUE
 
 /*
  * =========================================================================
  * Version numbers and strings
  * =========================================================================
  */
-
-#define cpPlugins_MAJ_VERSION   @prj_MAJ_VER@
-#define cpPlugins_MIN_VERSION   @prj_MIN_VER@
-#define cpPlugins_REL_VERSION   @prj_REL_VER@
-#define cpPlugins_VERSION       "@prj_VER@"
-#define cpPlugins_SHORT_VERSION "@prj_sVER@"
+#define cpPlugins_MAJOR_VERSION   @prj_MAJ_VER@
+#define cpPlugins_MINOR_VERSION   @prj_MIN_VER@
+#define cpPlugins_RELEASE_VERSION @prj_REL_VER@
+#define cpPlugins_VERSION         "@prj_VERSION@"
+#define cpPlugins_SHORT_VERSION   "@prj_SHORT_VERSION@"
+#define cpPlugins_OpenGL_BackEnd_@VTK_RENDERING_BACKEND@
 
 /*
  * =========================================================================
- * ITK related macros
+ * Language related macros
  * =========================================================================
  */
-
-#include <itkMacro.h>
-#define ITK_MANUAL_INSTANTIATION
-#ifndef ITK_DELETE_FUNCTION
-#  define ITK_DELETE_FUNCTION
-#endif // ITK_DELETE_FUNCTION
-#ifndef ITK_OVERRIDE
-#  define ITK_OVERRIDE
-#endif // ITK_OVERRIDE
+/* TODO
+   #if __cplusplus >= 201103L
+   #  define override override
+   #  define cpPlugins_DELETE_FUNCTION =delete
+   #  define cpPlugins_NULLPTR  nullptr
+   #  define cpPlugins_NOEXCEPT noexcept
+   #  define cpPlugins_HAS_CXX11_STATIC_ASSERT
+   #  define cpPlugins_HAS_CXX11_RVREF
+   #else // __cplusplus >= 201103L
+   #  define override
+   #  define cpPlugins_DELETE_FUNCTION
+   #  define cpPlugins_NULLPTR  NULL
+   #  define cpPlugins_NOEXCEPT throw()
+   #endif // __cplusplus >= 201103L
+*/
 
 /*
  * =========================================================================
- * VTK related macros
+ * Some macros
  * =========================================================================
  */
 
-#include <vtkConfigure.h>
-#ifndef VTK_OVERRIDE
-#  define VTK_OVERRIDE
-#endif // VTK_OVERRIDE
+#define cpPlugins_Id_Macro( _class, _category )                         \
+  public:                                                               \
+  virtual const char* GetClassName( ) const override          \
+  { return( #_class ); }                                                \
+  virtual const char* GetClassCategory( ) const override      \
+  { return( #_category ); }
+
+#define cpPluginsObject( _cls, _scls, _cat )                            \
+  public:                                                               \
+  typedef _cls                            Self;                         \
+  typedef _scls                           Superclass;                   \
+  typedef itk::SmartPointer< Self >       Pointer;                      \
+  typedef itk::SmartPointer< const Self > ConstPointer;                 \
+  public:                                                               \
+  itkNewMacro( Self );                                                  \
+  itkTypeMacro( _cls, _scls );                                          \
+  public:                                                               \
+  virtual const char* GetClassName( ) const override          \
+  { return( #_cls ); }                                                  \
+  virtual const char* GetClassCategory( ) const override      \
+  { return( #_cat ); }                                                  \
+  protected:                                                            \
+  _cls( );                                                              \
+  virtual ~_cls( );                                                     \
+  virtual void _GenerateData( ) override;                     \
+  private:                                                              \
+  _cls( const Self& );                                                  \
+  Self& operator=( const Self& )
+
+#define cpPlugins_Compatibility_Macro                           \
+  virtual bool IsCompatible(                                    \
+    const DataObject* other                                     \
+    ) const override                                  \
+  {                                                             \
+    return( dynamic_cast< const Self* >( other ) != NULL );     \
+  }
 
-#endif // __CPPLUGINS__CONFIG__H__
+#endif // __cpPlugins__Config__h__
 
 // eof - $RCSfile$