]> Creatis software - cpPlugins.git/commitdiff
Windows compilation (1/3)
authorLeonardo Florez Valencia <florez-l@javeriana.edu.co>
Wed, 5 Oct 2016 04:48:53 +0000 (23:48 -0500)
committerLeonardo Florez Valencia <florez-l@javeriana.edu.co>
Wed, 5 Oct 2016 04:48:53 +0000 (23:48 -0500)
cmake/DetectOS.cmake
lib/CMakeLists.txt
lib/cpBaseQtApplication/MainHelper.h
lib/cpExtensions/Config.h.in
lib/cpExtensions/QT/SimpleMPRWidget.cxx
lib/cpExtensions/Utility.h
lib/cpExtensions/Visualization/MPR3DActors.cxx
lib/cpPlugins/OS/DLLManager.cxx
plugins/IO/ImageWriter.cxx
plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx

index bba8346c04efe3f900a26246b93811ae2774bdb8..42621f82f4d720fb010c726cb84be94c373d668f 100644 (file)
@@ -17,7 +17,7 @@ ELSEIF("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
   SET(prj_NAME_LIB_PREFIX "")
   SET(prj_NAME_LIB_EXT ".dll")
   SET(prj_NAME_ENV_SEPARATOR ";")
-  SET(prj_NAME_PATH_SEPARATOR "\\")
+  SET(prj_NAME_PATH_SEPARATOR "\\\\")
 ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
 
 ## eof - $RCSfile$
index 4d3d3b720135a3f3400cbd992bf6f1209bb21876..06182ced53e7e48bdcda074845aedfd3139d7b13 100644 (file)
@@ -15,7 +15,7 @@ IF(Qt4_FOUND)
   TARGET_LINK_LIBRARIES(cpPlugins_QCustomPlot ${QT_LIBRARIES})
 ENDIF(Qt4_FOUND)
 LibFromDir(cpExtensions SHARED ${_dir}/cpExtensions ${_ver})
-TARGET_LINK_LIBRARIES(cpExtensions ${ITK_LIBRARIES} ${VTK_LIBRARIES})
+TARGET_LINK_LIBRARIES(cpExtensions ${ITK_LIBRARIES} ${VTK_LIBRARIES} ${QT_LIBRARIES})
 
 ## =====================
 ## == Build instances ==
index 62857c3eca35bfa1f182a0d1a72b91aa376077e5..24bab0c2c931f32846bb266f057cc1fdc5918795 100644 (file)
@@ -17,7 +17,7 @@
 // -------------------------------------------------------------------------
 #include <cpPlugins/Config.h>
 
-#ifdef cpPlugins_Windows
+#ifdef cpPlugins_OS_Windows
 
 #  include <memory>
 #  include <vector>
@@ -81,9 +81,9 @@ namespace cpBaseQtApplication
     cpBaseQtApplication::Win32CommandLineConverter cmd_line;            \
     return( main( cmd_line.argc( ), cmd_line.argv( ) ) );               \
   }
-#else  // cpPlugins_Windows
+#else  // cpPlugins_OS_Windows
 #  define cpBaseQtApplication_MainComplement
-#endif // cpPlugins_Windows
+#endif // cpPlugins_OS_Windows
 
 #endif // __cpBaseQtApplication__MainHelper__h__
 
index 6ce007bc8b6f5140c908690bea107bc0dbc05282..075c7eb650c3e83d2934be6586b0d0d63770bb08 100644 (file)
@@ -14,7 +14,7 @@
 #define cpExtensions_ENV_SEPARATOR  "@prj_NAME_ENV_SEPARATOR@"
 #define cpExtensions_PATH_SEPARATOR '@prj_NAME_PATH_SEPARATOR@'
 
-#ifdef cpPlugins_Windows
+#ifdef cpPlugins_OS_Windows
 #  ifndef WIN32_LEAN_AND_MEAN
 #    define WIN32_LEAN_AND_MEAN
 #  endif
index 7721b257b8690277433736a463fb0bfc5de8f5b3..4ccd631f7d31ec4b704392312c600fca77fea032 100644 (file)
@@ -217,6 +217,8 @@ GetViewProps( const std::string& name ) const
   if( w != NULL ) props.insert( w );
   return( props );
 */
+  TProps props;
+  return( props );
 }
 
 // -------------------------------------------------------------------------
index e78b42064b63bce22b13f312a9dd8006da2f3cf7..065dadf92fbee7f63f48b6cc2ff11f6180f0d572 100644 (file)
@@ -8,14 +8,13 @@
 #include <cpExtensions/Config.h>
 
 // -------------------------------------------------------------------------
-#ifdef cpPlugins_Windows
-#  define cpExtensions_STRTOK( A, B, N )  strtok_s(  A, B, N )
+#ifdef cpPlugins_OS_Windows
+#  define cpExtensions_STRTOK( A, B, N )  strtok_s( A, B, N )
 #  define cpExtensions_SPRINTF( B, S, O ) sprintf_s( B, S, "%s", O );
