]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Config.h.in
debug finished
[cpPlugins.git] / lib / cpPlugins / Config.h.in
1 #ifndef __cpPlugins__Config__h__
2 #define __cpPlugins__Config__h__
3
4 #define ITK_MANUAL_INSTANTIATION
5 #include <cpPlugins_Export.h>
6 #include <stdexcept>
7 #include <cpPlugins/RealConfig.h>
8
9 /*
10  * =========================================================================
11  * Identify OS
12  * =========================================================================
13  */
14 #define cpPlugins_OS_@CMAKE_SYSTEM_NAME@
15 #ifdef cpPlugins_OS_Windows
16 #  define cpPlugins_LIB_PREFIX     ""
17 #  define cpPlugins_ENV_SEPARATOR  ";"
18 #  define cpPlugins_PATH_SEPARATOR '\\'
19 #  define cpPlugins_LIB_EXT        ".dll"
20 #else // cpPlugins_OS_Windows
21 #  define cpPlugins_LIB_PREFIX     "lib"
22 #  define cpPlugins_ENV_SEPARATOR  ":"
23 #  define cpPlugins_PATH_SEPARATOR '/'
24 #  ifdef cpPlugins_OS_Linux
25 #    define cpPlugins_LIB_EXT ".so"
26 #  else // cpPlugins_OS_Linux
27 #    define cpPlugins_LIB_EXT ".dylib"
28 #  endif // cpPlugins_OS_Linux
29 #endif // cpPlugins_OS_Windows
30
31 #ifdef cpPlugins_OS_Windows
32 #  ifndef WIN32_LEAN_AND_MEAN
33 #    define WIN32_LEAN_AND_MEAN
34 #  endif // WIN32_LEAN_AND_MEAN
35 #  define NOMINMAX
36 #  include <windows.h>
37 #  include <tchar.h>
38 #endif // cpPlugins_OS_Windows
39
40 /*
41  * =========================================================================
42  * Some global values
43  * =========================================================================
44  */
45
46 #define cpPlugins_PATHS "cpPlugins_PATHS"
47 #define cpPlugins_CONFIG "cpPlugins_Libraries.config"
48 #define cpPlugins_QT4_USED @QT4_FOUND@
49 #if cpPlugins_QT4_USED == 1
50 #  define cpPlugins_QT4
51 #  define cpPlugins_QVTKWidget @cpPlugins_Qt4_VTKWidget@
52 /* TODO
53    #  include <@cpPlugins_Qt4_VTKWidget@.h>
54 */
55 #else // cpPlugins_QT4_USED == 1
56 #  undef cpPlugins_QT4
57 #endif // cpPlugins_QT4_USED == 1
58
59 /*
60  * =========================================================================
61  * Version numbers and strings
62  * =========================================================================
63  */
64
65 #define cpPlugins_MAJOR_VERSION   @prj_MAJ_VER@
66 #define cpPlugins_MINOR_VERSION   @prj_MIN_VER@
67 #define cpPlugins_RELEASE_VERSION @prj_REL_VER@
68 #define cpPlugins_VERSION         "@prj_VERSION@"
69 #define cpPlugins_SHORT_VERSION   "@prj_SHORT_VERSION@"
70 #define cpPlugins_OpenGL_BackEnd_@VTK_RENDERING_BACKEND@
71
72 /*
73  * =========================================================================
74  * Language related macros
75  * =========================================================================
76  */
77
78 #if __cplusplus >= 201103L
79 #  define cpPlugins_OVERRIDE override
80 #  define cpPlugins_DELETE_FUNCTION =delete
81 #  define cpPlugins_NULLPTR  nullptr
82 #  define cpPlugins_NOEXCEPT noexcept
83 #  define cpPlugins_HAS_CXX11_STATIC_ASSERT
84 #  define cpPlugins_HAS_CXX11_RVREF
85 #else // __cplusplus >= 201103L
86 #  define cpPlugins_OVERRIDE
87 #  define cpPlugins_DELETE_FUNCTION
88 #  define cpPlugins_NULLPTR  NULL
89 #  define cpPlugins_NOEXCEPT throw()
90 #endif // __cplusplus >= 201103L
91
92 /*
93  * =========================================================================
94  * Some macros
95  * =========================================================================
96  */
97
98 #define cpPluginsNewMacro( x )                                       \
99   static Pointer New( )                                              \
100   {                                                                  \
101     Pointer smartPtr = new x( );                                     \
102     smartPtr->UnRegister( );                                         \
103     return( smartPtr );                                              \
104   }                                                                  \
105   virtual itk::LightObject::Pointer                                  \
106   CreateAnother( ) const cpPlugins_OVERRIDE                          \
107   {                                                                  \
108     itk::LightObject::Pointer smartPtr;                              \
109     smartPtr = x::New( ).GetPointer( );                              \
110     return( smartPtr );                                              \
111   }                                                                  \
112   Pointer Clone( ) const                                             \
113   {                                                                  \
114     Pointer rval =                                                   \
115       dynamic_cast< x* >( this->InternalClone( ).GetPointer( ) );    \
116     return( rval );                                                  \
117   }
118
119 #define cpPlugins_Id_Macro( _class, _category )                         \
120   public:                                                               \
121   virtual const char* GetClassName( ) const cpPlugins_OVERRIDE          \
122   { return( #_class ); }                                                \
123   virtual const char* GetClassCategory( ) const cpPlugins_OVERRIDE      \
124   { return( #_category ); }
125
126 #define cpPluginsObject( _cls, _scls, _cat )                            \
127   public:                                                               \
128   typedef _cls                            Self;                         \
129   typedef _scls                           Superclass;                   \
130   typedef itk::SmartPointer< Self >       Pointer;                      \
131   typedef itk::SmartPointer< const Self > ConstPointer;                 \
132   public:                                                               \
133   cpPluginsNewMacro( Self );                                            \
134   itkTypeMacro( _cls, _scls );                                          \
135   public:                                                               \
136   virtual const char* GetClassName( ) const cpPlugins_OVERRIDE          \
137   { return( #_cls ); }                                                  \
138   virtual const char* GetClassCategory( ) const cpPlugins_OVERRIDE      \
139   { return( #_cat ); }                                                  \
140   protected:                                                            \
141   _cls( );                                                              \
142   virtual ~_cls( );                                                     \
143   virtual void _GenerateData( ) cpPlugins_OVERRIDE;                     \
144   private:                                                              \
145   _cls( const Self& );                                                  \
146   Self& operator=( const Self& )
147
148 #define cpPlugins_Compatibility_Macro                                   \
149   virtual bool IsCompatible(                                            \
150     const DataObject* other                                             \
151     ) const cpPlugins_OVERRIDE                                          \
152   {                                                                     \
153     return( dynamic_cast< const Self* >( other ) != NULL );             \
154   }
155
156 #endif // __cpPlugins__Config__h__
157
158 // eof - $RCSfile$