mirror of
https://github.com/OPM/ResInsight.git
synced 2026-11-02 20:30:46 -06:00
* #14654 Fix Linux Release build defining NO_DEBUG instead of NDEBUG CMAKE_CXX_FLAGS_RELEASE was overwritten with -DNO_DEBUG on Linux in both CMakeLists.txt and Fwk/CMakeLists.txt. NO_DEBUG is not a standard macro, so NDEBUG was never defined in Linux Release builds. As a result, cafAssert.h fell back to CAF_ENABLE_ASSERTS 1, keeping CAF_ASSERT (and standard assert()) active in Release and aborting the app, even though RESINSIGHT_ENABLE_ASSERTS_IN_RELEASE defaults to OFF. Windows and macOS Release builds were unaffected. Drop the override entirely so CMake supplies its default Release flags (-O3 -DNDEBUG) on Linux, matching Windows and macOS. Also simplify CEE_USE_QT5/CEE_USE_QT6 handling: set them directly instead of via option() with malformed NOT DEFINED(...) guards. Fixed missing initialization in VfpValueSelection and WellPathCellIntersectionInfo
66 lines
1.9 KiB
CMake
66 lines
1.9 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
project(CeeApp)
|
|
|
|
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(
|
|
"Add flag to disable warnings from gtest - _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
|
|
)
|
|
endif()
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
if(MSVC)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
|
endif()
|
|
|
|
# Instruct cvf to use Qt6
|
|
set(CEE_USE_QT5 OFF)
|
|
set(CEE_USE_QT6 ON)
|
|
|
|
# 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)
|
|
|
|
# libraries
|
|
add_subdirectory(cafProjectDataModel/cafPdmCore)
|
|
add_subdirectory(cafProjectDataModel/cafPdmUiCore)
|
|
add_subdirectory(cafProjectDataModel/cafPdmXml)
|
|
|
|
add_subdirectory(cafProjectDataModel)
|
|
add_subdirectory(cafCommand)
|
|
add_subdirectory(cafCommandFeatures)
|
|
add_subdirectory(cafUserInterface)
|
|
add_subdirectory(cafPdmScripting)
|
|
add_subdirectory(cafDataLoader)
|
|
|
|
# executables
|
|
add_subdirectory(cafTests/cafTestApplication)
|
|
|
|
if(UNIX)
|
|
set(THREAD_LIBRARY "pthread")
|
|
endif()
|
|
|
|
add_subdirectory(cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests)
|
|
add_subdirectory(cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests)
|
|
add_subdirectory(cafProjectDataModel/cafProjectDataModel_UnitTests)
|
|
add_subdirectory(cafUserInterface/cafUserInterface_UnitTests)
|
|
add_subdirectory(cafPdmScripting/cafPdmScripting_UnitTests)
|
|
|
|
# Organize sub-projects into folders on Visual Studio Turn on using solution
|
|
# folders
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
set_property(
|
|
TARGET cafPdmCore cafPdmCore_UnitTests cafPdmXml cafPdmXml_UnitTests
|
|
cafPdmUiCore PROPERTY FOLDER "PdmCore"
|
|
)
|