From c2549c3c774a93df5e1c80570f3696655519f0d0 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sun, 27 Mar 2022 00:05:55 +0000 Subject: [PATCH] Remove CPack symlinks workaround Looks like it was a CMake defect. --- CMakeLists.txt | 1 - cmake/CPackSourceFixDirLinks.cmake | 28 ---------------------------- 2 files changed, 29 deletions(-) delete mode 100644 cmake/CPackSourceFixDirLinks.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 094b9264f..59fe10390 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -702,7 +702,6 @@ list(APPEND CPACK_SOURCE_IGNORE_FILES "[.]git" "node_modules" ) -set(CPACK_INSTALL_SCRIPTS "${CMAKE_CURRENT_LIST_DIR}/cmake/CPackSourceFixDirLinks.cmake") ## Code Formatting diff --git a/cmake/CPackSourceFixDirLinks.cmake b/cmake/CPackSourceFixDirLinks.cmake deleted file mode 100644 index 64053a229..000000000 --- a/cmake/CPackSourceFixDirLinks.cmake +++ /dev/null @@ -1,28 +0,0 @@ -cmake_minimum_required(VERSION 3.14 FATAL_ERROR) - -if(NOT CPACK_SOURCE_GENERATOR) - return() -endif() - -get_filename_component(SRC_DIR "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) - -file(GLOB_RECURSE SOURCE_FILES LIST_DIRECTORIES true RELATIVE "${SRC_DIR}" "${SRC_DIR}/*") -list(REVERSE SOURCE_FILES) - -foreach(F IN LISTS SOURCE_FILES) - if(NOT IS_SYMLINK "${SRC_DIR}/${F}") - continue() - endif() - - # Links to files seem to be staged correctly - if(NOT IS_DIRECTORY "${SRC_DIR}/${F}") - continue() - endif() - - file(READ_SYMLINK "${SRC_DIR}/${F}" L) - message(STATUS "Fixing link: ${F} -> ${L}") - - get_filename_component(D "${F}" DIRECTORY) - file(MAKE_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${D}/${L}") - file(CREATE_LINK "${L}" "${CMAKE_INSTALL_PREFIX}/${F}" SYMBOLIC) -endforeach()