diff --git a/src/python_pybind11/CMakeLists.txt b/src/python_pybind11/CMakeLists.txt index 5b811f27a..d85d1c43b 100644 --- a/src/python_pybind11/CMakeLists.txt +++ b/src/python_pybind11/CMakeLists.txt @@ -110,19 +110,20 @@ function(configure_build_install_location _library_name) # Install Python library symlinks if(${GZ_PYTHON_INSTALL_PATH} MATCHES "gz$") cmake_policy(SET CMP0087 NEW) # Allow evaluation of generator expressions in install(CODE ) + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/ignition") string(REGEX REPLACE "gz$" "ignition" IGN_PYTHON_INSTALL_PATH ${GZ_PYTHON_INSTALL_PATH}) if (WIN32) # Windows requires copy instead of symlink install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy \ - ${CMAKE_INSTALL_PREFIX}\/${GZ_PYTHON_INSTALL_PATH}\/$ \ - ${PROJECT_BINARY_DIR}\/$)") + ../gz/${GZ_PYTHON_INSTALL_PATH}\/$ \ + ${PROJECT_BINARY_DIR}\/ignition/$)") else() install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \ - ${CMAKE_INSTALL_PREFIX}\/${GZ_PYTHON_INSTALL_PATH}\/$ \ - ${PROJECT_BINARY_DIR}\/$)") + ../gz/$ \ + ${PROJECT_BINARY_DIR}\/ignition/$)") endif() - install(FILES ${PROJECT_BINARY_DIR}\/$ + install(FILES ${PROJECT_BINARY_DIR}\/ignition/$ DESTINATION "${IGN_PYTHON_INSTALL_PATH}/" ) endif()