]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
cmake: Set CMP0074 to NEW 1101/head
authorJean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Thu, 6 Dec 2018 06:31:55 +0000 (01:31 -0500)
committerJean-Christophe Fillion-Robin <jchris.fillionr@kitware.com>
Thu, 6 Dec 2018 06:48:42 +0000 (01:48 -0500)
This is to address the following configuration warning reported
when configuring LibArchive passing ZLIB_ROOT option:

  CMake Warning (dev) at CMakeLists.txt:393 (FIND_PACKAGE):
    Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
    Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
    command to set the policy and suppress this warning.

    CMake variable ZLIB_ROOT is set to:

      /path/to/zlib-install

    For compatibility, CMake is ignoring the variable.
  This warning is for project developers.  Use -Wno-dev to suppress it.

Co-authored-by: Matt McCormick <matt.mccormick@kitware.com>
CMakeLists.txt

index 81aa1aebe738d6150b707d6ddeea9b9b5eec993a..9faad848c37ddc1902099c3e61ebafb0b8219fa1 100644 (file)
@@ -1,5 +1,8 @@
 #
 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
+if(POLICY CMP0074)
+  cmake_policy(SET CMP0074 NEW) #3.12.0 `find_package()`` uses ``<PackageName>_ROOT`` variables.
+endif()
 #
 PROJECT(libarchive C)
 #