From 23f59fe284d3cbdf526cf2ca43d5dd6948c06547 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 16 Nov 2023 14:40:10 +0100 Subject: [PATCH] Do not redefine CMAKE_INSTALL_PYTHONDIR if it is already defined (#914) --- bindings/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bindings/CMakeLists.txt b/bindings/CMakeLists.txt index 93b219c6d3..9070e088c2 100644 --- a/bindings/CMakeLists.txt +++ b/bindings/CMakeLists.txt @@ -68,8 +68,10 @@ if(CREATE_PYTHON) OUTPUT_STRIP_TRAILING_WHITESPACE) set(_CMAKE_INSTALL_PYTHONDIR "${PYTHON_INSTDIR}") - set(CMAKE_INSTALL_PYTHONDIR ${_CMAKE_INSTALL_PYTHONDIR} CACHE PATH "python bindings (${_CMAKE_INSTALL_PYTHONDIR})") - mark_as_advanced(CMAKE_INSTALL_PYTHONDIR) + if(NOT DEFINED CMAKE_INSTALL_PYTHONDIR) + set(CMAKE_INSTALL_PYTHONDIR ${_CMAKE_INSTALL_PYTHONDIR} CACHE PATH "python bindings (${_CMAKE_INSTALL_PYTHONDIR})") + mark_as_advanced(CMAKE_INSTALL_PYTHONDIR) + endif() if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_PYTHONDIR}) set(CMAKE_INSTALL_FULL_PYTHONDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_PYTHONDIR}") else()