Commit 77ee7214 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Detect presence of HDR code in Qt automatically by CMake

parent f3858d11
...@@ -182,10 +182,6 @@ add_feature_info("Foundation Build" FOUNDATION_BUILD "A Foundation build is a bi ...@@ -182,10 +182,6 @@ add_feature_info("Foundation Build" FOUNDATION_BUILD "A Foundation build is a bi
option(KRITA_ENABLE_BROKEN_TESTS "Enable tests that are marked as broken" OFF) option(KRITA_ENABLE_BROKEN_TESTS "Enable tests that are marked as broken" OFF)
add_feature_info("Enable Broken Tests" KRITA_ENABLE_BROKEN_TESTS "Runs broken test when \"make test\" is invoked (use -DKRITA_ENABLE_BROKEN_TESTS=ON to enable).") add_feature_info("Enable Broken Tests" KRITA_ENABLE_BROKEN_TESTS "Runs broken test when \"make test\" is invoked (use -DKRITA_ENABLE_BROKEN_TESTS=ON to enable).")
option(HAVE_HDR "Enable HDR surface format selection. Available only on certain patched versions of Qt" OFF)
configure_file(config-hdr.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-hdr.h)
add_feature_info("Enable HDR" HAVE_HDR "Enable selection of HDR surface fort Krita window. Needs a particular patched version of Qt")
option(LIMIT_LONG_TESTS "Run long running unittests in a limited quick mode" ON) option(LIMIT_LONG_TESTS "Run long running unittests in a limited quick mode" ON)
configure_file(config-limit-long-tests.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-limit-long-tests.h) configure_file(config-limit-long-tests.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-limit-long-tests.h)
add_feature_info("Limit long tests" LIMIT_LONG_TESTS "Run long running unittests in a limited quick mode") add_feature_info("Limit long tests" LIMIT_LONG_TESTS "Run long running unittests in a limited quick mode")
...@@ -327,6 +323,26 @@ QCoreApplication::setAttribute(Qt::AA_MSWindowsUseWinTabAPI); ...@@ -327,6 +323,26 @@ QCoreApplication::setAttribute(Qt::AA_MSWindowsUseWinTabAPI);
configure_file(config_use_qt_tablet_windows.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_use_qt_tablet_windows.h) configure_file(config_use_qt_tablet_windows.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config_use_qt_tablet_windows.h)
endif () endif ()
set(CMAKE_REQUIRED_INCLUDES ${Qt5Core_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Gui_LIBRARIES})
CHECK_CXX_SOURCE_COMPILES("
#include <QSurfaceFormat>
int main(int argc, char *argv[]) {
QSurfaceFormat fmt;
fmt.setColorSpace(QSurfaceFormat::scRGBColorSpace);
fmt.setColorSpace(QSurfaceFormat::bt2020PQColorSpace);
}
"
HAVE_HDR
)
configure_file(config-hdr.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-hdr.h)
unset(CMAKE_REQUIRED_INCLUDES)
unset(CMAKE_REQUIRED_LIBRARIES)
include (MacroAddFileDependencies) include (MacroAddFileDependencies)
include (MacroBoolTo01) include (MacroBoolTo01)
include (MacroEnsureOutOfSourceBuild) include (MacroEnsureOutOfSourceBuild)
......
...@@ -757,7 +757,6 @@ echo "%CMAKE_EXE%" "%KRITA_SRC_DIR%\." ^ ...@@ -757,7 +757,6 @@ echo "%CMAKE_EXE%" "%KRITA_SRC_DIR%\." ^
-DBUILD_TESTING=OFF ^ -DBUILD_TESTING=OFF ^
-DHAVE_MEMORY_LEAK_TRACKER=OFF ^ -DHAVE_MEMORY_LEAK_TRACKER=OFF ^
-DFOUNDATION_BUILD=ON ^ -DFOUNDATION_BUILD=ON ^
-DHAVE_HDR=ON ^
-DUSE_QT_TABLET_WINDOWS=ON ^ -DUSE_QT_TABLET_WINDOWS=ON ^
-Wno-dev ^ -Wno-dev ^
-G "MinGW Makefiles" ^ -G "MinGW Makefiles" ^
...@@ -774,7 +773,6 @@ echo "%CMAKE_EXE%" "%KRITA_SRC_DIR%\." ^ ...@@ -774,7 +773,6 @@ echo "%CMAKE_EXE%" "%KRITA_SRC_DIR%\." ^
-DHAVE_MEMORY_LEAK_TRACKER=OFF ^ -DHAVE_MEMORY_LEAK_TRACKER=OFF ^
-DFOUNDATION_BUILD=ON ^ -DFOUNDATION_BUILD=ON ^
-DUSE_QT_TABLET_WINDOWS=ON ^ -DUSE_QT_TABLET_WINDOWS=ON ^
-DHAVE_HDR=ON ^
-Wno-dev ^ -Wno-dev ^
-G "MinGW Makefiles" ^ -G "MinGW Makefiles" ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% -DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE%
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment