File pfstools-Qt5.patch of Package pfstools
Index: pfstools-2.0.6/CMakeLists.txt
===================================================================
--- pfstools-2.0.6.orig/CMakeLists.txt
+++ pfstools-2.0.6/CMakeLists.txt
@@ -174,17 +174,17 @@ OPTION(WITH_QT "Use QT library" ON)
if( WITH_QT )
- find_package(Qt4)
- if( NOT QT_FOUND )
- MESSAGE( STATUS "Qt4 library not found. The following commands
+ find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
+ if( NOT Qt5_FOUND )
+ MESSAGE( STATUS "Qt5 libraries not found. The following commands
will not be compiled: pfsview. " )
- else( NOT QT_FOUND )
- MESSAGE( STATUS "Qt4 found" )
- endif( NOT QT_FOUND )
+ else( NOT Qt5_FOUND )
+ MESSAGE( STATUS "Qt5 found" )
+ endif( NOT Qt5_FOUND )
else( WITH_QT )
- set( QT_FOUND OFF )
+ set( Qt5_FOUND OFF )
endif( WITH_QT )
Index: pfstools-2.0.6/src/pfsview/CMakeLists.txt
===================================================================
--- pfstools-2.0.6.orig/src/pfsview/CMakeLists.txt
+++ pfstools-2.0.6/src/pfsview/CMakeLists.txt
@@ -1,4 +1,4 @@
-include_directories ("${PROJECT_BINARY_DIR}/" "${PROJECT_SOURCE_DIR}/src/pfs" ${QT_INCLUDES})
+include_directories ("${PROJECT_BINARY_DIR}/" "${PROJECT_SOURCE_DIR}/src/pfs" "${Qt5Widgets_INCLUDE_DIRS}")
if( NOT HAS_GETOPT )
include_directories ("${GETOPT_INCLUDE}")
endif( NOT HAS_GETOPT )
@@ -14,9 +14,9 @@ if (OPENMP_FOUND)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
-QT4_WRAP_CPP(pfsview_HEADERS_MOC ${pfsview_HEADERS})
+QT5_WRAP_CPP(pfsview_HEADERS_MOC ${pfsview_HEADERS})
-QT4_WRAP_CPP(pfsview_HEADERS_MOC ${pfsview_HEADERS})
+QT5_WRAP_CPP(pfsview_HEADERS_MOC ${pfsview_HEADERS})
# Replace the tag with the path to bash
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/pfsv.in file_content)
@@ -30,7 +30,7 @@ install (FILES "${CMAKE_CURRENT_BINARY_D
ADD_EXECUTABLE(pfsview ${pfsview_SOURCES}
${pfsview_HEADERS_MOC} "${GETOPT_OBJECT}")
-TARGET_LINK_LIBRARIES(pfsview pfs ${QT_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY})
+TARGET_LINK_LIBRARIES(pfsview pfs Qt5::Widgets)
install (TARGETS pfsview DESTINATION bin)
install (FILES pfsview.1 DESTINATION ${MAN_DIR})
Index: pfstools-2.0.6/src/pfsview/main.cpp
===================================================================
--- pfstools-2.0.6.orig/src/pfsview/main.cpp
+++ pfstools-2.0.6/src/pfsview/main.cpp
@@ -460,7 +460,7 @@ void PFSViewMainWin::updatePointerValue(
} else { // Single channel
const QString &name = channelSelection->itemText( channelSel );
- sprintf( pointerValueStr, "%s=%07.4g", (const char*)name.toAscii(), pv.value[0] );
+ sprintf( pointerValueStr, "%s=%07.4g", (const char*)name.toLatin1(), pv.value[0] );
label += pointerValueStr;
lumRange->showValuePointer( log10(pv.value[0]) );
}
@@ -547,7 +547,7 @@ void PFSViewMainWin::setChannelSelection
if( pfsView->hasColorChannels() && selectedChannel < scLabelsCount ) {
pfsView->setVisibleChannel( NULL ); // Color
} else {
- pfsView->setVisibleChannel( (const char*)name.toAscii() );
+ pfsView->setVisibleChannel( (const char*)name.toLatin1() );
}
updateMenuEnable( );
Index: pfstools-2.0.6/src/CMakeLists.txt
===================================================================
--- pfstools-2.0.6.orig/src/CMakeLists.txt
+++ pfstools-2.0.6/src/CMakeLists.txt
@@ -10,9 +10,9 @@ if( ImageMagick_FOUND )
add_subdirectory (hdrhtml)
endif( ImageMagick_FOUND )
-if( QT_FOUND )
+if( Qt5_FOUND )
add_subdirectory (pfsview)
-endif( QT_FOUND )
+endif( Qt5_FOUND )
if( MATLAB_FOUND )
add_subdirectory (matlab)