]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: CMAKE_ROLE defaults to "PROJECT"
authorKefu Chai <kchai@redhat.com>
Thu, 19 Dec 2019 02:56:16 +0000 (10:56 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 19 Dec 2019 02:58:58 +0000 (10:58 +0800)
so we can use exported targets like "Python3::Python", which is defined
only if CMAKE_ROLE is "PROJECT". but this global property was introduced
by CMake 3.14, but the minimum required version of CMake is 3.10.2 in
Ceph project at this moment. let's set it if it's not defined.

Signed-off-by: Kefu Chai <kchai@redhat.com>
cmake/modules/FindPython/Support.cmake

index b2bdc00250bcbc36fa1234bd133a6f13895f4842..6584699b7976d198610a6f6995cc2a9c6d7154b9 100644 (file)
@@ -25,6 +25,10 @@ else()
 endif()
 
 get_property(_${_PYTHON_PREFIX}_CMAKE_ROLE GLOBAL PROPERTY CMAKE_ROLE)
+if (NOT DEFINED _${_PYTHON_PREFIX}_CMAKE_ROLE)
+  # CMake 3.14 introduced CMAKE_ROLE
+  set(_${_PYTHON_PREFIX}_CMAKE_ROLE "PROJECT")
+endif()
 
 
 #