diff --git a/CMakeLists.txt b/CMakeLists.txt index f4a0cc80..42de3820 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ # minimum required CMake version cmake_minimum_required(VERSION 3.18.0) -cmake_policy(SET CMP0148 OLD) +# if cmake version is greater than 3.26, set the policy to OLD +if(${CMAKE_VERSION} VERSION_GREATER "3.26") + cmake_policy(SET CMP0148 OLD) +endif() # if on a Mac, use any GNU compiler from Homebrew if(APPLE)