mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Adjust build settings to c++20
Adjust build settings to c++20 Add ifdef for code related to CeeViz, so it is possible to compile AppFwk without CeeViz
This commit is contained in:
parent
86526a0458
commit
319dc2ab9b
@ -32,8 +32,7 @@ else()
|
||||
include(${QT_USE_FILE})
|
||||
endif(CEE_USE_QT5)
|
||||
|
||||
# Use CMake to enforce C++17
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
@ -41,6 +40,9 @@ if(MSVC)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
endif()
|
||||
|
||||
# CeeViz is not available here, exclude it from the build
|
||||
set(CAF_EXCLUDE_CVF ON)
|
||||
|
||||
# Improvement Cmake 3.x If we have compiler requirements for this library, list
|
||||
# them target_compile_features(lib PUBLIC cxx_auto_type PRIVATE
|
||||
# cxx_variadic_templates)
|
||||
|
@ -28,13 +28,22 @@ set(PROJECT_FILES
|
||||
cafPdmMarkdownGenerator.cpp
|
||||
cafPdmMarkdownBuilder.h
|
||||
cafPdmMarkdownBuilder.cpp
|
||||
)
|
||||
|
||||
set(CAF_LIBS cafProjectDataModel)
|
||||
|
||||
if(NOT CAF_EXCLUDE_CVF)
|
||||
list(
|
||||
APPEND
|
||||
PROJECT_FILES
|
||||
cafPdmFieldScriptingCapabilityCvfColor3.h
|
||||
cafPdmFieldScriptingCapabilityCvfColor3.cpp
|
||||
cafPdmFieldScriptingCapabilityCvfVec3d.h
|
||||
cafPdmFieldScriptingCapabilityCvfVec3d.cpp
|
||||
)
|
||||
)
|
||||
|
||||
set(CAF_LIBS cafProjectDataModel cafPdmCvf)
|
||||
list(APPEND CAF_LIBS cafPdmCvf)
|
||||
endif()
|
||||
|
||||
add_library(${PROJECT_NAME} ${PROJECT_FILES})
|
||||
|
||||
@ -42,4 +51,10 @@ target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
target_link_libraries(${PROJECT_NAME} ${CAF_LIBS})
|
||||
|
||||
if(CAF_EXCLUDE_CVF)
|
||||
target_compile_definitions(
|
||||
${PROJECT_NAME} PRIVATE CAF_EXCLUDE_CVF=${CAF_EXCLUDE_CVF}
|
||||
)
|
||||
endif()
|
||||
|
||||
source_group("" FILES ${PROJECT_FILES})
|
||||
|
@ -38,8 +38,6 @@
|
||||
#include "cafPdmAbstractFieldScriptingCapability.h"
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmFieldScriptingCapabilityCvfColor3.h"
|
||||
#include "cafPdmFieldScriptingCapabilityCvfVec3d.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmObjectFactory.h"
|
||||
#include "cafPdmObjectMethod.h"
|
||||
@ -47,6 +45,11 @@
|
||||
#include "cafPdmProxyValueField.h"
|
||||
#include "cafPdmXmlFieldHandle.h"
|
||||
|
||||
#ifndef CAF_EXCLUDE_CVF
|
||||
#include "cafPdmFieldScriptingCapabilityCvfColor3.h"
|
||||
#include "cafPdmFieldScriptingCapabilityCvfVec3d.h"
|
||||
#endif
|
||||
|
||||
#include <QRegularExpression>
|
||||
#include <QTextStream>
|
||||
|
||||
@ -550,12 +553,15 @@ QString PdmPythonGenerator::dataTypeString( const PdmFieldHandle* field, bool us
|
||||
{ QString::fromStdString( typeid( bool ).name() ), "bool" },
|
||||
{ QString::fromStdString( typeid( time_t ).name() ), "int" },
|
||||
{ QString::fromStdString( typeid( QString ).name() ), "str" },
|
||||
{ QString::fromStdString( typeid( cvf::Vec3d ).name() ), "List[float]" },
|
||||
{ QString::fromStdString( typeid( cvf::Color3f ).name() ), "str" },
|
||||
{ QString::fromStdString( typeid( caf::FilePath ).name() ), "str" },
|
||||
{ QString::fromStdString( typeid( std::vector<double> ).name() ), "List[float]" },
|
||||
};
|
||||
|
||||
#ifndef CAF_EXCLUDE_CVF
|
||||
builtins[QString::fromStdString( typeid( cvf::Vec3d ).name() )] = "List[float]";
|
||||
builtins[QString::fromStdString( typeid( cvf::Color3f ).name() )] = "str";
|
||||
#endif
|
||||
|
||||
bool foundBuiltin = false;
|
||||
for ( auto builtin : builtins )
|
||||
{
|
||||
|
@ -8,7 +8,7 @@ else()
|
||||
message( STATUS "No buildcache found" )
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
project (TestCafAndVizFwk)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user