+### Installation
+
+if(NOT CMAKE_INSTALL_PREFIX AND WIN32)
+ set(CMAKE_INSTALL_PREFIX "C:/Lugaru")
+endif(NOT CMAKE_INSTALL_PREFIX AND WIN32)
+
+# OS-specific installation paths
+
+set(LUGARU_DOCDIR ${CMAKE_INSTALL_PREFIX})
+if(LINUX)
+endif(LINUX)
+
+if(APPLE)
+ set(LUGARU_APP_ROOT ${CMAKE_INSTALL_PREFIX}/Lugaru.app)
+ set(LUGARU_BINDIR ${LUGARU_APP_ROOT}/Contents/MacOS)
+ set(LUGARU_RESDIR ${LUGARU_APP_ROOT}/Contents/Resources)
+endif(APPLE)
+
+# Actual installation instructions
+
+if(WIN32)
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru.exe DESTINATION ${CMAKE_INSTALL_PREFIX})
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX})
+ if(MINGW)
+ # Based off Mageia/Fedora MinGW toolchain, might not work on other distros or Windows
+ set(LIBGCC_S libgcc_s_sjlj-1.dll)
+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") # MinGW64
+ set(LIBGCC_S libgcc_s_seh-1.dll)
+ endif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+ # FIXME: Filter out unneeded DLLs when building against some internal deps
+ set(DLL_ROOT ${CMAKE_FIND_ROOT_PATH}/bin)
+ install(FILES ${DLL_ROOT}/${LIBGCC_S}
+ ${DLL_ROOT}/libjpeg-62.dll
+ ${DLL_ROOT}/libogg-0.dll
+ ${DLL_ROOT}/libpng16-16.dll
+ ${DLL_ROOT}/libstdc++-6.dll
+ ${DLL_ROOT}/libvorbis-0.dll
+ ${DLL_ROOT}/libvorbisfile-3.dll
+ ${DLL_ROOT}/libwinpthread-1.dll
+ ${DLL_ROOT}/OpenAL32.dll
+ ${DLL_ROOT}/SDL2.dll
+ ${DLL_ROOT}/zlib1.dll
+ DESTINATION ${CMAKE_INSTALL_PREFIX})
+ endif(MINGW)
+endif(WIN32)
+
+if(LINUX)
+ if(SYSTEM_INSTALL)
+ add_definitions(-DDATA_DIR="${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}")
+ set(LUGARU_DOCDIR ${CMAKE_INSTALL_DOCDIR})
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_BINDIR})
+ # Trailing '/' is significant, it installs and _renames_ Data/ as the destination folder
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data/ DESTINATION ${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME})
+ install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata)
+ install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications)
+ install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps)
+ install(FILES ${CMAKE_SOURCE_DIR}/Dist/lugaru.6 DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
+ else(SYSTEM_INSTALL)
+ message("You are building Lugaru without having enabled the SYSTEM_INSTALL option. It will default to looking for the data in the 'Data' directory next to the binary.")
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${CMAKE_INSTALL_PREFIX})
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${CMAKE_INSTALL_PREFIX})
+ endif(SYSTEM_INSTALL)
+endif(LINUX)
+
+if(APPLE)
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lugaru DESTINATION ${LUGARU_BINDIR})
+ install(DIRECTORY ${CMAKE_SOURCE_DIR}/Data DESTINATION ${LUGARU_APP_ROOT})
+ install(FILES ${CMAKE_SOURCE_DIR}/Dist/OSX/Lugaru.icns DESTINATION ${LUGARU_RESDIR})
+ install(FILES ${CMAKE_SOURCE_DIR}/Dist/OSX/Info.plist DESTINATION ${LUGARU_APP_ROOT}/Contents)
+endif(APPLE)
+
+# Documentation
+
+install(FILES ${CMAKE_SOURCE_DIR}/AUTHORS
+ ${CMAKE_SOURCE_DIR}/CONTENT-LICENSE.txt
+ ${CMAKE_SOURCE_DIR}/COPYING.txt
+ ${CMAKE_SOURCE_DIR}/README.md
+ ${CMAKE_SOURCE_DIR}/RELEASE-NOTES.md
+ ${CMAKE_SOURCE_DIR}/Docs/DEVTOOLS.txt
+ ${CMAKE_SOURCE_DIR}/Docs/README.Empire.txt
+ ${CMAKE_SOURCE_DIR}/Docs/README.SevenTasks.txt
+ ${CMAKE_SOURCE_DIR}/Docs/README.Temple.txt
+ DESTINATION ${LUGARU_DOCDIR})