From daf080ff192ad664f2fb714ccfe64a056be52040 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Fri, 22 Jan 2021 19:37:07 +0000 Subject: [PATCH] cmake: Move MYGUI/OSG_STATIC default to top-level Makes it clear that the USE_SYSTEM variables affect the defaults of STATIC variables. --- CMakeLists.txt | 6 ++++++ extern/CMakeLists.txt | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 336e8cb52..fc0d1b32c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,11 +111,17 @@ option(QT_STATIC "Link static build of QT into the binaries" FALSE) option(OPENMW_USE_SYSTEM_OSG "Use system provided OpenSceneGraph libraries" ON) option(OSG_STATIC "Link static build of OpenSceneGraph into the binaries" OFF) +if(NOT OPENMW_USE_SYSTEM_OSG) + set(OSG_STATIC ON CACHE BOOL "") +endif() option(OPENMW_USE_SYSTEM_BULLET "Use system provided bullet physics library" ON) option(OPENMW_USE_SYSTEM_MYGUI "Use system provided mygui library" ON) option(MYGUI_STATIC "Link static build of Mygui into the binaries" OFF) +if(NOT OPENMW_USE_SYSTEM_MYGUI) + set(MYGUI_STATIC ON CACHE BOOL "") +endif() option(OPENMW_UNITY_BUILD "Use fewer compilation units to speed up compile time" FALSE) option(OPENMW_LTO_BUILD "Build OpenMW with Link-Time Optimization (Needs ~2GB of RAM)" OFF) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 4fd453601..de2f80ddf 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -54,8 +54,6 @@ endif() if(NOT OPENMW_USE_SYSTEM_MYGUI) cmake_minimum_required(VERSION 3.11) # for FetchContent - set(MYGUI_STATIC ON CACHE BOOL "" PARENT_SCOPE) - set(MYGUI_RENDERSYSTEM 4 CACHE STRING "") set(MYGUI_DISABLE_PLUGINS TRUE CACHE BOOL "") set(MYGUI_BUILD_DEMOS OFF CACHE BOOL "") @@ -78,8 +76,6 @@ endif() if(NOT OPENMW_USE_SYSTEM_OSG) cmake_minimum_required(VERSION 3.11) # for FetchContent - set(OSG_STATIC ON CACHE BOOL "" PARENT_SCOPE) - set(DYNAMIC_OPENTHREADS OFF CACHE BOOL "") set(DYNAMIC_OPENSCENEGRAPH OFF CACHE BOOL "") set(BUILD_OSG_APPLICATIONS OFF CACHE BOOL "")