Skip to content

Commit

Permalink
CMake: do use VERSION for interface targets for older CMake versions
Browse files Browse the repository at this point in the history
  • Loading branch information
tamiko committed Jan 26, 2023
1 parent b604a36 commit ea1dca1
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 allow 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 ea1dca1

Please sign in to comment.