mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor issues
* Use horizontalAdvance * Remove unused code * Hide some warnings from Qt code * Remove message for _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING * Use CMP0077 NEW * Move roff libraries to folder Thirdparty * avoid operator()== * Remove cmake_minimum_required and set version to 3.15
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(CommonCode)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -217,7 +217,6 @@ std::vector<caf::ContourLines::ListOfLineSegments> caf::ContourLines::create( co
|
||||
const std::vector<double>& yPositions,
|
||||
const std::vector<double>& contourLevels )
|
||||
{
|
||||
const double eps = 1.0e-4;
|
||||
std::vector<std::vector<cvf::Vec2d>> contourLineSegments;
|
||||
caf::ContourLines::create( dataXY, xPositions, yPositions, contourLevels, &contourLineSegments );
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafAnimControl)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafCommand)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafCommandFeatures)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafPdmCvf)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafPdmScripting)
|
||||
|
||||
option(CAF_CVF_SCRIPTING "Enable CVF-data support in Scripting" OFF)
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
project(cafPdmScripting_UnitTests)
|
||||
|
||||
find_package(
|
||||
@@ -13,10 +11,6 @@ if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
|
||||
# VS 2017 : Disable warnings from from gtest code, using deprecated code
|
||||
# related to TR1
|
||||
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
message(
|
||||
STATUS
|
||||
"Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafProjectDataModel)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafPdmCore)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -108,9 +108,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
bool operator==( T value ) const { return m_value == value; }
|
||||
bool operator!=( T value ) const { return m_value != value; }
|
||||
|
||||
operator T() const { return m_value; }
|
||||
|
||||
T value() const { return m_value; }
|
||||
@@ -346,22 +343,6 @@ private:
|
||||
|
||||
} // namespace caf
|
||||
|
||||
//==================================================================================================
|
||||
/// Cant remember why we need those comparison operators...
|
||||
//==================================================================================================
|
||||
|
||||
template <class T>
|
||||
bool operator==( T value, const caf::AppEnum<T>& appEnum )
|
||||
{
|
||||
return ( appEnum == value );
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool operator!=( T value, const caf::AppEnum<T>& appEnum )
|
||||
{
|
||||
return ( appEnum != value );
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
/// Implementation of stream operators to make PdmField<AppEnum<> > work smoothly
|
||||
/// Assumes that the stream ends at the end of the enum text
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(cafPdmCore_UnitTests)
|
||||
|
||||
@@ -14,10 +14,6 @@ if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
|
||||
# VS 2017 : Disable warnings from from gtest code, using deprecated code
|
||||
# related to TR1
|
||||
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
message(
|
||||
STATUS
|
||||
"Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafPdmUiCore)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -84,7 +84,7 @@ QSize QShortenedLabel::minimumSizeHint() const
|
||||
QFontMetrics fontMetrics = QApplication::fontMetrics();
|
||||
QString fullLabelText = fullText();
|
||||
QString shortenedText = fullLabelText.left( minimumNumberOfCharacters );
|
||||
int minimumWidth = fontMetrics.width( shortenedText );
|
||||
int minimumWidth = fontMetrics.horizontalAdvance( shortenedText );
|
||||
|
||||
if ( !fullLabelText.isEmpty() )
|
||||
{
|
||||
@@ -94,12 +94,12 @@ QSize QShortenedLabel::minimumSizeHint() const
|
||||
QStringList labelLines = fullLabelText.split( "\n" );
|
||||
for ( QString line : labelLines )
|
||||
{
|
||||
int lineWidth = fontMetrics.width( line );
|
||||
int lineWidth = fontMetrics.horizontalAdvance( line );
|
||||
maxLineWidth = std::max( maxLineWidth, lineWidth );
|
||||
QStringList words = line.split( " " );
|
||||
if ( !words.empty() )
|
||||
{
|
||||
int wordWidth = fontMetrics.width( words.front() + "..." );
|
||||
int wordWidth = fontMetrics.horizontalAdvance( words.front() + "..." );
|
||||
maxFirstWordWidth = std::max( maxFirstWordWidth, wordWidth );
|
||||
}
|
||||
}
|
||||
@@ -127,7 +127,7 @@ QSize QShortenedLabel::sizeHint() const
|
||||
int maxLineWidth = 0;
|
||||
for ( const QString& line : labelLines )
|
||||
{
|
||||
maxLineWidth = std::max( maxLineWidth, fontMetrics.width( line ) );
|
||||
maxLineWidth = std::max( maxLineWidth, fontMetrics.horizontalAdvance( line ) );
|
||||
}
|
||||
|
||||
// increase size hint with a few pixels to avoid linux gui issues
|
||||
@@ -156,7 +156,7 @@ void caf::QShortenedLabel::resizeText( QSize paintSize )
|
||||
int maxLineWidth = 0;
|
||||
for ( const QString& line : labelLines )
|
||||
{
|
||||
maxLineWidth += fontMetrics.width( line );
|
||||
maxLineWidth += fontMetrics.horizontalAdvance( line );
|
||||
}
|
||||
|
||||
if ( maxLineWidth < paintSize.width() )
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafPdmXml)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(cafPdmXml_UnitTests)
|
||||
|
||||
@@ -13,10 +13,6 @@ if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
|
||||
# VS 2017 : Disable warnings from from gtest code, using deprecated code
|
||||
# related to TR1
|
||||
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
message(
|
||||
STATUS
|
||||
"Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(cafProjectDataModel_UnitTests)
|
||||
|
||||
@@ -14,10 +14,6 @@ if(MSVC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 19.11))
|
||||
# VS 2017 : Disable warnings from from gtest code, using deprecated code
|
||||
# related to TR1
|
||||
add_definitions(-D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
|
||||
message(
|
||||
STATUS
|
||||
"Add flag to disable warings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
|
||||
)
|
||||
endif()
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} # required for gtest-all.cpp
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafTensor)
|
||||
|
||||
set(PROJECT_FILES cafTensor3.cpp cafTensor3.h cafTensor3.inl)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(cafTestApplication)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(cafTestCvfApplication)
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafUserInterface)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(cafUserInterface_UnitTests)
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafViewer)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(cafVizExtensions)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(LibCore)
|
||||
|
||||
# CMake Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(LibGeometry)
|
||||
|
||||
# CMake Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(LibGuiQt)
|
||||
|
||||
# CMake Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(LibRender)
|
||||
|
||||
# Unity Build
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(LibViewing)
|
||||
|
||||
# CMake Unity Build
|
||||
|
||||
Reference in New Issue
Block a user