summaryrefslogtreecommitdiffstats
path: root/cmake/modules/Distutils.cmake
diff options
context:
space:
mode:
authorKefu Chai <kchai@redhat.com>2019-07-26 09:35:59 +0200
committerSebastian Wagner <sebastian.wagner@suse.com>2019-07-26 12:11:25 +0200
commitde9a04027fea1fb526597d983eba9a0a1de6661d (patch)
tree291c049732635793b75164ebf4a6f75191336f01 /cmake/modules/Distutils.cmake
parentceph.spec, debian: Add python-common to ceph-common (diff)
downloadceph-de9a04027fea1fb526597d983eba9a0a1de6661d.tar.xz
ceph-de9a04027fea1fb526597d983eba9a0a1de6661d.zip
cmake/modules/Distutils: do not add ${name}-clone if already added
if `distutils_install_module("foo" ...)` is called mutiple times with different python version, `foo-clone` will be added multiple times as a custom target. which is not allowed: add_custom_target cannot create target "foo-clone" because another target with the same name already exists. Signed-off-by: Kefu Chai <kchai@redhat.com>
Diffstat (limited to 'cmake/modules/Distutils.cmake')
-rw-r--r--cmake/modules/Distutils.cmake6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake
index d664fa814bd..3275fa51174 100644
--- a/cmake/modules/Distutils.cmake
+++ b/cmake/modules/Distutils.cmake
@@ -11,8 +11,10 @@ function(distutils_install_module name)
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_CURRENT_SOURCE_DIR}/${src} ${src})
endif()
endforeach()
- add_custom_target(${name}-clone ALL
- DEPENDS ${py_clone})
+ if(NOT TARGET ${name}-clone)
+ add_custom_target(${name}-clone ALL
+ DEPENDS ${py_clone})
+ endif()
cmake_parse_arguments(DU "" "INSTALL_SCRIPT;PYTHON_VERSION" "" ${ARGN})
if(DU_PYTHON_VERSION)
set(python_version ${DU_PYTHON_VERSION})