From 20f824e8e800a47ac19e45cf5392039a02c5836f Mon Sep 17 00:00:00 2001 From: Gulliver Date: Fri, 18 Sep 2020 18:59:38 +0200 Subject: [PATCH 1/2] added "new" behaviour for Policy CMP0077 which allows to control the build options by variables if lib is used by FetchContent of a super project --- expat/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index b2ae0451..4b9308d8 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -3,6 +3,10 @@ cmake_minimum_required(VERSION 3.1.3) +if(POLICY CMP0077) + cmake_policy(SET CMP0077 NEW) +endif() + project(expat VERSION 2.2.9 From 373e974b11439c6a02def909ce7e27823eaceec4 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Sat, 26 Sep 2020 14:52:44 +0200 Subject: [PATCH 2/2] Changes: Document #419 --- expat/CMakeLists.txt | 24 ++++++++++++++++++++++++ expat/Changes | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt index 4b9308d8..fc2c68d6 100644 --- a/expat/CMakeLists.txt +++ b/expat/CMakeLists.txt @@ -3,6 +3,30 @@ cmake_minimum_required(VERSION 3.1.3) +# This allows controlling documented build time switches +# when Expat is pulled in using the add_subdirectory function, e.g. +# +# set(EXPAT_BUILD_DOCS OFF) +# set(EXPAT_BUILD_TOOLS OFF) +# add_subdirectory(${expat_SOURCE_DIR}/expat ${expat_BINARY_DIR}) +# +# would disable compilation of the xmlwf CLI and its man page. +# Without activating behaviour NEW for policy CMP0077 here, +# a user with -Wdev enabled would see warning +# +# Policy CMP0077 is not set: option() honors normal variables. Run "cmake +# --help-policy CMP0077" for policy details. Use the cmake_policy command to +# set the policy and suppress this warning. +# +# For compatibility with older versions of CMake, option is clearing the +# normal variable 'EXPAT_BUILD_DOCS'. +# +# and effectively not be able to adjust option EXPAT_BUILD_DOCS. +# +# For more details please see: +# - https://cmake.org/cmake/help/latest/policy/CMP0077.html +# - https://github.com/libexpat/libexpat/pull/419 +# if(POLICY CMP0077) cmake_policy(SET CMP0077 NEW) endif() diff --git a/expat/Changes b/expat/Changes index a7ca17cf..9d696888 100644 --- a/expat/Changes +++ b/expat/Changes @@ -27,7 +27,7 @@ Release x.x.x xxx xxxxxxxxx xx xxxx involving -DEXPAT_CHAR_TYPE=(ushort|wchar_t) #360 CMake: Install pre-compiled shipped xmlwf.1 manpage in case of -DEXPAT_BUILD_DOCS=OFF - #375 #380 CMake: Fix use of Expat by means of add_subdirectory + #375 #380 #419 CMake: Fix use of Expat by means of add_subdirectory #407 #408 CMake: Keep expat target name constant at "expat" (i.e. refrain from using the target name to control build artifact filenames) @@ -42,6 +42,7 @@ Release x.x.x xxx xxxxxxxxx xx xxxx Special thanks to: asavah Ben Wagner + Frank Landgraf Jeffrey Walton Joe Orton Kleber TarcĂ­sio