diff --git a/mlir/cmake/modules/AddMLIRPython.cmake b/mlir/cmake/modules/AddMLIRPython.cmake --- a/mlir/cmake/modules/AddMLIRPython.cmake +++ b/mlir/cmake/modules/AddMLIRPython.cmake @@ -134,16 +134,16 @@ get_target_property(_python_root_dir ${sources_target} PYTHON_ROOT_DIR) get_target_property(_python_sources ${sources_target} PYTHON_SOURCES) get_target_property(_specified_dest_prefix ${sources_target} PYTHON_DEST_PREFIX) - set(_dest_prefix "${ARG_ROOT_PREFIX}") - if(_specified_dest_prefix) - set(_dest_prefix "${_dest_prefix}/${_specified_dest_prefix}") - endif() foreach(_source_relative_path ${_python_sources}) + set(_dest_relative_path "${_source_relative_path}") + if(_specified_dest_prefix) + set(_dest_relative_path "${_specified_dest_prefix}/${_dest_relative_path}") + endif() set(_src_path "${_python_root_dir}/${_source_relative_path}") - set(_dest_path "${_dest_prefix}/${_source_relative_path}") + set(_dest_path "${ARG_ROOT_PREFIX}/${_dest_relative_path}") get_filename_component(_dest_dir "${_dest_path}" DIRECTORY) - get_filename_component(_install_path "${ARG_INSTALL_PREFIX}/${_source_relative_path}" DIRECTORY) + get_filename_component(_install_path "${ARG_INSTALL_PREFIX}/${_dest_relative_path}" DIRECTORY) file(MAKE_DIRECTORY "${_dest_dir}") add_custom_command(