diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a497733c..336e8cb52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,18 @@ project(OpenMW) -cmake_minimum_required(VERSION 3.1.0) # CMP0083 NEW +cmake_minimum_required(VERSION 3.1.0) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# for link time optimization, remove if cmake version is >= 3.9 +if(POLICY CMP0069) # LTO + cmake_policy(SET CMP0069 NEW) +endif() + +# for position-independent executable, remove if cmake version is >= 3.14 +if(POLICY CMP0083) + cmake_policy(SET CMP0083 NEW) +endif() + # Detect OS include(cmake/OSIdentity.cmake)