diff --git a/cmake_support/CopyDependencies.cmake b/cmake_support/CopyDependencies.cmake index 88d88fcc1e98fb66967c8cdf826e5201a9b3cd0b..85ba58729b5ba15f4e0bb312da6b72d41147d22b 100644 --- a/cmake_support/CopyDependencies.cmake +++ b/cmake_support/CopyDependencies.cmake @@ -981,9 +981,11 @@ function(copy_python include_path version new_binary_path) get_filename_component(real_python_include_path ${include_path} REALPATH) get_filename_component(python_root_dir ${real_python_include_path}/../.. REALPATH) if (_UBUNTU_LAYOUT) - execute_process(COMMAND cp -rL ${python_root_dir}/${LIB_DIR}/python${version} ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/) - message("Output: ${out}") - message("Error: ${error}") + file (GLOB_RECURSE python_lib_files RELATIVE ${python_root_dir}/${LIB_DIR}/python${version}/ FOLLOW_SYMLINKS ${python_root_dir}/${LIB_DIR}/python${version}/*) + foreach(python_lib_file ${python_lib_files}) + get_filename_component(real_python_lib_file ${python_root_dir}/${LIB_DIR}/python${version}/${python_lib_file} REALPATH) + execute_process(COMMAND cmake -E copy ${real_python_lib_file} ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${version}/${python_lib_file}) + endforeach() else() file(COPY ${python_root_dir}/${LIB_DIR}/python${version}/ DESTINATION ${CMAKE_INSTALL_PREFIX}/${LIB_DIR}/python${version} PATTERN "*.pyc" EXCLUDE) endif()