Skip to content

Commit

Permalink
Merge pull request #314 from mbeutel/feature/fix-269-post
Browse files Browse the repository at this point in the history
Fix CMake version dependent inconsistency
  • Loading branch information
drdanz authored Feb 7, 2020
2 parents 597f2b1 + 514719e commit bb93539
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/InstallBasicPackageFiles.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,10 @@ ${_compatibility_vars}
# CMake >= 3.15 already checks for CMAKE_EXPORT_PACKAGE_REGISTRY in `export(PACKAGE)` (cf.
# cf. https://cmake.org/cmake/help/latest/policy/CMP0090.html), and we effectively back-port
# this behavior to earlier versions.
if(CMAKE_EXPORT_PACKAGE_REGISTRY OR CMAKE_VERSION VERSION_GREATER_EQUAL 3.15)
# Note that even never CMake versions may apply old policy behaviors if the consuming project
# requires a lower version of CMake (e.g. `cmake_minimum_required(VERSION 3.14)`), so the
# check for `CMAKE_EXPORT_PACKAGE_REGISTRY` is necessary for CMake >= 3.15 as well.
if(CMAKE_EXPORT_PACKAGE_REGISTRY)
export(PACKAGE ${_Name})
endif()

Expand Down

0 comments on commit bb93539

Please sign in to comment.