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