X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=lib%2FcpPlugins%2FConfig.h.in;h=c7668b578bd4af586dab0f6941c52aec6164438c;hb=adb38e2972e7c2e287e73c7b03db344807729219;hp=f33375a5ee8dfd045dbf74e9b70e122112302168;hpb=b67cad9ff3c38b4e99ac48a4852e9e94cb879c6a;p=cpPlugins.git diff --git a/lib/cpPlugins/Config.h.in b/lib/cpPlugins/Config.h.in index f33375a..c7668b5 100644 --- a/lib/cpPlugins/Config.h.in +++ b/lib/cpPlugins/Config.h.in @@ -2,6 +2,7 @@ #define __CPPLUGINS__CONFIG__H__ #include +#include #include /* @@ -21,9 +22,6 @@ * ========================================================================= */ -#define ITK_MANUAL_INSTANTIATION -#define cpPlugins_CONFIG_FILE "plugins.cfg" - #define cpPlugins_QT4_USED @QT4_FOUND@ #if cpPlugins_QT4_USED == 1 # define cpPlugins_QT4 @@ -31,37 +29,6 @@ # undef cpPlugins_QT4 #endif // cpPlugins_QT4_USED == 1 -/* - * ========================================================================= - * Identify OS - * ========================================================================= - */ -#if defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) -# define cpPlugins_SYS_WINDOWS -# define cpPlugins_PLUGIN_PREFIX "" -# define cpPlugins_PLUGIN_EXT "dll" -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# endif -# define NOMINMAX -# include -# include -#elif defined( linux ) || defined( __linux ) -# define cpPlugins_SYS_LINUX -# define cpPlugins_PLUGIN_PREFIX "lib" -# define cpPlugins_PLUGIN_EXT "so" -#elif defined( __APPLE__ ) || defined( MACOSX ) || defined( macintosh ) || defined( Macintosh ) -# define cpPlugins_SYS_MACOS -# define cpPlugins_PLUGIN_PREFIX "lib" -# define cpPlugins_PLUGIN_EXT "dylib" -#elif defined( __FreeBSD__ ) || defined( __FreeBSD_kernel__ ) -# define cpPlugins_SYS_FREEBSD -# define cpPlugins_PLUGIN_PREFIX "lib" -# define cpPlugins_PLUGIN_EXT "so" -#else -# error "This operating system is not supported by cpPlugins" -#endif - /* * ========================================================================= * Some macros @@ -69,52 +36,10 @@ */ #define cpPlugins_Id_Macro( N, C ) \ public: \ - virtual const char* GetClassName( ) override { return( #N ); } \ - virtual const char* GetClassCategory( ) override { return( #C ); } - -/* - * ========================================================================= - * Some functions - * ========================================================================= - */ -#include -namespace cpPlugins -{ - struct PathHelper - { - // --------------------------------------------------------------------- - inline bool operator()( char c ) const - { -#ifdef cpPlugins_SYS_WINDOWS - return( c == '\\' || c == '/' ); -#else // cpPlugins_SYS_WINDOWS - return( c == '/' ); -#endif // cpPlugins_SYS_WINDOWS - } - - // --------------------------------------------------------------------- - inline static std::string CanonicalPath( const std::string& path ) - { - std::string ret = ""; -#ifdef cpPlugins_SYS_WINDOWS - TCHAR buffer[ 4096 ] = TEXT( "" ); - TCHAR** lppPart = { NULL }; - GetFullPathName( path.c_str( ), 4096, buffer, lppPart ); - ret = std::string( buffer ); -#else // cpPlugins_SYS_WINDOWS - char* canonical_path = realpath( path.c_str( ), NULL ); - if( canonical_path != NULL ) - { - ret = canonical_path; - free( canonical_path ); - - } // fi -#endif // cpPlugins_SYS_WINDOWS - return( ret ); - } - }; - -} // ecapseman + virtual const char* GetClassName( ) const ITK_OVERRIDE \ + { return( #N ); } \ + virtual const char* GetClassCategory( ) const ITK_OVERRIDE \ + { return( #C ); } #endif // __CPPLUGINS__CONFIG__H__