]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Config.h.in
4e58a1d334576b4d23ddd44844aac41787491f1b
[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 /* TODO
74    #if __cplusplus >= 201103L
75    #  define override override
76    #  define cpPlugins_DELETE_FUNCTION =delete
77    #  define cpPlugins_NULLPTR  nullptr
78    #  define cpPlugins_NOEXCEPT noexcept
79    #  define cpPlugins_HAS_CXX11_STATIC_ASSERT
80    #  define cpPlugins_HAS_CXX11_RVREF
81    #else // __cplusplus >= 201103L
82    #  define override
83    #  define cpPlugins_DELETE_FUNCTION
84    #  define cpPlugins_NULLPTR  NULL
85    #  define cpPlugins_NOEXCEPT throw()
86    #endif // __cplusplus >= 201103L
87 */
88
89 /*
90  * =========================================================================
91  * Some macros
92  * =========================================================================
93  */
94
95 #define cpPlugins_Id_Macro( _class, _category )                         \
96   public:                                                               \
97   virtual const char* GetClassName( ) const override          \
98   { return( #_class ); }                                                \
99   virtual const char* GetClassCategory( ) const override      \
100   { return( #_category ); }
101
102 #define cpPluginsObject( _cls, _scls, _cat )                            \
103   public:                                                               \
104   typedef _cls                            Self;                         \
105   typedef _scls                           Superclass;                   \
106   typedef itk::SmartPointer< Self >       Pointer;                      \
107   typedef itk::SmartPointer< const Self > ConstPointer;                 \
108   public:                                                               \
109   itkNewMacro( Self );                                                  \
110   itkTypeMacro( _cls, _scls );                                          \
111   public:                                                               \
112   virtual const char* GetClassName( ) const override          \
113   { return( #_cls ); }                                                  \
114   virtual const char* GetClassCategory( ) const override      \
115   { return( #_cat ); }                                                  \
116   protected:                                                            \
117   _cls( );                                                              \
118   virtual ~_cls( );                                                     \
119   virtual void _GenerateData( ) override;                     \
120   private:                                                              \
121   _cls( const Self& );                                                  \
122   Self& operator=( const Self& )
123
124 #define cpPlugins_Compatibility_Macro                           \
125   virtual bool IsCompatible(                                    \
126     const DataObject* other                                     \
127     ) const override                                  \
128   {                                                             \
129     return( dynamic_cast< const Self* >( other ) != NULL );     \
130   }
131
132 #endif // __cpPlugins__Config__h__
133
134 // eof - $RCSfile$