From: Leonardo Florez Valencia Date: Wed, 5 Oct 2016 04:48:53 +0000 (-0500) Subject: Windows compilation (1/3) X-Git-Tag: v0.1~98 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=c26e1b67af96bd1b11e8da2ab9145dbaf0140deb;p=cpPlugins.git Windows compilation (1/3) --- diff --git a/cmake/DetectOS.cmake b/cmake/DetectOS.cmake index bba8346..42621f8 100644 --- a/cmake/DetectOS.cmake +++ b/cmake/DetectOS.cmake @@ -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$ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 4d3d3b7..06182ce 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -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 == diff --git a/lib/cpBaseQtApplication/MainHelper.h b/lib/cpBaseQtApplication/MainHelper.h index 62857c3..24bab0c 100644 --- a/lib/cpBaseQtApplication/MainHelper.h +++ b/lib/cpBaseQtApplication/MainHelper.h @@ -17,7 +17,7 @@ // ------------------------------------------------------------------------- #include -#ifdef cpPlugins_Windows +#ifdef cpPlugins_OS_Windows # include # include @@ -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__ diff --git a/lib/cpExtensions/Config.h.in b/lib/cpExtensions/Config.h.in index 6ce007b..075c7eb 100644 --- a/lib/cpExtensions/Config.h.in +++ b/lib/cpExtensions/Config.h.in @@ -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 diff --git a/lib/cpExtensions/QT/SimpleMPRWidget.cxx b/lib/cpExtensions/QT/SimpleMPRWidget.cxx index 7721b25..4ccd631 100644 --- a/lib/cpExtensions/QT/SimpleMPRWidget.cxx +++ b/lib/cpExtensions/QT/SimpleMPRWidget.cxx @@ -217,6 +217,8 @@ GetViewProps( const std::string& name ) const if( w != NULL ) props.insert( w ); return( props ); */ + TProps props; + return( props ); } // ------------------------------------------------------------------------- diff --git a/lib/cpExtensions/Utility.h b/lib/cpExtensions/Utility.h index e78b420..065dadf 100644 --- a/lib/cpExtensions/Utility.h +++ b/lib/cpExtensions/Utility.h @@ -8,14 +8,13 @@ #include // ------------------------------------------------------------------------- -#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 ); } diff --git a/lib/cpExtensions/Visualization/MPR3DActors.cxx b/lib/cpExtensions/Visualization/MPR3DActors.cxx index 03778b4..b3f4700 100644 --- a/lib/cpExtensions/Visualization/MPR3DActors.cxx +++ b/lib/cpExtensions/Visualization/MPR3DActors.cxx @@ -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 ); } // ------------------------------------------------------------------------- diff --git a/lib/cpPlugins/OS/DLLManager.cxx b/lib/cpPlugins/OS/DLLManager.cxx index 274c7dc..ab3cf56 100644 --- a/lib/cpPlugins/OS/DLLManager.cxx +++ b/lib/cpPlugins/OS/DLLManager.cxx @@ -1,25 +1,25 @@ #include -#ifdef cpPlugins_SYS_WINDOWS +#ifdef cpPlugins_OS_Windows # include -#else // cpPlugins_SYS_WINDOWS +#else // cpPlugins_OS_Windows # include -#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 ); } diff --git a/plugins/IO/ImageWriter.cxx b/plugins/IO/ImageWriter.cxx index 2058339..ac61cb9 100644 --- a/plugins/IO/ImageWriter.cxx +++ b/plugins/IO/ImageWriter.cxx @@ -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." ); } diff --git a/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx b/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx index 9e19ba9..8b6b89d 100644 --- a/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx +++ b/plugins/ImageGenericFilters/RegionOfInterestImageFilter.cxx @@ -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." ); }