Skip to content

Commit

Permalink
Merge pull request #14738 from tamiko/make_older_cmake_happy
Browse files Browse the repository at this point in the history
CMake: do not use VERSION for interface targets for older CMake versions
  • Loading branch information
drwells committed Jan 27, 2023
2 parents eb3bf71 + c1f4ca7 commit 520c97a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cmake/macros/macro_define_interface_target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 520c97a

Please sign in to comment.