From c62212136ae2ac6e539bc37cc7aad4ab0e9f8f9b Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 16 Nov 2023 14:35:28 +0100 Subject: [PATCH] Do not redefine CMAKE_INSTALL_PYTHONDIR if it is already defined --- 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()