diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 4520e1c33e..fcd795dde7 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -45,18 +45,17 @@ function(configure_build_install_location _library_name) 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 \ - ../gz/${GZ_PYTHON_INSTALL_PATH}\/$ \ - ${PROJECT_BINARY_DIR}\/ignition/$)") + install(TARGETS ${_library_name} + DESTINATION "${IGN_PYTHON_INSTALL_PATH}" + ) else() install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \ ../gz/$ \ ${PROJECT_BINARY_DIR}\/ignition/$)") + install(FILES ${PROJECT_BINARY_DIR}\/ignition/$ + DESTINATION "${IGN_PYTHON_INSTALL_PATH}/" + ) endif() - - install(FILES ${PROJECT_BINARY_DIR}\/ignition/$ - DESTINATION "${IGN_PYTHON_INSTALL_PATH}/" - ) endif() endfunction()