From: Matthias Maier Date: Thu, 26 Jan 2023 15:07:35 +0000 (-0600) Subject: CMake: do use VERSION for interface targets for older CMake versions X-Git-Tag: v9.5.0-rc1~598^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1f4ca7ce7c708cfee910ea8b8225169ae81e7ba;p=dealii.git CMake: do use VERSION for interface targets for older CMake versions --- diff --git a/cmake/macros/macro_define_interface_target.cmake b/cmake/macros/macro_define_interface_target.cmake index 396b1cc753..b63ab41534 100644 --- a/cmake/macros/macro_define_interface_target.cmake +++ b/cmake/macros/macro_define_interface_target.cmake @@ -78,9 +78,13 @@ function(define_interface_target _feature) if(DEFINED ${_feature}_VERSION) message(STATUS " VERSION: ${${_feature}_VERSION}") - set_target_properties(${_interface_target} - PROPERTIES VERSION "${${_feature_}_VERSION}" - ) + # CMake versions prior to 3.19 have a significantly more restrictive + # set of allowed interface target properties. + if(NOT CMAKE_VERSION VERSION_LESS 3.19) + set_target_properties(${_interface_target} + PROPERTIES VERSION "${${_feature_}_VERSION}" + ) + endif() endif() set(_libraries)