Files
ResInsight/Fwk/VizFwk/CMakeLists.txt
Eirik Marthinsen 9701866736 CMake: Update/Remove old minimum version check
- Update the minimum required CMake version to 3.15 for Fwk folders
  that might be used as top level projects.
- Remove the minimum required CMake version from projects that is just
  included from other top level projects.

Since version 3.19 CMake has been warning that CMake versions below 3.5
is deprecated and support will be removed in the future. This will
silence those warning.

By removing the minimum required version check from projects that is not
intended as top level projects we avoid redundant checks and simplifies
future maintenance.

Closes #10957
2023-12-16 17:35:54 +01:00

76 lines
2.1 KiB
CMake

cmake_minimum_required(VERSION 3.15)
project(VizFramework)
# Determine if we're being run stand-alone or invoked from some other project
set(CEE_STAND_ALONE ON)
if (PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
message("VizFramework project being built stand-alone")
else()
set(CEE_STAND_ALONE OFF)
message("VizFramework project is invoked from other project")
endif()
if (CEE_STAND_ALONE)
# Set a default build type (not relevant for WIN32)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
include(CMake/Utils/ceeDetermineCompilerFlags.cmake)
endif()
# Allow use of non-threadsafe reference counter in cvf::Object on systems with no atomics support
option(CEE_WORKAROUND_ON_SYSTEMS_WITHOUT_ATOMICS "Allow use of non-threadsafe reference counter on systems with no atomics support" OFF)
if (CEE_WORKAROUND_ON_SYSTEMS_WITHOUT_ATOMICS)
add_definitions(-DCVF_WORKAROUND_TO_COMPILE_ON_SYSTEMS_WITHOUT_ATOMICS)
endif()
add_subdirectory(LibCore)
add_subdirectory(LibIo)
add_subdirectory(LibGeometry)
add_subdirectory(LibRender)
add_subdirectory(LibViewing)
add_subdirectory(LibRegGrid2D)
add_subdirectory(LibStructGrid)
add_subdirectory(LibFreeType)
add_subdirectory(ThirdParty/FreeType)
add_subdirectory(LibUtilities)
option(CEE_BUILD_GUI_QT "Build GUI library for Qt" ON)
if (CEE_BUILD_GUI_QT)
option(CEE_USE_QT5 "Use Qt5" OFF)
add_subdirectory(LibGuiQt)
endif()
if (CEE_STAND_ALONE)
option(CEE_BUILD_UNIT_TESTS "Build unit tests" ON)
if (CEE_BUILD_UNIT_TESTS)
add_subdirectory(Tests)
endif()
option(CEE_BUILD_TEST_APPS "Build test apps" ON)
if (CEE_BUILD_TEST_APPS)
if (CEE_BUILD_GUI_QT)
# For now, build the snippet libs here
add_subdirectory(Tests/SnippetsBasis)
add_subdirectory(TestApps/Qt/QtMinimal)
add_subdirectory(TestApps/Qt/QtMultiView)
add_subdirectory(TestApps/Qt/QtSnippetRunner)
endif()
endif()
endif()