-#  define 
-#else // cpPlugins_Windows
+#else // cpPlugins_OS_Windows
 #  define cpExtensions_STRTOK( A, B, N )  std::strtok( A, B )
 #  define cpExtensions_SPRINTF( B, S, O ) std::sprintf( B, "%s", O );
-#endif // cpPlugins_Windows
+#endif // cpPlugins_OS_Windows
 
 // -------------------------------------------------------------------------
 #define cpExtensions_CHRONO                                             \
@@ -113,12 +112,12 @@ namespace cpExtensions
   inline std::string CanonicalPath( const std::string& path )
   {
     std::string ret = "";
-#ifdef cpPlugins_Windows
+#ifdef cpPlugins_OS_Windows
     TCHAR  buffer[ 4096 ] = TEXT( "" );
     TCHAR** lppPart = { NULL };
     GetFullPathName( path.c_str( ), 4096, buffer, lppPart );
     ret = std::string( buffer );
-#else // cpPlugins_Windows
+#else // cpPlugins_OS_Windows
     char* canonical_path = realpath( path.c_str( ), NULL );
     if( canonical_path != NULL )
     {
@@ -126,7 +125,7 @@ namespace cpExtensions
       free( canonical_path );
 
     } // fi
-#endif // cpPlugins_Windows
+#endif // cpPlugins_OS_Windows
     return( ret );
   }
 
index 03778b453728beccec2aefa9fdcf25b2cb286c6d..b3f47007840ae68700d8a79f7287bf6af7971939 100644 (file)
@@ -102,12 +102,14 @@ SetImage( vtkImageData* image )
 unsigned int cpExtensions::Visualization::MPR3DActors::
 AddLUTImage( vtkImageData* image )
 {
+  unsigned int res = 0;
   for( int i = 0; i < 3; ++i )
   {
-    this->m_Slices[ i ]->AddLUTImage( image );
+    res = this->m_Slices[ i ]->AddLUTImage( image );
     this->AddItem( this->m_Slices[ i ]->GetLUTImageActor( ) );
 
   } // rof
+  return( res );
 }
 
 // -------------------------------------------------------------------------
index 274c7dc208a76e697bfac59f591a5998477bae4e..ab3cf56d2e742f67b51a186b3eba612d3f932651 100644 (file)
@@ -1,25 +1,25 @@
 #include <cpPlugins/OS/DLLManager.h>
 
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
 #  include <Windows.h>
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
 #  include <dlfcn.h>
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
 
 // -------------------------------------------------------------------------
 void* cpPlugins::OS::DLLManager::
 Load( const std::string& fname, std::string& error )
 {
   void* hnd = NULL;
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
   hnd = ::LoadLibraryA( fname.c_str( ) );
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
   hnd = dlopen( fname.c_str( ), RTLD_LAZY | RTLD_GLOBAL );
   if( hnd == NULL )
     error = dlerror( );
   else
     dlerror( );
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
   return( hnd );
 }
 
@@ -27,11 +27,11 @@ Load( const std::string& fname, std::string& error )
 void cpPlugins::OS::DLLManager::
 UnLoad( void* hnd )
 {
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
   ::FreeLibrary( ( HMODULE )hnd );
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
   dlclose( hnd );
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
 }
 
 // -------------------------------------------------------------------------
@@ -41,11 +41,11 @@ GetFunctionHandle( void* hnd, const std::string& function )
   void* f = NULL;
   if( hnd != NULL )
   {
-#ifdef cpPlugins_SYS_WINDOWS
+#ifdef cpPlugins_OS_Windows
     f = ::GetProcAddress( ( HMODULE )hnd, function.c_str( ) );
-#else // cpPlugins_SYS_WINDOWS
+#else // cpPlugins_OS_Windows
     f = dlsym( hnd, function.c_str( ) );
-#endif // cpPlugins_SYS_WINDOWS
+#endif // cpPlugins_OS_Windows
   } // fi
   return( f );
 }
index 2058339b615061034cbc0c86f53d2eb6d7ebca55..ac61cb94936cd6964808ed65ea59e09b4bbbedc7 100644 (file)
@@ -118,7 +118,7 @@ void cpPluginsIO::ImageWriter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageAll_Dims( o, _GD0 );
+  cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
   else this->_Error( "Invalid input image." );
 }
 
index 9e19ba96285b54d0f31f7232269d4234ca53a593..8b6b89df1aae31b725c29a3199abf012c3a4b796 100644 (file)
@@ -27,7 +27,7 @@ void cpPluginsImageGenericFilters::RegionOfInterestImageFilter::
 _GenerateData( )
 {
   auto o = this->GetInputData( "Input" );
-  cpPlugins_Demangle_ImageAll_Dims( o, _GD0 );
+  cpPlugins_Demangle_ImageScalars_Dims( o, _GD0 );
   else this->_Error( "Invalid input image." );
 }