diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40569e3..27910b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,6 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.4)
+
+cmake_policy(SET CMP0025 NEW)
project(hdrmerge)
@@ -10,22 +12,42 @@ if(WIN32)
endif()
endif()
-# Complain about anything, except ignored OpenMP pragma in Debug
+if(APPLE)
+ if(NOT(ALGLIB_ROOT))
+ message(FATAL_ERROR "Passage of ALGLIB_ROOT to cmake failed. Download alglib and define its root directory in ALGLIB_ROOT")
+ else()
+ message(STATUS "ALGLIB_ROOT = ${ALGLIB_ROOT}")
+ endif()
+endif()
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-unknown-pragmas")
set(PLATFORM "")
# Required and optional packages
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake")
-find_package(Qt4 REQUIRED QtCore QtGui)
-include(${QT_USE_FILE})
+# Find includes in corresponding build directories
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+# Instruct CMake to run moc automatically when needed.
+set(CMAKE_AUTOMOC ON)
+
+# Generate resources automatically
+set(CMAKE_AUTORCC ON)
+
+find_package(Qt5 5.6 REQUIRED Core Widgets)
+
+#include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
+
find_package(LibRaw REQUIRED)
find_package(Exiv2 REQUIRED)
find_package(ZLIB REQUIRED)
-find_package(Boost 1.46 COMPONENTS unit_test_framework)
find_package(OpenMP)
+# Commented-out as it doesn't link
+#find_package(Boost 1.46 COMPONENTS unit_test_framework)
+
if(WIN32)
set(ALGLIB_INCLUDES ${ALGLIB_ROOT}/src)
else()
@@ -58,15 +80,13 @@ set(HDRMERGE_VERSION_MINOR 5)
set(HDRMERGE_VERSION_REV 0)
set(HDRMERGE_VERSION ${HDRMERGE_VERSION_MAJOR}.${HDRMERGE_VERSION_MINOR}.${HDRMERGE_VERSION_REV})
-# configure a header file to pass some of the CMake settings
-# to the source code
+# configure a header file to pass some of the CMake settings to the source code
configure_file(
"${PROJECT_SOURCE_DIR}/src/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
-# add the binary tree to the search path for include files
-# so that we will find config.h
+# add the binary tree to the search path for include files so that we will find config.h
include_directories("${PROJECT_BINARY_DIR}")
set(PLATFORM_SOURCES "")
@@ -88,7 +108,7 @@ elseif(APPLE)
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${HDRMERGE_VERSION}")
set(MACOSX_BUNDLE_BUNDLE_VERSION "${HDRMERGE_VERSION}")
set(MACOSX_BUNDLE_INFO_COPYRIGHT "Copyright 2018 Javier Celaya")
- set(PLATFORM_SOURCES "images/icon.icns")
+ set(PLATFORM_SOURCES "data/images/icon.icns")
endif()
# Sources and headers
@@ -145,10 +165,27 @@ if(WIN32)
)
endif()
+if(APPLE)
+ set(alglib_sources
+ ${ALGLIB_ROOT}/src/alglibinternal.cpp
+ ${ALGLIB_ROOT}/src/alglibmisc.cpp
+ ${ALGLIB_ROOT}/src/ap.cpp
+ ${ALGLIB_ROOT}/src/dataanalysis.cpp
+ ${ALGLIB_ROOT}/src/diffequations.cpp
+ ${ALGLIB_ROOT}/src/fasttransforms.cpp
+ ${ALGLIB_ROOT}/src/integration.cpp
+ ${ALGLIB_ROOT}/src/interpolation.cpp
+ ${ALGLIB_ROOT}/src/linalg.cpp
+ ${ALGLIB_ROOT}/src/optimization.cpp
+ ${ALGLIB_ROOT}/src/solvers.cpp
+ ${ALGLIB_ROOT}/src/specialfunctions.cpp
+ ${ALGLIB_ROOT}/src/statistics.cpp
+ )
+endif()
+
# Libs
set(hdrmerge_libs
"${LibRaw_r_LIBRARIES}"
- "${QT_LIBRARIES}"
"${EXIV2_LIBRARY}"
"${ZLIB_LIBRARIES}"
)
@@ -176,15 +213,13 @@ else()
)
endif()
-# Qt4 intermediate files
-QT4_WRAP_CPP(hdrmerge_moc ${hdrmerge_qobject_headers})
-QT4_ADD_TRANSLATION(hdrmerge_qm ${hdrmerge_translations})
+#QT4_ADD_TRANSLATION(hdrmerge_qm ${hdrmerge_translations})
# Generate the XML version of hdrmerge_qm
foreach(file ${hdrmerge_qm})
get_filename_component(basename ${file} NAME)
set(HDRMERGE_QM_XML "${HDRMERGE_QM_XML}
- ${basename}")
+ ${basename}")
endforeach()
configure_file(
@@ -192,80 +227,106 @@ configure_file(
"${PROJECT_BINARY_DIR}/translations.qrc"
)
-QT4_ADD_RESOURCES(hdrmerge_rsrc
- "${PROJECT_BINARY_DIR}/translations.qrc"
- data/resources.qrc
-)
-
if(WIN32)
- add_library(alglib-objects OBJECT
- ${alglib_sources}
- )
+ add_library(alglib-objects OBJECT ${alglib_sources})
endif()
-add_library(hdrmerge-objects OBJECT
- ${hdrmerge_sources}
- ${hdrmerge_rsrc}
-)
-
-add_library(hdrmerge-gui-objects OBJECT
- ${hdrmerge_gui_sources}
- ${hdrmerge_moc}
-)
+if(APPLE)
+ add_library(alglib-objects OBJECT ${alglib_sources})
+endif()
if(WIN32)
add_executable(hdrmerge ${PLATFORM}
src/main.cpp
src/Launcher.cpp
- $
- $
+ data/resources.qrc
+ ${hdrmerge_translations}
+ ${hdrmerge_sources}
+ ${hdrmerge_gui_sources}
+ ${hdrmerge_moc}
$
"${PLATFORM_SOURCES}"
)
+elseif(APPLE)
+ add_executable(hdrmerge ${PLATFORM}
+ src/main.cpp
+ src/Launcher.cpp
+ $
+ ${hdrmerge_translations}
+ ${hdrmerge_sources}
+ ${hdrmerge_gui_sources}
+ ${hdrmerge_moc}
+ "${PLATFORM_SOURCES}"
+ )
else()
add_executable(hdrmerge ${PLATFORM}
src/main.cpp
src/Launcher.cpp
- $
- $
+ data/resources.qrc
+ ${hdrmerge_translations}
+ ${hdrmerge_sources}
+ ${hdrmerge_gui_sources}
+ ${hdrmerge_moc}
"${PLATFORM_SOURCES}"
)
endif()
-target_link_libraries(hdrmerge ${STRIP} ${hdrmerge_libs})
+target_link_libraries(hdrmerge ${STRIP} ${hdrmerge_libs} Qt5::Widgets)
if(WIN32)
# Compile a target without GUI, for the .com executable
add_executable(hdrmerge-nogui
src/main.cpp
src/Launcher.cpp
- $
+ data/resources.qrc
+ ${hdrmerge_translations}
+ ${hdrmerge_sources}
+ ${hdrmerge_moc}
$
"${PLATFORM_SOURCES}"
)
- target_link_libraries(hdrmerge-nogui ${STRIP} ${hdrmerge_libs})
+
+ # WARNING: ImageIO class need QImage which need Qt5::Widgets
+ # Launcher.cpp need QApplication which need Qt5::Widgets
+ target_link_libraries(hdrmerge-nogui ${STRIP} ${hdrmerge_libs} Qt5::Widgets Qt5::Core)
set_target_properties(hdrmerge-nogui PROPERTIES COMPILE_DEFINITIONS "NO_GUI")
# Create the installer with makensis
find_program(MAKENSIS_EXECUTABLE makensis.exe PATH_SUFFIXES "NSIS/Bin")
if(MAKENSIS_EXECUTABLE)
- message(STATUS "NSIS found!")
+ message(STATUS "NSIS found")
set(SETUP_PROG hdrmerge-setup${WIN_ARCH}-${HDRMERGE_VERSION}.exe)
- configure_file(
- "${PROJECT_SOURCE_DIR}/data/setup.nsi"
- "${PROJECT_BINARY_DIR}/setup.nsi" @ONLY
- )
- add_custom_command(OUTPUT ${SETUP_PROG}
- COMMAND "${MAKENSIS_EXECUTABLE}" -V2 setup.nsi
- MAIN_DEPENDENCY setup.nsi
- DEPENDS "${PROJECT_BINARY_DIR}/hdrmerge.exe"
- WORKING_DIRECTORY "${PROJECT_BINARY_DIR}")
- add_custom_target(hdrmerge-setup ALL DEPENDS "${PROJECT_BINARY_DIR}/${SETUP_PROG}")
+ string(REPLACE "/" "\\" PROJ_SRC_DIR "${PROJECT_SOURCE_DIR}")
+ message(STATUS "PROJ_SRC_DIR = ${PROJ_SRC_DIR}")
+
+ # ASSUMING YOU'RE USING EXIV2 BUNDLED WITH MSYS2
+ find_program(MINGW_LIB_DIR exiv2.exe)
+ if(MINGW_LIB_DIR)
+ get_filename_component(MINGW_LIB_DIR "${MINGW_LIB_DIR}" PATH)
+ string(REPLACE "/" "\\" MINGW_LIB_DIR "${MINGW_LIB_DIR}")
+ message(STATUS "MINGW_LIB_DIR = ${MINGW_LIB_DIR}")
+
+ set(QT5_PLUGINS_DIR "${MINGW_LIB_DIR}\\..\\share\\qt5\\plugins")
+ message(STATUS "QT5_PLUGINS_DIR = ${QT5_PLUGINS_DIR}")
+
+ configure_file(
+ "${PROJECT_SOURCE_DIR}/data/setup.nsi"
+ "${PROJECT_BINARY_DIR}/setup.nsi" @ONLY
+ )
+ add_custom_command(OUTPUT ${SETUP_PROG}
+ COMMAND "${MAKENSIS_EXECUTABLE}" -V2 setup.nsi
+ MAIN_DEPENDENCY setup.nsi
+ DEPENDS "${PROJECT_BINARY_DIR}/hdrmerge.exe"
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}")
+ add_custom_target(hdrmerge-setup ALL DEPENDS "${PROJECT_BINARY_DIR}/${SETUP_PROG}")
+ else(MINGW_LIB_DIR)
+ message(STATUS "Unable to locate the 'bin' directory to get the dependencies")
+ endif(MINGW_LIB_DIR)
else()
- message(STATUS "NSIS not found!")
+ message(STATUS "NSIS not found")
endif()
elseif(APPLE)
set_source_files_properties(images/icon.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
- install(TARGETS hdrmerge BUNDLE DESTINATION "/Applications")
+ install(TARGETS hdrmerge BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR})
else()
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
set(CMAKE_INSTALL_BINDIR "bin")
@@ -280,7 +341,7 @@ else()
"${PROJECT_BINARY_DIR}/hdrmerge.desktop"
)
install(CODE "
- execute_process(COMMAND \"${XDG-ICON-RESOURCE_EXECUTABLE}\" install --novendor --size 128 \"${PROJECT_SOURCE_DIR}/images/icon.png\" hdrmerge-icon)
+ execute_process(COMMAND \"${XDG-ICON-RESOURCE_EXECUTABLE}\" install --novendor --size 128 \"${PROJECT_SOURCE_DIR}/data/images/icon.png\" hdrmerge-icon)
execute_process(COMMAND \"${XDG-DESKTOP-MENU_EXECUTABLE}\" install --novendor \"${PROJECT_BINARY_DIR}/hdrmerge.desktop\")"
)
endif()
diff --git a/INSTALL.md b/INSTALL.md
index 77c91e6..40907f9 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -4,13 +4,13 @@ This document explains how to compile HDRMerge.
## Dependencies
- [ALGLIB](http://www.alglib.net/)
- [Boost](http://www.boost.org/)
-- [CMake](https://cmake.org/)
+- [CMake](https://cmake.org/) 3.4
- [exiv2](http://www.exiv2.org/)
- [gettext](http://www.gnu.org/software/gettext/)
- [libexpat](http://expat.sourceforge.net/)
- [libiconv](https://www.gnu.org/software/libiconv/)
- [LibRaw](http://www.libraw.org/)
-- [Qt](http://qt-project.org/) 4.8
+- [Qt](https://www.qt.io/) 5.6
- [zlib](http://www.zlib.net/)
Install the dependencies and proceed to the next section.
@@ -18,19 +18,19 @@ Install the dependencies and proceed to the next section.
### Arch and derivatives
```bash
sudo pacman -Syy
-sudo pacman -S --needed cmake libraw pacaur qt4
+sudo pacman -S --needed cmake libraw pacaur qt5
pacaur -S alglib
```
### Debian/Ubuntu and derivatives
```bash
sudo apt update
-sudo apt install build-essential cmake git libalglib-dev libboost-all-dev libexiv2-dev libexpat-dev libraw-dev qt4-default zlib1g-dev
+sudo apt install build-essential cmake git libalglib-dev libboost-all-dev libexiv2-dev libexpat-dev libraw-dev qt5-default zlib1g-dev
```
### Gentoo and derivatives
```bash
-sudo emerge -uva sci-libs/alglib dev-libs/boost dev-util/cmake media-gfx/exiv2 dev-vcs/git media-libs/libraw sys-devel/gettext dev-libs/expat virtual/libiconv dev-qt/qtcore:4 sys-libs/zlib
+sudo emerge -uva sci-libs/alglib dev-libs/boost dev-util/cmake media-gfx/exiv2 dev-vcs/git media-libs/libraw sys-devel/gettext dev-libs/expat virtual/libiconv dev-qt/qtcore:5 sys-libs/zlib
```
## Compilation in Windows
@@ -68,6 +68,7 @@ For the 32-bit version, substitute `x86_64-w64-mingw32` for `i686-w64-mingw32` e
You will need to build/download the following libraries:
- Qt
+_**TODO**: Update to Qt5_
Unpack Qt and build it as:
```bash
./configure -static -xplatform win32-g++ -device-option CROSS_COMPILE=x86_64-w64-mingw32- -prefix $HOME/usr/x86_64-w64-mingw32/Qt-4.8.6-static -opensource -qt-sql-sqlite -no-qt3support -no-xmlpatterns -no-multimedia -no-phonon -no-webkit -no-javascript-jit -no-script -no-scripttools -no-declarative -qt-zlib -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg -no-openssl -no-nis -no-cups -no-dbus -qt-freetype -make libs -nomake tools -nomake examples -nomake tests -qtlibinfix 4
@@ -109,6 +110,7 @@ libexpat is built with GNU Autoconf:
```
Once you have the dependencies installed, you are ready to compile HDRMerge.
+_**TODO**: Is QT_ROOT still valid in Qt5?_
Set the CMake variable `QT_ROOT` to where you have the Qt libraries installed.
```bash
diff --git a/README.md b/README.md
index 8759a3f..561a795 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,15 @@ Report bugs by creating a new issue on our GitHub page:
https://github.com/jcelaya/hdrmerge/issues
## Changelog:
+- v1.0 (not released yet)
+ - Allow user to specify custom white level in case of artifacts with automatically computed white level from LibRaw.
+ - Added support for raw files from Fufjifilm X-Trans sensors.
+ - Speed optimization.
+ - Assume aperture of f/8 if the aperture is invalid.
+ - Migrated from Qt4 to Qt5.
+ - Enable compilation in Windows.
+ - Documentation updated.
+ - Repository tree restructured.
- v0.5.0:
- First Mac OS X build! Thanks to Philip Ries for his help.
- Several bug fixes:
diff --git a/appimage/appimage.sh b/appimage/appimage.sh
index 5deea6a..c201fee 100644
--- a/appimage/appimage.sh
+++ b/appimage/appimage.sh
@@ -67,7 +67,7 @@ chmod u+x usr/bin/$LOWERAPP
#cp ./usr/share/applications/$LOWERAPP.desktop .
#sed -i -e "s|gimp-2.9|$LOWERAPP|g" $LOWERAPP.desktop
rm -rf ./usr/share/icons/48x48/apps || true
-cp $TRAVIS_BUILD_DIR/images/icon.png hdrmerge.png
+cp $TRAVIS_BUILD_DIR/data/images/icon.png hdrmerge.png
get_apprun
@@ -79,7 +79,7 @@ Type=Application
Name=HDRMerge AppImage
GenericName=HDR raw image merge
GenericName[es]=Mezcla de imágenes HDR raw
-Comment=Merge several raw images into a single DNG raw image with high dynamic range.
+Comment=Merge several raw photos into a single raw DNG with high dynamic range.
Comment[es]=Mezcla varias imágenes raw en una única imagen DNG raw de alto rango dinámico.
Exec=LOWERAPP %f
TryExec=LOWERAPP
diff --git a/build-hdrmerge b/build-hdrmerge
index 783f079..af02950 100755
--- a/build-hdrmerge
+++ b/build-hdrmerge
@@ -123,7 +123,7 @@ cd "${buildDir}" || exit 1
# -----------------------------------------------------------------------------
# Compile
-export QT_SELECT="qt4"
+export QT_SELECT="qt5"
cmake \
-DCMAKE_CXX_FLAGS="-std=c++11 -Wno-deprecated-declarations -Wno-unused-result" \
diff --git a/cmake/FindQt5Transitional.cmake b/cmake/FindQt5Transitional.cmake
new file mode 100644
index 0000000..df354fc
--- /dev/null
+++ b/cmake/FindQt5Transitional.cmake
@@ -0,0 +1,77 @@
+
+find_package(Qt5Core QUIET)
+
+if (Qt5Core_FOUND)
+ set(_allComponents
+ Core
+ Gui
+ DBus
+ Designer
+ Declarative
+ Script
+ ScriptTools
+ Network
+ Test
+ Xml
+ Svg
+ Sql
+ Widgets
+ PrintSupport
+ Concurrent
+ UiTools
+ WebKit
+ WebKitWidgets
+ OpenGL
+ X11Extras
+ Qml
+ Quick
+ )
+ if (NOT Qt5Transitional_FIND_COMPONENTS)
+ foreach(_component ${_allComponents})
+ find_package(Qt5${_component})
+
+ list(APPEND QT_LIBRARIES ${Qt5${_component}_LIBRARIES})
+ endforeach()
+ else()
+ set(_components ${Qt5Transitional_FIND_COMPONENTS})
+ foreach(_component ${Qt5Transitional_FIND_COMPONENTS})
+ find_package(Qt5${_component} REQUIRED)
+ if ("${_component}" STREQUAL "WebKit")
+ find_package(Qt5WebKitWidgets REQUIRED)
+ list(APPEND QT_LIBRARIES ${Qt5WebKitWidgets_LIBRARIES} )
+ endif()
+ if ("${_component}" STREQUAL "Gui")
+ find_package(Qt5Widgets REQUIRED)
+ find_package(Qt5PrintSupport REQUIRED)
+ find_package(Qt5Svg REQUIRED)
+ list(APPEND QT_LIBRARIES ${Qt5Widgets_LIBRARIES}
+ ${Qt5PrintSupport_LIBRARIES}
+ ${Qt5Svg_LIBRARIES} )
+ endif()
+ if ("${_component}" STREQUAL "Core")
+ find_package(Qt5Concurrent REQUIRED)
+ list(APPEND QT_LIBRARIES ${Qt5Concurrent_LIBRARIES} )
+ endif()
+ endforeach()
+ endif()
+
+ set(Qt5Transitional_FOUND TRUE)
+ set(QT5_BUILD TRUE)
+
+ include("${CMAKE_CURRENT_LIST_DIR}/ECMQt4To5Porting.cmake") # TODO: Port away from this.
+
+else()
+ foreach(_component ${Qt5Transitional_FIND_COMPONENTS})
+ if("${_component}" STREQUAL "Widgets") # new in Qt5
+ set(_component Gui)
+ elseif("${_component}" STREQUAL "Concurrent") # new in Qt5
+ set(_component Core)
+ endif()
+ list(APPEND _components Qt${_component})
+ endforeach()
+ find_package(Qt4 ${QT_MIN_VERSION} REQUIRED ${_components})
+
+ if(QT4_FOUND)
+ set(Qt5Transitional_FOUND TRUE)
+ endif()
+endif()
diff --git a/images/draw-brush.png b/data/images/draw-brush.png
similarity index 100%
rename from images/draw-brush.png
rename to data/images/draw-brush.png
diff --git a/images/draw-eraser.png b/data/images/draw-eraser.png
similarity index 100%
rename from images/draw-eraser.png
rename to data/images/draw-eraser.png
diff --git a/images/icon.icns b/data/images/icon.icns
similarity index 100%
rename from images/icon.icns
rename to data/images/icon.icns
diff --git a/images/icon.ico b/data/images/icon.ico
similarity index 100%
rename from images/icon.ico
rename to data/images/icon.ico
diff --git a/images/icon.png b/data/images/icon.png
similarity index 100%
rename from images/icon.png
rename to data/images/icon.png
diff --git a/images/logo.bmp b/data/images/logo.bmp
similarity index 100%
rename from images/logo.bmp
rename to data/images/logo.bmp
diff --git a/images/logo.png b/data/images/logo.png
similarity index 100%
rename from images/logo.png
rename to data/images/logo.png
diff --git a/images/logo.svg b/data/images/logo.svg
similarity index 100%
rename from images/logo.svg
rename to data/images/logo.svg
diff --git a/images/transform-move.png b/data/images/transform-move.png
similarity index 100%
rename from images/transform-move.png
rename to data/images/transform-move.png
diff --git a/data/resources.qrc b/data/resources.qrc
index dc76d08..7af9a8d 100644
--- a/data/resources.qrc
+++ b/data/resources.qrc
@@ -1,9 +1,9 @@
-
- ../images/logo.png
- ../images/icon.png
- ../images/transform-move.png
- ../images/draw-brush.png
- ../images/draw-eraser.png
+
+ images/logo.png
+ images/icon.png
+ images/transform-move.png
+ images/draw-brush.png
+ images/draw-eraser.png
diff --git a/data/setup.nsi b/data/setup.nsi
index 9b386a7..8d958c1 100644
--- a/data/setup.nsi
+++ b/data/setup.nsi
@@ -30,9 +30,9 @@ VIAddVersionKey "FileDescription" "${APPNAME}"
VIAddVersionKey "FileVersion" "@HDRMERGE_VERSION@"
VIAddVersionKey "ProductVersion" "@HDRMERGE_VERSION@"
-!define MUI_ICON "@PROJECT_SOURCE_DIR@/images/icon.ico"
+!define MUI_ICON "@PROJ_SRC_DIR@\data\images\icon.ico"
!define MUI_HEADERIMAGE
-!define MUI_HEADERIMAGE_BITMAP "@PROJECT_SOURCE_DIR@/images/logo.bmp"
+!define MUI_HEADERIMAGE_BITMAP "@PROJ_SRC_DIR@\data\images\logo.bmp"
!define MUI_HEADERIMAGE_RIGHT
;--------------------------------
@@ -40,7 +40,7 @@ VIAddVersionKey "ProductVersion" "@HDRMERGE_VERSION@"
; Pages
!insertmacro MUI_PAGE_WELCOME
-!insertmacro MUI_PAGE_LICENSE "@PROJECT_SOURCE_DIR@/LICENSE"
+!insertmacro MUI_PAGE_LICENSE "@PROJ_SRC_DIR@\LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
@@ -65,10 +65,41 @@ Section "HDRMerge (required)"
; Put file there
File "hdrmerge.exe" \
- "@PROJECT_SOURCE_DIR@/LICENSE" \
- "@PROJECT_SOURCE_DIR@/LICENSE_icons" \
- "@PROJECT_SOURCE_DIR@/README.md"
+ "@PROJ_SRC_DIR@\LICENSE" \
+ "@PROJ_SRC_DIR@\LICENSE_icons" \
+ "@PROJ_SRC_DIR@\README.md"\
+ "@MINGW_LIB_DIR@\libbz2-1.dll"\
+ "@MINGW_LIB_DIR@\libexiv2.dll"\
+ "@MINGW_LIB_DIR@\libexpat-1.dll"\
+ "@MINGW_LIB_DIR@\libfreetype-6.dll"\
+ "@MINGW_LIB_DIR@\libgcc_s_seh-1.dll"\
+ "@MINGW_LIB_DIR@\libglib-2.0-0.dll"\
+ "@MINGW_LIB_DIR@\libgomp-1.dll"\
+ "@MINGW_LIB_DIR@\libgraphite2.dll"\
+ "@MINGW_LIB_DIR@\libharfbuzz-0.dll"\
+ "@MINGW_LIB_DIR@\libiconv-2.dll"\
+ "@MINGW_LIB_DIR@\libicudt58.dll"\
+ "@MINGW_LIB_DIR@\libicuin58.dll"\
+ "@MINGW_LIB_DIR@\libicuuc58.dll"\
+ "@MINGW_LIB_DIR@\libintl-8.dll"\
+ "@MINGW_LIB_DIR@\libjasper-4.dll"\
+ "@MINGW_LIB_DIR@\libjpeg-8.dll"\
+ "@MINGW_LIB_DIR@\liblcms2-2.dll"\
+ "@MINGW_LIB_DIR@\libpcre-1.dll"\
+ "@MINGW_LIB_DIR@\libpcre2-16-0.dll"\
+ "@MINGW_LIB_DIR@\libpng16-16.dll"\
+ "@MINGW_LIB_DIR@\libraw_r-16.dll"\
+ "@MINGW_LIB_DIR@\libstdc++-6.dll"\
+ "@MINGW_LIB_DIR@\libwinpthread-1.dll"\
+ "@MINGW_LIB_DIR@\Qt5Core.dll"\
+ "@MINGW_LIB_DIR@\Qt5Gui.dll"\
+ "@MINGW_LIB_DIR@\Qt5Widgets.dll"\
+ "@MINGW_LIB_DIR@\zlib1.dll"
File /oname=hdrmerge.com "hdrmerge-nogui.exe"
+
+ SetOutPath $INSTDIR\platforms
+
+ File "@QT5_PLUGINS_DIR@\platforms\qwindows.dll"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\${APPNAME} "Install_Dir" "$INSTDIR"
@@ -121,6 +152,35 @@ Section "Uninstall"
Delete "$INSTDIR\LICENSE_icons"
Delete "$INSTDIR\README.md"
Delete "$INSTDIR\uninstall.exe"
+ Delete "$INSTDIR\platforms\qwindows.dll"
+ RMDir "$INSTDIR\platforms"
+ Delete "$INSTDIR\libbz2-1.dll"
+ Delete "$INSTDIR\libexiv2.dll"
+ Delete "$INSTDIR\libexpat-1.dll"
+ Delete "$INSTDIR\libfreetype-6.dll"
+ Delete "$INSTDIR\libgcc_s_seh-1.dll"
+ Delete "$INSTDIR\libglib-2.0-0.dll"
+ Delete "$INSTDIR\libgomp-1.dll"
+ Delete "$INSTDIR\libgraphite2.dll"
+ Delete "$INSTDIR\libharfbuzz-0.dll"
+ Delete "$INSTDIR\libiconv-2.dll"
+ Delete "$INSTDIR\libicudt58.dll"
+ Delete "$INSTDIR\libicuin58.dll"
+ Delete "$INSTDIR\libicuuc58.dll"
+ Delete "$INSTDIR\libintl-8.dll"
+ Delete "$INSTDIR\libjasper-4.dll"
+ Delete "$INSTDIR\libjpeg-8.dll"
+ Delete "$INSTDIR\liblcms2-2.dll"
+ Delete "$INSTDIR\libpcre-1.dll"
+ Delete "$INSTDIR\libpcre2-16-0.dll"
+ Delete "$INSTDIR\libpng16-16.dll"
+ Delete "$INSTDIR\libraw_r-16.dll"
+ Delete "$INSTDIR\libstdc++-6.dll"
+ Delete "$INSTDIR\libwinpthread-1.dll"
+ Delete "$INSTDIR\Qt5Core.dll"
+ Delete "$INSTDIR\Qt5Gui.dll"
+ Delete "$INSTDIR\Qt5Widgets.dll"
+ Delete "$INSTDIR\zlib1.dll"
RMDir /REBOOTOK $INSTDIR
SectionEnd
diff --git a/data/winres.rc b/data/winres.rc
index 6384f71..be5f348 100644
--- a/data/winres.rc
+++ b/data/winres.rc
@@ -1,4 +1,4 @@
-iconId ICON "@PROJECT_SOURCE_DIR@/images/icon.ico"
+iconId ICON "@PROJECT_SOURCE_DIR@/data/images/icon.ico"
1 VERSIONINFO
FILEVERSION @HDRMERGE_VERSION_MAJOR@,@HDRMERGE_VERSION_MINOR@,@HDRMERGE_VERSION_REV@,0
diff --git a/src/DngFloatWriter.cpp b/src/DngFloatWriter.cpp
index 7e2b74d..42aac91 100644
--- a/src/DngFloatWriter.cpp
+++ b/src/DngFloatWriter.cpp
@@ -170,7 +170,7 @@ void DngFloatWriter::createMainIFD() {
mainIFD.addEntry(IMAGEDESCRIPTION, params->description);
QDateTime currentTime = QDateTime::currentDateTime();
QString currentTimeText = currentTime.toString("yyyy:MM:dd hh:mm:ss");
- mainIFD.addEntry(DATETIME, currentTimeText.toAscii().constData());
+ mainIFD.addEntry(DATETIME, currentTimeText.toLatin1().constData());
mainIFD.addEntry(DATETIMEORIGINAL, params->dateTime);
// Profile
diff --git a/src/EditableMask.cpp b/src/EditableMask.cpp
index eea9666..d75de9e 100644
--- a/src/EditableMask.cpp
+++ b/src/EditableMask.cpp
@@ -71,7 +71,7 @@ QRect EditableMask::modifyLayer(const std::list & points, int layer) {
QRect a(points.front(), points.front());
for (auto p : points) {
operator()(p.x(), p.y()) = layer;
- a = a.unite(QRect(p, p));
+ a = a.united(QRect(p, p));
}
return a;
}
diff --git a/src/LoadOptionsDialog.cpp b/src/LoadOptionsDialog.cpp
index 269f8ec..1751e8b 100644
--- a/src/LoadOptionsDialog.cpp
+++ b/src/LoadOptionsDialog.cpp
@@ -46,6 +46,8 @@ LoadOptionsDialog::LoadOptionsDialog(QWidget * parent, Qt::WindowFlags f)
QSettings settings;
QVBoxLayout * layout = new QVBoxLayout(this);
+ setMinimumSize(400, 400);
+
QWidget * fileSelector = new QWidget(this);
QHBoxLayout * fileSelectorLayout = new QHBoxLayout(fileSelector);
fileSelectorLayout->setMargin(0);
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index 785e00c..4cb219d 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -25,7 +25,7 @@
#include "MainWindow.hpp"
#include
#include
-#include
+#include
#include
#include
#include
@@ -72,7 +72,7 @@ MainWindow::MainWindow() : QMainWindow() {
createMenus();
setWindowTitle(tr("HDRMerge %1 - Raw image fusion").arg(HDRMERGE_VERSION_STRING));
- setWindowIcon(QIcon(":/images/icon.png"));
+ setWindowIcon(QIcon(":/icon.png"));
QSettings settings;
restoreGeometry(settings.value("windowGeometry").toByteArray());
diff --git a/src/PreviewWidget.cpp b/src/PreviewWidget.cpp
index cfb72d0..db245ee 100644
--- a/src/PreviewWidget.cpp
+++ b/src/PreviewWidget.cpp
@@ -24,7 +24,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
@@ -136,7 +136,7 @@ QRgb PreviewWidget::rgb(int col, int row) const {
void PreviewWidget::render(QRect zone) {
if (!stack.size()) return;
- zone = zone.intersect(QRect(0, 0, width, height));
+ zone = zone.intersected(QRect(0, 0, width, height));
if (zone.isNull()) return;
cancelRender = false;
QImage image(zone.width(), zone.height(), QImage::Format_RGB32);
diff --git a/src/RawParameters.cpp b/src/RawParameters.cpp
index b9d8c6c..17a29a6 100644
--- a/src/RawParameters.cpp
+++ b/src/RawParameters.cpp
@@ -221,7 +221,7 @@ void RawParameters::fromLibRaw(LibRaw & rawData) {
description = r.other.desc;
QDateTime dateTimeTmp = QDateTime::fromTime_t(r.other.timestamp);
QString dateTimeTmpText = dateTimeTmp.toString("yyyy:MM:dd hh:mm:ss");
- dateTime = dateTimeTmpText.toAscii().constData();
+ dateTime = dateTimeTmpText.toLatin1().constData();
flip = r.sizes.flip;
switch ((flip + 3600) % 360) {
case 270: flip = 5; break;
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index c61c8de..15cae8c 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -9,7 +9,15 @@ set(
testBoxBlur.cpp
testArray2D.cpp
testDngFloatWriter.cpp
-)
+ )
-add_executable(hdrmerge-test ${test_sources} $ $)
-target_link_libraries(hdrmerge-test ${hdrmerge_libs} ${Boost_LIBRARIES})
+#add_executable(hdrmerge-test ${test_sources} $ $)
+add_executable(hdrmerge-test
+ ${test_sources}
+ )
+
+if(APPLE)
+ target_link_libraries(hdrmerge-test ${hdrmerge_libs} alglib-objects ${Boost_LIBRARIES} Qt5::Widgets)
+else()
+ target_link_libraries(hdrmerge-test ${hdrmerge_libs} ${Boost_LIBRARIES} Qt5::Widgets)
+endif()