From c759a118888246d9784d38676e5c9c09c6cd647f Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Wed, 17 Apr 2024 15:06:51 +0200 Subject: [PATCH] Cmake cleanup and selected Qt6 adjustments - Avoid warning using newer CMake by removing obsolete cmake requirements in sub projects - Several adjustments preparing for Qt6 --- ApplicationExeCode/RiaMain.cpp | 2 +- .../ExportCommands/RicSnapshotViewToFileFeature.cpp | 1 - .../Summary/RimSummaryTimeAxisProperties.cpp | 3 +-- ApplicationLibCode/UserInterface/RiuMainWindow.cpp | 1 + ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp | 1 - Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h | 2 +- Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt | 4 +++- Fwk/AppFwk/cafViewer/CMakeLists.txt | 2 -- ThirdParty/Ert/CMakeLists.txt | 1 - ThirdParty/Ert/external/catch2/CMakeLists.txt | 1 - ThirdParty/NRLib/CMakeLists.txt | 2 -- ThirdParty/NRLib/nrlib/well/laswell.hpp | 6 +++--- ThirdParty/NRLib/nrlib/well/well.hpp | 6 +++--- ThirdParty/clipper/CMakeLists.txt | 2 -- ThirdParty/custom-opm-common/CMakeLists.txt | 3 --- ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt | 2 -- ThirdParty/custom-opm-flowdiagnostics/CMakeLists.txt | 2 -- ThirdParty/expressionparser/CMakeLists.txt | 2 -- ThirdParty/nightcharts/CMakeLists.txt | 2 -- 19 files changed, 13 insertions(+), 32 deletions(-) diff --git a/ApplicationExeCode/RiaMain.cpp b/ApplicationExeCode/RiaMain.cpp index b8d35b48c2..da1e71c972 100644 --- a/ApplicationExeCode/RiaMain.cpp +++ b/ApplicationExeCode/RiaMain.cpp @@ -181,7 +181,7 @@ int main( int argc, char* argv[] ) if ( file.open( QIODevice::WriteOnly | QIODevice::Text ) ) { QTextStream out( &file ); - out << portNumber << endl; + out << portNumber << "\n"; } file.close(); diff --git a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp index efbf0ca313..8cc57dc646 100644 --- a/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp +++ b/ApplicationLibCode/Commands/ExportCommands/RicSnapshotViewToFileFeature.cpp @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include diff --git a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp index 4d10357f62..5338521b65 100644 --- a/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp +++ b/ApplicationLibCode/ProjectDataModel/Summary/RimSummaryTimeAxisProperties.cpp @@ -319,8 +319,7 @@ QDateTime RimSummaryTimeAxisProperties::fromDisplayTimeToDate( double displayTim time_t startOfSimulation = rimSummaryPlot->firstTimeStepOfFirstCurve(); time_t secsSinceSimulationStart = displayTime / fromTimeTToDisplayUnitScale(); - QDateTime date; - date.setTime_t( startOfSimulation + secsSinceSimulationStart ); + QDateTime date = RiaQDateTimeTools::fromTime_t( startOfSimulation + secsSinceSimulationStart ); return date; } diff --git a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp index 01ef0bb120..9c99e50029 100644 --- a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp @@ -92,6 +92,7 @@ #include "DockManager.h" #include +#include #include #include #include diff --git a/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp b/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp index a353d17f61..4668d2590e 100644 --- a/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp +++ b/ApplicationLibCode/UserInterface/RiuMultiPlotPage.cpp @@ -58,7 +58,6 @@ #include "qwt_scale_widget.h" #include -#include #include #include #include diff --git a/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h b/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h index 1ae037d185..f9d70f463a 100644 --- a/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h +++ b/Fwk/AppFwk/cafHexInterpolator/cafHexInterpolator.h @@ -39,7 +39,7 @@ /* Interpolating inside a general 8 node hexahedral element Calculating an interpolated value at a position inside the element from values at each corner. -Author Jacob Støren +Author Jacob Storen | v1 | Vectors: [v] = | v2 | = { v1, v2, v3 } diff --git a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt index 328c2d4218..58491526c2 100644 --- a/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt +++ b/Fwk/AppFwk/cafTests/cafTestApplication/CMakeLists.txt @@ -14,6 +14,7 @@ set(MOC_HEADER_FILES MainWindow.h WidgetLayoutTest.h CustomObjectEditor.h # Resource file set(QRC_FILES ${QRC_FILES} textedit.qrc) +message("QRC_FILES: ${QRC_FILES}") if(CEE_USE_QT6) find_package( @@ -23,6 +24,7 @@ if(CEE_USE_QT6) ) set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGL Qt6::Svg) qt_standard_project_setup() + set(CMAKE_AUTORCC ON) else() find_package( Qt5 @@ -64,7 +66,7 @@ if(CEE_USE_QT6) ${PROJECT_NAME} ${PROJECT_FILES} ${MOC_SOURCE_FILES} - ${QRC_FILES_CPP} + ${QRC_FILES} $ # Needed for cmake version < 3.12. # Remove # when we can use target_link_libraries with OBJECT libraries diff --git a/Fwk/AppFwk/cafViewer/CMakeLists.txt b/Fwk/AppFwk/cafViewer/CMakeLists.txt index 33411039bf..1c09b2cd31 100644 --- a/Fwk/AppFwk/cafViewer/CMakeLists.txt +++ b/Fwk/AppFwk/cafViewer/CMakeLists.txt @@ -42,8 +42,6 @@ add_library( cafNavigationPolicy.cpp cafNavigationPolicy.h cafPointOfInterestVisualizer.h - cafOpenGLWidget.cpp - cafOpenGLWidget.h cafViewer.cpp cafViewer.h ${MOC_SOURCE_FILES} diff --git a/ThirdParty/Ert/CMakeLists.txt b/ThirdParty/Ert/CMakeLists.txt index 5f8283f86f..22dafde9c3 100644 --- a/ThirdParty/Ert/CMakeLists.txt +++ b/ThirdParty/Ert/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required( VERSION 2.8.12 ) # If you are creating Python wrappers for Windows, the actual version requirement is 3.4 project( ERT C CXX ) include(GNUInstallDirs) diff --git a/ThirdParty/Ert/external/catch2/CMakeLists.txt b/ThirdParty/Ert/external/catch2/CMakeLists.txt index acc362ba8a..7327241a02 100644 --- a/ThirdParty/Ert/external/catch2/CMakeLists.txt +++ b/ThirdParty/Ert/external/catch2/CMakeLists.txt @@ -1,4 +1,3 @@ -cmake_minimum_required(VERSION 2.8.12) project(catch2 CXX) # Dummy source file added because INTERFACE type diff --git a/ThirdParty/NRLib/CMakeLists.txt b/ThirdParty/NRLib/CMakeLists.txt index 0ad5839f44..858365e8a6 100644 --- a/ThirdParty/NRLib/CMakeLists.txt +++ b/ThirdParty/NRLib/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required (VERSION 2.8.12) - project (NRLib) if (CMAKE_COMPILER_IS_GNUCXX) diff --git a/ThirdParty/NRLib/nrlib/well/laswell.hpp b/ThirdParty/NRLib/nrlib/well/laswell.hpp index 074c177ef2..61741bf356 100644 --- a/ThirdParty/NRLib/nrlib/well/laswell.hpp +++ b/ThirdParty/NRLib/nrlib/well/laswell.hpp @@ -1,12 +1,12 @@ -// $Id: laswell.hpp 1244 2014-02-24 15:57:16Z hauge $ +// $Id: laswell.hpp 1244 2014-02-24 15:57:16Z hauge $ // Copyright (c) 2011, Norwegian Computing Center // All rights reserved. // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: -// • Redistributions of source code must retain the above copyright notice, this +// • Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. -// • Redistributions in binary form must reproduce the above copyright notice, this list of +// • Redistributions in binary form must reproduce the above copyright notice, this list of // conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY diff --git a/ThirdParty/NRLib/nrlib/well/well.hpp b/ThirdParty/NRLib/nrlib/well/well.hpp index 09b9baa9dd..2cdad1e3ed 100644 --- a/ThirdParty/NRLib/nrlib/well/well.hpp +++ b/ThirdParty/NRLib/nrlib/well/well.hpp @@ -1,12 +1,12 @@ -// $Id: well.hpp 883 2011-09-26 09:17:05Z perroe $ +// $Id: well.hpp 883 2011-09-26 09:17:05Z perroe $ // Copyright (c) 2011, Norwegian Computing Center // All rights reserved. // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: -// • Redistributions of source code must retain the above copyright notice, this +// • Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. -// • Redistributions in binary form must reproduce the above copyright notice, this list of +// • Redistributions in binary form must reproduce the above copyright notice, this list of // conditions and the following disclaimer in the documentation and/or other materials // provided with the distribution. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY diff --git a/ThirdParty/clipper/CMakeLists.txt b/ThirdParty/clipper/CMakeLists.txt index 9f84a5e20b..69c88036ec 100644 --- a/ThirdParty/clipper/CMakeLists.txt +++ b/ThirdParty/clipper/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required (VERSION 2.8.12) - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy") endif() diff --git a/ThirdParty/custom-opm-common/CMakeLists.txt b/ThirdParty/custom-opm-common/CMakeLists.txt index 5439d66b38..d13eea7271 100644 --- a/ThirdParty/custom-opm-common/CMakeLists.txt +++ b/ThirdParty/custom-opm-common/CMakeLists.txt @@ -1,6 +1,3 @@ -cmake_minimum_required (VERSION 2.8.12) - -# Languages and global compiler settings if(CMAKE_VERSION VERSION_LESS 3.8) message(WARNING "CMake version does not support c++17, guessing -std=c++17") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") diff --git a/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt b/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt index a44c68d824..d6748f8a5b 100644 --- a/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt +++ b/ThirdParty/custom-opm-flowdiag-app/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required (VERSION 2.8.12) - project (custom-opm-flowdiag-app) if (CMAKE_COMPILER_IS_GNUCXX) diff --git a/ThirdParty/custom-opm-flowdiagnostics/CMakeLists.txt b/ThirdParty/custom-opm-flowdiagnostics/CMakeLists.txt index a9c22ebe98..8829324303 100644 --- a/ThirdParty/custom-opm-flowdiagnostics/CMakeLists.txt +++ b/ThirdParty/custom-opm-flowdiagnostics/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required (VERSION 2.8.12) - project (custom-opm-flowdiagnostics) if (CMAKE_COMPILER_IS_GNUCXX) diff --git a/ThirdParty/expressionparser/CMakeLists.txt b/ThirdParty/expressionparser/CMakeLists.txt index f9afaa51e0..0bbd626767 100644 --- a/ThirdParty/expressionparser/CMakeLists.txt +++ b/ThirdParty/expressionparser/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required (VERSION 2.8.12) - project (expressionparser) if(MSVC) diff --git a/ThirdParty/nightcharts/CMakeLists.txt b/ThirdParty/nightcharts/CMakeLists.txt index 8c79e7386a..0b1724ce3a 100644 --- a/ThirdParty/nightcharts/CMakeLists.txt +++ b/ThirdParty/nightcharts/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required (VERSION 2.8.12) - project (nightcharts) if (CEE_USE_QT6)