From e698073d6fb775089c7823455fb61fd58b6b09e6 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Fri, 30 Aug 2024 10:39:52 -0700 Subject: [PATCH] Check if policy exists --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bd72d2e69..3306e34701 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,16 @@ cmake_minimum_required(VERSION 3.5) -cmake_policy(SET CMP0082 NEW) # install from sub-directories immediately +if (POLICY CMP0082) + cmake_policy(SET CMP0082 NEW) # install from sub-directories immediately +endif() +if (POLICY CMP0102) cmake_policy(SET CMP0102 NEW) # set policy on advanced variables and cmake cache +endif() +if (POLICY CMP0156) cmake_policy(SET CMP0156 NEW) # new linker strategies +endif() +if (POLICY CMP0167) cmake_policy(SET CMP0167 OLD) # Don't complain about boost +endif() # Set the version number for the library set (GTSAM_VERSION_MAJOR 4)