diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2def4f3049a681aea118ef2ee2b75ee994895b86..ab1d55500e353444cf2d8549d40236fee240a6b1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,6 +77,7 @@ include(CompilerSetup)
 include(JobPools)
 include(Find)
 include(CLCacheSetup)
+include(packaging/PackagingDependencies)
 include(Dependencies)
 include(DocumentationSetup)
 include(test/Test)
@@ -188,8 +189,7 @@ option(OGS_USE_MFRONT
        OFF
 )
 
-# Packaging
-include(scripts/cmake/packaging/Pack.cmake)
+include(packaging/Pack)
 
 # ---- Subdirectories ----
 include_directories(${PROJECT_SOURCE_DIR})
diff --git a/scripts/cmake/packaging/Pack.cmake b/scripts/cmake/packaging/Pack.cmake
index 9440814d3d66b30af1a968974ece5b037b3def6a..5277252bf1ff519482dfdfce7f55570e320a7f2c 100644
--- a/scripts/cmake/packaging/Pack.cmake
+++ b/scripts/cmake/packaging/Pack.cmake
@@ -88,32 +88,3 @@ install(
     CODE "execute_process(COMMAND ${CMAKE_COMMAND} --build ${PROJECT_BINARY_DIR} -t write-licenses)"
 )
 install(FILES ${PROJECT_BINARY_DIR}/third_party_licenses.txt TYPE INFO)
-
-# Install dependencies via GET_RUNTIME_DEPENDENCIES. Available since CMake 3.16.
-if(${CMAKE_VERSION} VERSION_LESS 3.16 OR NOT OGS_INSTALL_DEPENDENCIES)
-    return()
-endif()
-install(
-    CODE [[
-  include(GNUInstallDirs)
-  if(WIN32)
-    set(INSTALL_DIR ${CMAKE_INSTALL_FULL_BINDIR})
-  else()
-    set(INSTALL_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
-  endif()
-  file(GET_RUNTIME_DEPENDENCIES
-    EXECUTABLES $<$<TARGET_EXISTS:ogs>:$<TARGET_FILE:ogs>> $<$<TARGET_EXISTS:DataExplorer>:$<TARGET_FILE:DataExplorer>>
-    RESOLVED_DEPENDENCIES_VAR _r_deps
-    UNRESOLVED_DEPENDENCIES_VAR _u_deps
-    POST_EXCLUDE_REGEXES "/opt/local/lib/lib.*" # Disable macports zlib
-  )
-  file(INSTALL ${_r_deps}
-    DESTINATION ${INSTALL_DIR}
-    FOLLOW_SYMLINK_CHAIN
-  )
-  list(LENGTH _u_deps _u_length)
-  if("${_u_length}" GREATER 0)
-    message(WARNING "Unresolved dependencies detected!\n${_u_deps}")
-  endif()
-]]
-)
diff --git a/scripts/cmake/packaging/PackagingDependencies.cmake b/scripts/cmake/packaging/PackagingDependencies.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..70d7673283fa0e680bed23153c75ab486bc8d51f
--- /dev/null
+++ b/scripts/cmake/packaging/PackagingDependencies.cmake
@@ -0,0 +1,28 @@
+# Install dependencies via GET_RUNTIME_DEPENDENCIES. Available since CMake 3.16.
+if(${CMAKE_VERSION} VERSION_LESS 3.16 OR NOT OGS_INSTALL_DEPENDENCIES)
+    return()
+endif()
+install(
+    CODE [[
+  include(GNUInstallDirs)
+  if(WIN32)
+    set(INSTALL_DIR ${CMAKE_INSTALL_FULL_BINDIR})
+  else()
+    set(INSTALL_DIR ${CMAKE_INSTALL_FULL_LIBDIR})
+  endif()
+  file(GET_RUNTIME_DEPENDENCIES
+    EXECUTABLES $<$<TARGET_EXISTS:ogs>:$<TARGET_FILE:ogs>> $<$<TARGET_EXISTS:DataExplorer>:$<TARGET_FILE:DataExplorer>>
+    RESOLVED_DEPENDENCIES_VAR _r_deps
+    UNRESOLVED_DEPENDENCIES_VAR _u_deps
+    POST_EXCLUDE_REGEXES "/opt/local/lib/lib.*" # Disable macports zlib
+  )
+  file(INSTALL ${_r_deps}
+    DESTINATION ${INSTALL_DIR}
+    FOLLOW_SYMLINK_CHAIN
+  )
+  list(LENGTH _u_deps _u_length)
+  if("${_u_length}" GREATER 0)
+    message(WARNING "Unresolved dependencies detected!\n${_u_deps}")
+  endif()
+]]
+)