Cmake cleanup and selected Qt6 adjustments

- Avoid warning using newer CMake by removing obsolete cmake requirements in sub projects
- Several adjustments preparing for Qt6
This commit is contained in:
Magne Sjaastad 2024-04-17 15:06:51 +02:00 committed by GitHub
parent 174123f8b5
commit c759a11888
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
19 changed files with 13 additions and 32 deletions

View File

@ -181,7 +181,7 @@ int main( int argc, char* argv[] )
if ( file.open( QIODevice::WriteOnly | QIODevice::Text ) ) if ( file.open( QIODevice::WriteOnly | QIODevice::Text ) )
{ {
QTextStream out( &file ); QTextStream out( &file );
out << portNumber << endl; out << portNumber << "\n";
} }
file.close(); file.close();

View File

@ -38,7 +38,6 @@
#include <QAction> #include <QAction>
#include <QClipboard> #include <QClipboard>
#include <QDebug> #include <QDebug>
#include <QDesktopWidget>
#include <QFileInfo> #include <QFileInfo>
#include <QMdiSubWindow> #include <QMdiSubWindow>
#include <QPageLayout> #include <QPageLayout>

View File

@ -319,8 +319,7 @@ QDateTime RimSummaryTimeAxisProperties::fromDisplayTimeToDate( double displayTim
time_t startOfSimulation = rimSummaryPlot->firstTimeStepOfFirstCurve(); time_t startOfSimulation = rimSummaryPlot->firstTimeStepOfFirstCurve();
time_t secsSinceSimulationStart = displayTime / fromTimeTToDisplayUnitScale(); time_t secsSinceSimulationStart = displayTime / fromTimeTToDisplayUnitScale();
QDateTime date; QDateTime date = RiaQDateTimeTools::fromTime_t( startOfSimulation + secsSinceSimulationStart );
date.setTime_t( startOfSimulation + secsSinceSimulationStart );
return date; return date;
} }

View File

@ -92,6 +92,7 @@
#include "DockManager.h" #include "DockManager.h"
#include <QAction> #include <QAction>
#include <QActionGroup>
#include <QCloseEvent> #include <QCloseEvent>
#include <QComboBox> #include <QComboBox>
#include <QDir> #include <QDir>

View File

@ -58,7 +58,6 @@
#include "qwt_scale_widget.h" #include "qwt_scale_widget.h"
#include <QDebug> #include <QDebug>
#include <QDesktopWidget>
#include <QFocusEvent> #include <QFocusEvent>
#include <QFontMetrics> #include <QFontMetrics>
#include <QGraphicsDropShadowEffect> #include <QGraphicsDropShadowEffect>

View File

@ -39,7 +39,7 @@
/* /*
Interpolating inside a general 8 node hexahedral element Interpolating inside a general 8 node hexahedral element
Calculating an interpolated value at a position inside the element from values at each corner. Calculating an interpolated value at a position inside the element from values at each corner.
Author Jacob Støren Author Jacob Storen
| v1 | | v1 |
Vectors: [v] = | v2 | = { v1, v2, v3 } Vectors: [v] = | v2 | = { v1, v2, v3 }

View File

@ -14,6 +14,7 @@ set(MOC_HEADER_FILES MainWindow.h WidgetLayoutTest.h CustomObjectEditor.h
# Resource file # Resource file
set(QRC_FILES ${QRC_FILES} textedit.qrc) set(QRC_FILES ${QRC_FILES} textedit.qrc)
message("QRC_FILES: ${QRC_FILES}")
if(CEE_USE_QT6) if(CEE_USE_QT6)
find_package( find_package(
@ -23,6 +24,7 @@ if(CEE_USE_QT6)
) )
set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGL Qt6::Svg) set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::Widgets Qt6::OpenGL Qt6::Svg)
qt_standard_project_setup() qt_standard_project_setup()
set(CMAKE_AUTORCC ON)
else() else()
find_package( find_package(
Qt5 Qt5
@ -64,7 +66,7 @@ if(CEE_USE_QT6)
${PROJECT_NAME} ${PROJECT_NAME}
${PROJECT_FILES} ${PROJECT_FILES}
${MOC_SOURCE_FILES} ${MOC_SOURCE_FILES}
${QRC_FILES_CPP} ${QRC_FILES}
$<TARGET_OBJECTS:cafCommandFeatures> # Needed for cmake version < 3.12. $<TARGET_OBJECTS:cafCommandFeatures> # Needed for cmake version < 3.12.
# Remove # Remove
# when we can use target_link_libraries with OBJECT libraries # when we can use target_link_libraries with OBJECT libraries

View File

@ -42,8 +42,6 @@ add_library(
cafNavigationPolicy.cpp cafNavigationPolicy.cpp
cafNavigationPolicy.h cafNavigationPolicy.h
cafPointOfInterestVisualizer.h cafPointOfInterestVisualizer.h
cafOpenGLWidget.cpp
cafOpenGLWidget.h
cafViewer.cpp cafViewer.cpp
cafViewer.h cafViewer.h
${MOC_SOURCE_FILES} ${MOC_SOURCE_FILES}

View File

@ -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 ) project( ERT C CXX )
include(GNUInstallDirs) include(GNUInstallDirs)

View File

@ -1,4 +1,3 @@
cmake_minimum_required(VERSION 2.8.12)
project(catch2 CXX) project(catch2 CXX)
# Dummy source file added because INTERFACE type # Dummy source file added because INTERFACE type

View File

@ -1,5 +1,3 @@
cmake_minimum_required (VERSION 2.8.12)
project (NRLib) project (NRLib)
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)

View File

@ -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 // Copyright (c) 2011, Norwegian Computing Center
// All rights reserved. // All rights reserved.
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // 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. // 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 // conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution. // provided with the distribution.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY

View File

@ -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 // Copyright (c) 2011, Norwegian Computing Center
// All rights reserved. // All rights reserved.
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met: // 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. // 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 // conditions and the following disclaimer in the documentation and/or other materials
// provided with the distribution. // provided with the distribution.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY

View File

@ -1,5 +1,3 @@
cmake_minimum_required (VERSION 2.8.12)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
endif() endif()

View File

@ -1,6 +1,3 @@
cmake_minimum_required (VERSION 2.8.12)
# Languages and global compiler settings
if(CMAKE_VERSION VERSION_LESS 3.8) if(CMAKE_VERSION VERSION_LESS 3.8)
message(WARNING "CMake version does not support c++17, guessing -std=c++17") message(WARNING "CMake version does not support c++17, guessing -std=c++17")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

View File

@ -1,5 +1,3 @@
cmake_minimum_required (VERSION 2.8.12)
project (custom-opm-flowdiag-app) project (custom-opm-flowdiag-app)
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)

View File

@ -1,5 +1,3 @@
cmake_minimum_required (VERSION 2.8.12)
project (custom-opm-flowdiagnostics) project (custom-opm-flowdiagnostics)
if (CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_COMPILER_IS_GNUCXX)

View File

@ -1,5 +1,3 @@
cmake_minimum_required (VERSION 2.8.12)
project (expressionparser) project (expressionparser)
if(MSVC) if(MSVC)

View File

@ -1,5 +1,3 @@
cmake_minimum_required (VERSION 2.8.12)
project (nightcharts) project (nightcharts)
if (CEE_USE_QT6) if (CEE_USE_QT6)