Skip to content

Commit

Permalink
Windows|Cygwin: Post-build step to copy dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 4d01c3e commit ff01fe9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
2 changes: 2 additions & 0 deletions doomsday/CMakeLists.txt
Expand Up @@ -13,3 +13,5 @@ if (NOT IOS)
add_subdirectory (tools)
endif ()
endif ()

add_subdirectory (post)
4 changes: 3 additions & 1 deletion doomsday/build/scripts/cygwin_deps.py
Expand Up @@ -10,7 +10,9 @@
raise Exception('Please run under cygwin')
system_bin = '/bin'
objdump_cmd = '/bin/objdump'
root = os.path.join(sys.argv[1])
root = os.path.abspath(sys.argv[1])
if root.startswith('/usr'):
print('cygwin_deps.py will not copy system libraries to a destination under /usr')
binaries = set(filter(lambda n: os.path.splitext(n)[1].lower() in ['.exe', '.dll'],
os.listdir(root)))
while binaries:
Expand Down
22 changes: 22 additions & 0 deletions doomsday/post/CMakeLists.txt
@@ -0,0 +1,22 @@
# Doomsday Engine - Post-build operations

cmake_minimum_required (VERSION 3.1)
include (../cmake/Config.cmake)

# Deployment of system libraries
if (DE_ENABLE_DEPLOYMENT)
if (CYGWIN)
set (scriptName "cygwin_deps.py")
else ()
set (scriptName)
endif ()
if (scriptName)
install (CODE "
message (STATUS \"Copying dependencies...\")
execute_process (
COMMAND ${PYTHON_EXECUTABLE} ${DE_SOURCE_DIR}/build/scripts/${scriptName}
${CMAKE_INSTALL_PREFIX}/bin
OUTPUT_QUIET
)")
endif ()
endif ()

0 comments on commit ff01fe9

Please sign in to comment.