summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-02-05 12:09:20 -0600
committerAndrew <forkk@forkk.net>2013-02-05 12:09:20 -0600
commit2f619e40436175b4fb30c449e43305039d87348a (patch)
tree5612c255976a9d05cf5329656e39f3141445447f
parent74c5a582b146e62f34b9933530d7cf2c96c026df (diff)
downloadMultiMC-2f619e40436175b4fb30c449e43305039d87348a.tar
MultiMC-2f619e40436175b4fb30c449e43305039d87348a.tar.gz
MultiMC-2f619e40436175b4fb30c449e43305039d87348a.tar.lz
MultiMC-2f619e40436175b4fb30c449e43305039d87348a.tar.xz
MultiMC-2f619e40436175b4fb30c449e43305039d87348a.zip
Added install target for Windows.
-rw-r--r--CMakeLists.txt52
-rw-r--r--dependencies.cmake.in25
2 files changed, 75 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 570900f7..cb9e6faa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.9)
-project(MultiMC5)
+project(MultiMC)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -144,6 +144,11 @@ gui/settingsdialog.ui
gui/newinstancedialog.ui
)
+IF(WIN32)
+SET(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS}
+Ws2_32)
+ENDIF()
+
SET_SOURCE_FILES_PROPERTIES(resources/MultiMCLauncher.jar GENERATED)
QT5_WRAP_UI(MULTIMC_UI ${MULTIMC5_UIS})
@@ -153,4 +158,47 @@ add_executable(MultiMC ${MULTIMC_SOURCES} ${MULTIMC_HEADERS} ${MULTIMC_UI} ${MUL
qt5_use_modules(MultiMC Widgets)
target_link_libraries(MultiMC quazip patchlib ${MultiMC_LINK_ADDITIONAL_LIBS})
add_dependencies(MultiMC MultiMCLauncher)
-install(TARGETS MultiMC RUNTIME DESTINATION bin)
+install(TARGETS MultiMC RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
+
+IF(WIN32)
+IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+SET(D "d")
+ELSE()
+SET(D "")
+ENDIF()
+
+install(FILES "${Qt5_DIR}/plugins/platforms/qwindows${D}.dll" DESTINATION platforms)
+install(FILES "${Qt5_DIR}/plugins/platforms/qminimal${D}.dll" DESTINATION platforms)
+install(FILES "${Qt5_DIR}/bin/libEGL${D}.dll" DESTINATION ${CMAKE_INSTALL_PREFIX})
+
+install(FILES "${Qt5_DIR}/plugins/imageformats/qsvg${D}.dll" DESTINATION imageformats)
+install(FILES "${Qt5_DIR}/plugins/imageformats/qico${D}.dll" DESTINATION imageformats)
+install(FILES "${Qt5_DIR}/plugins/imageformats/qgif${D}.dll" DESTINATION imageformats)
+install(FILES "${Qt5_DIR}/plugins/imageformats/qjpeg${D}.dll" DESTINATION imageformats)
+
+ELSEIF(UNIX)
+ENDIF()
+
+
+GET_TARGET_PROPERTY(BINARY_LOCATION MultiMC LOCATION)
+CONFIGURE_FILE(
+ "${CMAKE_CURRENT_SOURCE_DIR}/dependencies.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake"
+ @ONLY
+ )
+INSTALL(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/dependencies.cmake")
+
+
+# Package with CPack
+IF(UNIX)
+ if(APPLE)
+ SET(CPACK_GENERATOR "ZIP")
+ else()
+ SET(CPACK_GENERATOR "TGZ")
+ endif()
+ELSEIF(WIN32)
+ SET(CPACK_GENERATOR "ZIP")
+ENDIF()
+set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
+set(CPACK_PACKAGE_FILE_NAME "MultiMC")
+INCLUDE(CPack)
diff --git a/dependencies.cmake.in b/dependencies.cmake.in
new file mode 100644
index 00000000..1790b97b
--- /dev/null
+++ b/dependencies.cmake.in
@@ -0,0 +1,25 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+message(STATUS "Running install script...")
+
+SET(Qt5_DIR @Qt5_DIR@)
+
+INCLUDE(GetPrerequisites)
+GET_PREREQUISITES(@BINARY_LOCATION@ MULTIMC_PREREQS 1 1 "" "")
+
+message(STATUS "Prerequisites: ${MULTIMC_PREREQS}")
+
+FOREACH(PREREQ ${MULTIMC_PREREQS})
+ GET_FILENAME_COMPONENT(PREREQ_NAME "${PREREQ}" NAME)
+ GET_FILENAME_COMPONENT(_PREREQ_ACTUAL "${PREREQ}" REALPATH)
+ SET(PREREQ_ACTUAL "${Qt5_DIR}/bin/${PREREQ}")
+
+ message(STATUS "Adding install prerequisite: ${PREREQ_NAME}")
+
+ FILE(INSTALL
+ DESTINATION "${CMAKE_INSTALL_PREFIX}"
+ TYPE PROGRAM
+ RENAME "${PREREQ_NAME}"
+ FILES "${PREREQ_ACTUAL}"
+ )
+ENDFOREACH()