]> https://gitweb.dealii.org/ - dealii.git/commitdiff
CMake: do use VERSION for interface targets for older CMake versions 14738/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 26 Jan 2023 15:07:35 +0000 (09:07 -0600)
committerMatthias Maier <tamiko@43-1.org>
Thu, 26 Jan 2023 23:43:43 +0000 (17:43 -0600)
cmake/macros/macro_define_interface_target.cmake

index 396b1cc75378c7abe8e1f80945263925ecdf4110..b63ab415348b320743385d2548d04a504d02c0ae 100644 (file)
@@ -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)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.