1 #ifndef __CPPLUGINS__CONFIG__H__
2 #define __CPPLUGINS__CONFIG__H__
4 #include <cpPlugins/cpPlugins_Export.h>
8 * =========================================================================
9 * Version numbers and strings
10 * =========================================================================
12 #define cpPlugins_MAJ_VER @prj_MAJ_VER@
13 #define cpPlugins_MIN_VER @prj_MIN_VER@
14 #define cpPlugins_REL_VER @prj_REL_VER@
15 #define cpPlugins_VER "@prj_VER@"
16 #define cpPlugins_sVER "@prj_sVER@"
19 * =========================================================================
20 * Some useful constants and values
21 * =========================================================================
24 #define ITK_MANUAL_INSTANTIATION
25 #define cpPlugins_CONFIG_FILE "plugins.cfg"
27 #define cpPlugins_QT4_USED @QT4_FOUND@
28 #if cpPlugins_QT4_USED == 1
29 # define cpPlugins_QT4
30 #else // cpPlugins_QT4_USED == 1
32 #endif // cpPlugins_QT4_USED == 1
35 * =========================================================================
37 * =========================================================================
39 #if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
40 # define cpPlugins_SYS_WINDOWS
41 # define cpPlugins_PLUGIN_PREFIX ""
42 # define cpPlugins_PLUGIN_EXT "dll"
43 # ifndef WIN32_LEAN_AND_MEAN
44 # define WIN32_LEAN_AND_MEAN
49 #elif defined( linux ) || defined( __linux )
50 # define cpPlugins_SYS_LINUX
51 # define cpPlugins_PLUGIN_PREFIX "lib"
52 # define cpPlugins_PLUGIN_EXT "so"
53 #elif defined( __APPLE__ ) || defined( MACOSX ) || defined( macintosh ) || defined( Macintosh )
54 # define cpPlugins_SYS_MACOS
55 # define cpPlugins_PLUGIN_PREFIX "lib"
56 # define cpPlugins_PLUGIN_EXT "dylib"
57 #elif defined( __FreeBSD__ ) || defined( __FreeBSD_kernel__ )
58 # define cpPlugins_SYS_FREEBSD
59 # define cpPlugins_PLUGIN_PREFIX "lib"
60 # define cpPlugins_PLUGIN_EXT "so"
62 # error "This operating system is not supported by cpPlugins"
66 * =========================================================================
68 * =========================================================================
70 #define cpPlugins_Id_Macro( N, C ) \
72 virtual const char* GetClassName( ) override { return( #N ); } \
73 virtual const char* GetClassCategory( ) override { return( #C ); }
76 * =========================================================================
78 * =========================================================================
84 // ---------------------------------------------------------------------
85 inline bool operator()( char c ) const
87 #ifdef cpPlugins_SYS_WINDOWS
88 return( c == '\\' || c == '/' );
89 #else // cpPlugins_SYS_WINDOWS
91 #endif // cpPlugins_SYS_WINDOWS
94 // ---------------------------------------------------------------------
95 inline static std::string CanonicalPath( const std::string& path )
97 #ifdef cpPlugins_SYS_WINDOWS
98 TCHAR buffer[ 4096 ] = TEXT( "" );
99 TCHAR** lppPart = { NULL };
100 GetFullPathName( path.c_str( ), 4096, buffer, lppPart );
101 return( std::string( buffer ) );
102 #else // cpPlugins_SYS_WINDOWS
103 return( std::string( realpath( path.c_str( ), NULL ) ) );
104 #endif // cpPlugins_SYS_WINDOWS
110 #endif // __CPPLUGINS__CONFIG__H__