mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 22:27:55 -05: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
85 lines
3.0 KiB
CMake
85 lines
3.0 KiB
CMake
cmake_minimum_required(VERSION 3.15)
|
|
|
|
find_program(buildcache_program buildcache)
|
|
if(buildcache_program)
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${buildcache_program}")
|
|
message( STATUS "Found buildcache from : ${buildcache_program}" )
|
|
else()
|
|
message( STATUS "No buildcache found" )
|
|
endif()
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
|
|
project (TestCafAndVizFwk)
|
|
|
|
# ##############################################################################
|
|
# Setup the main platform defines
|
|
# ##############################################################################
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
add_definitions(-DCVF_LINUX)
|
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
add_definitions(-DCVF_OSX)
|
|
elseif(MSVC)
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
|
set(_HAS_STD_BYTE 0)
|
|
endif()
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
set(CMAKE_CXX_FLAGS
|
|
"-DCVF_LINUX -pipe -Wextra -Woverloaded-virtual -Wformat -Wno-unused-parameter"
|
|
)
|
|
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -g3 -O0 -DDEBUG -D_DEBUG")
|
|
endif()
|
|
|
|
find_package(
|
|
Qt6
|
|
COMPONENTS
|
|
REQUIRED Core Gui OpenGL Widgets
|
|
)
|
|
set(QT_LIBRARIES Qt6::Core Qt6::Gui Qt6::OpenGL Qt6::Widgets)
|
|
qt_standard_project_setup()
|
|
|
|
# Libraries
|
|
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmCore)
|
|
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmUiCore)
|
|
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmXml)
|
|
add_subdirectory(AppFwk/cafProjectDataModel)
|
|
add_subdirectory(AppFwk/cafCommand)
|
|
add_subdirectory(AppFwk/cafCommandFeatures)
|
|
add_subdirectory(AppFwk/cafUserInterface)
|
|
add_subdirectory(AppFwk/cafPdmScripting)
|
|
add_subdirectory(AppFwk/cafDataLoader)
|
|
|
|
# Unit Tests
|
|
add_subdirectory(AppFwk/cafProjectDataModel/cafProjectDataModel_UnitTests)
|
|
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmCore/cafPdmCore_UnitTests)
|
|
add_subdirectory(AppFwk/cafProjectDataModel/cafPdmXml/cafPdmXml_UnitTests)
|
|
add_subdirectory(AppFwk/cafPdmScripting/cafPdmScripting_UnitTests)
|
|
add_subdirectory(AppFwk/cafUserInterface/cafUserInterface_UnitTests)
|
|
|
|
# Compile-time benchmark (measures per-file compile cost of PDM field types)
|
|
add_subdirectory(AppFwk/cafProjectDataModel/cafPdm_CompileBench)
|
|
|
|
# Executables
|
|
add_subdirectory(AppFwk/cafTests/cafTestApplication)
|
|
|
|
|
|
# Organize sub-projects into folders on Visual Studio
|
|
# Turn on using solution folders
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
set_property(TARGET cafPdmCore cafPdmUiCore cafPdmXml cafProjectDataModel PROPERTY FOLDER "ProjectDataModel")
|
|
set_property(TARGET cafPdmCore_UnitTests cafPdmXml_UnitTests cafProjectDataModel_UnitTests cafPdmScripting_UnitTests cafUserInterface_UnitTests PROPERTY FOLDER "UnitTests")
|
|
|
|
option (USE_CEE_VIZ "Enable visualization projects" ON)
|
|
if (USE_CEE_VIZ)
|
|
add_subdirectory(VizFwk/LibCore)
|
|
add_subdirectory(AppFwk/cafPdmCvf)
|
|
|
|
add_subdirectory(AppFwk/cafPdmCvf/cafPdmCvf_UnitTests)
|
|
|
|
add_subdirectory(AppFwk/cafTests/cafTestCvfApplication)
|
|
|
|
set_property(TARGET LibCore cafPdmCvf cafPdmCvf_UnitTests cafTestCvfApplication PROPERTY FOLDER "CeeViz")
|
|
endif()
|