]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/Config.h.in
Windows compilation: 3/3
[cpPlugins.git] / lib / cpPlugins / Config.h.in
index 6cec4adba2ace6e7f9b2cf827765c14888e1baac..1c0f1066d1a4716fa70ad353ac2e8cf14909175c 100644 (file)
-#ifndef __CPPLUGINS__CONFIG__H__
-#define __CPPLUGINS__CONFIG__H__
+#ifndef __@prj_NAME@__h__
+#define __@prj_NAME@__h__
 
-#include <cpPlugins/cpPlugins_Export.h>
-#include <cpPlugins_Config.h>
-#include <string>
+#define ITK_MANUAL_INSTANTIATION
+#include <@prj_NAME@_Export.h>
+#include <stdexcept>
 
 /*
  * =========================================================================
- * Version numbers and strings
+ * Identify OS
  * =========================================================================
  */
-#define cpPlugins_MAJ_VER @prj_MAJ_VER@
-#define cpPlugins_MIN_VER @prj_MIN_VER@
-#define cpPlugins_REL_VER @prj_REL_VER@
-#define cpPlugins_VER     "@prj_VER@"
-#define cpPlugins_sVER    "@prj_sVER@"
+#define @prj_NAME_OS@
+#define @prj_NAME@_LIB_PREFIX     "@prj_NAME_LIB_PREFIX@"
+#define @prj_NAME@_LIB_EXT        "@prj_NAME_LIB_EXT@"
+#define @prj_NAME@_ENV_SEPARATOR  "@prj_NAME_ENV_SEPARATOR@"
+#define @prj_NAME@_PATH_SEPARATOR "@prj_NAME_PATH_SEPARATOR@"
+
+#ifdef @prj_NAME@_OS_Windows
+#  ifndef WIN32_LEAN_AND_MEAN
+#    define WIN32_LEAN_AND_MEAN
+#  endif
+#  define NOMINMAX
+#  include <windows.h>
+#  include <tchar.h>
+#endif // @prj_NAME@_OS_Windows
 
 /*
  * =========================================================================
- * Some useful constants and values
+ * Some global values
  * =========================================================================
  */
 
-#define cpPlugins_CONFIG_FILE "plugins.cfg"
-
-#define cpPlugins_QT4_USED @QT4_FOUND@
-#if cpPlugins_QT4_USED == 1
-#  define cpPlugins_QT4
-#else // cpPlugins_QT4_USED == 1
-#  undef cpPlugins_QT4
-#endif // cpPlugins_QT4_USED == 1
+#define @prj_NAME@_PATHS "@prj_NAME@_PATHS"
+#define @prj_NAME@_CONFIG "@prj_NAME@_Libraries.config"
+#define @prj_NAME@_QT4_USED @QT4_FOUND@
+#if @prj_NAME@_QT4_USED == 1
+#  define @prj_NAME@_QT4
+#  define @prj_NAME@_QVTKWidget @cpPlugins_Qt4_VTKWidget@
+#  include <@cpPlugins_Qt4_VTKWidget@.h>
+#else // @prj_NAME@_QT4_USED == 1
+#  undef @prj_NAME@_QT4
+#endif // @prj_NAME@_QT4_USED == 1
 
 /*
  * =========================================================================
- * Identify OS
+ * Version numbers and strings
  * =========================================================================
  */
-#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 <windows.h>
-#  include <tchar.h>
-#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
+
+#define @prj_NAME@_MAJOR_VERSION   @prj_MAJ_VER@
+#define @prj_NAME@_MINOR_VERSION   @prj_MIN_VER@
+#define @prj_NAME@_RELEASE_VERSION @prj_REL_VER@
+#define @prj_NAME@_VERSION         "@prj_VERSION@"
+#define @prj_NAME@_SHORT_VERSION   "@prj_SHORT_VERSION@"
+#define @prj_NAME@_OpenGL_BackEnd_@VTK_RENDERING_BACKEND@
 
 /*
  * =========================================================================
- * Some macros
+ * Language related macros
  * =========================================================================
  */
-#define cpPlugins_Id_Macro( N, C )                                      \
-  public:                                                               \
-  virtual const char* GetClassName( )     override { return( #N ); }    \
-  virtual const char* GetClassCategory( ) override { return( #C ); }
+
+#if __cplusplus >= 201103L
+#  define @prj_NAME@_OVERRIDE override
+#  define @prj_NAME@_DELETE_FUNCTION =delete
+#  define @prj_NAME@_NULLPTR  nullptr
+#  define @prj_NAME@_NOEXCEPT noexcept
+#  define @prj_NAME@_HAS_CXX11_STATIC_ASSERT
+#  define @prj_NAME@_HAS_CXX11_RVREF
+#else // __cplusplus >= 201103L
+#  define @prj_NAME@_OVERRIDE
+#  define @prj_NAME@_DELETE_FUNCTION
+#  define @prj_NAME@_NULLPTR  NULL
+#  define @prj_NAME@_NOEXCEPT throw()
+#endif // __cplusplus >= 201103L
 
 /*
  * =========================================================================
- * Some functions
+ * Some macros
  * =========================================================================
  */
-#include <iostream>
-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 );
+#define @prj_NAME@_Id_Macro( _class, _category )                        \
+  public:                                                               \
+  virtual const char* GetClassName( ) const @prj_NAME@_OVERRIDE         \
+  { return( #_class ); }                                                \
+  virtual const char* GetClassCategory( ) const @prj_NAME@_OVERRIDE     \
+  { return( #_category ); }
 
-        } // fi
-#endif // cpPlugins_SYS_WINDOWS
-        return( ret );
-      }
-  };
+#define @prj_NAME@Object( _cls, _scls, _cat )                           \
+  public:                                                               \
+  typedef _cls                            Self;                         \
+  typedef _scls                           Superclass;                   \
+  typedef itk::SmartPointer< Self >       Pointer;                      \
+  typedef itk::SmartPointer< const Self > ConstPointer;                 \
+  public:                                                               \
+  itkNewMacro( Self );                                                  \
+  itkTypeMacro( _cls, _scls );                                          \
+  public:                                                               \
+  virtual const char* GetClassName( ) const @prj_NAME@_OVERRIDE         \
+  { return( #_cls ); }                                                  \
+  virtual const char* GetClassCategory( ) const @prj_NAME@_OVERRIDE     \
+  { return( #_cat ); }                                                  \
+  protected:                                                            \
+  _cls( );                                                              \
+  virtual ~_cls( );                                                     \
+  virtual void _GenerateData( ) @prj_NAME@_OVERRIDE;                    \
+  private:                                                              \
+  _cls( const Self& );                                                  \
+  Self& operator=( const Self& )
 
-} // ecapseman
+#define @prj_NAME@_Compatibility_Macro                                  \
+  virtual bool IsCompatible(                                            \
+    const DataObject* other                                             \
+    ) const @prj_NAME@_OVERRIDE                                         \
+  {                                                                     \
+  return( dynamic_cast< const Self* >( other ) != NULL );               \
+  }
 
-#endif // __CPPLUGINS__CONFIG__H__
+#endif // __@prj_NAME@__h__
 
 // eof - $RCSfile$