From a3fec901b8c9e02d60593a749737aebcbf732ffa Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Mon, 26 Dec 2016 05:26:21 -0500 Subject: [PATCH] Avoid CMP0048 warning (#570) Fixes #567. If pybind's CMakeLists gets loaded via an include_directory from another CMakeLists with a higher minimum version (e.g. 3.0), the project() command without a version produces a CMP0048 warning. This commit explicitly requests the new behaviour if the policy exists, as it won't cause problems (we set VERSION later). --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2198bae..341f845e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,11 @@ cmake_minimum_required(VERSION 2.8.12) +if (POLICY CMP0048) + # cmake warns if loaded from a min-3.0-required parent dir, so silence the warning: + cmake_policy(SET CMP0048 NEW) +endif() + project(pybind11) # Check if pybind11 is being used directly or via add_subdirectory