Skip to content

Commit

Permalink
Fix scope of CMake Policy variables
Browse files Browse the repository at this point in the history
Commit 7d47760 ("moving some settings to an apposite cmake file")
moved the `cmake_policy(SET CMP0072 NEW)` from the toplevel scope to the
scope of the included file. For details, see
https://cmake.org/cmake/help/latest/manual/cmake-policies.7.html

Set NO_POLICY_SCOPE when including the file, to move the POLICIES back
to the toplevel scope. Also remove the extra cmake_minimum_version from
external/CMakeLists.txt, as it implicitly calls
`cmake_policy(VERSION 3.10)`, resetting any policies introduced with
cmake 3.11 and newer (i.e. CMP0072).

Fixes cnr-isti-vclab#1095.
  • Loading branch information
StefanBruens committed Sep 26, 2021
1 parent 170ec29 commit 16e7f69
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ option(MESHLAB_IS_NIGHTLY_VERSION "Nightly version of meshlab will be used inste

### Dependencies
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/meshlab_global_settings.cmake")
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/meshlab_global_settings.cmake" NO_POLICY_SCOPE)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/meshlab_tools.cmake")

#message(STATUS "Searching for required components")
Expand Down
2 changes: 0 additions & 2 deletions src/external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
# Copyright 2019, 2020, Visual Computing Lab, ISTI - Italian National Research Council
# SPDX-License-Identifier: BSL-1.0

cmake_minimum_required(VERSION 3.10)

option(
ALLOW_OPTIONAL_EXTERNAL_MESHLAB_LIBRARIES
"Allow to use/build optional external libraries"
Expand Down

0 comments on commit 16e7f69

Please sign in to comment.