From 5ddcaa9bc2522af6d4cd2017767ea27b7baac7d1 Mon Sep 17 00:00:00 2001
From: Valerio Mariani <valerio.mariani@unibas.ch>
Date: Sat, 8 Jun 2013 03:22:35 +0200
Subject: [PATCH] TGZ package support for UBUNTU_LAYOUT

A little less hackish solution. Thanks to Andi for the suggestion
---
 cmake_support/CopyDependencies.cmake | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/cmake_support/CopyDependencies.cmake b/cmake_support/CopyDependencies.cmake
index 88d88fcc1..85ba58729 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()
-- 
GitLab