aboutsummaryrefslogtreecommitdiff
path: root/cpack/fakeroot_fix.cmake
diff options
context:
space:
mode:
authorspicyjpeg <thatspicyjpeg@gmail.com>2024-10-14 17:44:12 +0200
committerspicyjpeg <thatspicyjpeg@gmail.com>2024-10-14 17:44:12 +0200
commit787db196ad3c4e945792997111d759f82110775a (patch)
tree878943ae179709b77f411ce5c4857d28eb6d8fc2 /cpack/fakeroot_fix.cmake
parent9c792e636a7803f8003643b2f91f040257398b3f (diff)
downloadpsn00bsdk-787db196ad3c4e945792997111d759f82110775a.tar.gz
Deprecate CPack packages and old changelog, fix ldscripts
Diffstat (limited to 'cpack/fakeroot_fix.cmake')
-rw-r--r--cpack/fakeroot_fix.cmake32
1 files changed, 0 insertions, 32 deletions
diff --git a/cpack/fakeroot_fix.cmake b/cpack/fakeroot_fix.cmake
deleted file mode 100644
index e34baa0..0000000
--- a/cpack/fakeroot_fix.cmake
+++ /dev/null
@@ -1,32 +0,0 @@
-# This script works around a bug in CPack's DEB/RPM generator, which causes
-# files installed by subprojects (not by the main CMake script) to end up in
-# packages alongside the "real" installation directory. It probably happens due
-# to CMake running under fakeroot (when invoked by CPack to prepare the files
-# to be packaged) and referencing absolute paths, which would explain why the
-# entire build directory tree is replicated inside the packages. What this
-# script does is simply finding and deleting all directories that do not match
-# the installation prefix before CPack generates the package.
-
-cmake_minimum_required(VERSION 3.21)
-
-set(_prefix ${CPACK_TEMPORARY_INSTALL_DIRECTORY}${CPACK_PACKAGING_INSTALL_PREFIX})
-
-file(
- GLOB_RECURSE _entries
- LIST_DIRECTORIES ON
- ${CPACK_TEMPORARY_INSTALL_DIRECTORY}/*
-)
-
-foreach(_entry IN LISTS _entries)
- # Skip the entry if it (or its parent directory) has already been deleted.
- if(NOT EXISTS ${_entry})
- continue()
- endif()
-
- # Delete anything whose path doesn't start with the expected prefix.
- string(FIND ${_entry} ${_prefix} _index)
- if(NOT _index EQUAL 0)
- message(NOTICE "Deleting unneeded entry from package: ${_entry}")
- file(REMOVE_RECURSE ${_entry})
- endif()
-endforeach()