Use the same style of CMake files everywhere

This commit is contained in:
Jan Dalheimer 2014-04-06 19:43:09 +02:00
parent 482ad250a4
commit dd7b6642a3
16 changed files with 719 additions and 769 deletions

View File

@ -1,29 +1,34 @@
cmake_minimum_required(VERSION 2.8.9) cmake_minimum_required(VERSION 2.8.9)
IF(WIN32) string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BUILD_DIR}" IS_IN_SOURCE_BUILD)
if(IS_IN_SOURCE_BUILD)
message(AUTHOR_WARNING "You are building MultiMC in-source. This is NOT recommended!")
endif()
if(WIN32)
# In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows # In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows
cmake_policy(SET CMP0020 OLD) cmake_policy(SET CMP0020 OLD)
ENDIF() endif()
project(MultiMC) project(MultiMC)
enable_testing() enable_testing()
######## Set CMake options ######## ######## Set CMake options ########
SET(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
SET(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
SET(FILES_TO_TRANSLATE ) set(FILES_TO_TRANSLATE )
######## Set module path ######## ######## Set module path ########
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/") set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
SET(MMC_SRC "${PROJECT_SOURCE_DIR}") set(MMC_SRC "${PROJECT_SOURCE_DIR}")
SET(MMC_BIN "${PROJECT_BINARY_DIR}") set(MMC_BIN "${PROJECT_BINARY_DIR}")
# Output all executables and shared libs in the main build folder, not in subfolders. # Output all executables and shared libs in the main build folder, not in subfolders.
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
IF(UNIX) if(UNIX)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
ENDIF() endif()
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars) set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
@ -79,85 +84,84 @@ set(QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs)
################################ SET UP BUILD OPTIONS ################################ ################################ SET UP BUILD OPTIONS ################################
######## Check endianness ######## ######## Check endianness ########
INCLUDE(TestBigEndian) include(TestBigEndian)
TEST_BIG_ENDIAN(BIGENDIAN) test_big_endian(BIGENDIAN)
IF(${BIGENDIAN}) if(${BIGENDIAN})
ADD_DEFINITIONS(-DMULTIMC_BIG_ENDIAN) add_definitions(-DMULTIMC_BIG_ENDIAN)
ENDIF(${BIGENDIAN}) endif(${BIGENDIAN})
######## Set URLs ######## ######## Set URLs ########
SET(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch MultiMC's news RSS feed from.") set(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch MultiMC's news RSS feed from.")
######## Set version numbers ######## ######## Set version numbers ########
SET(MultiMC_VERSION_MAJOR 0) set(MultiMC_VERSION_MAJOR 0)
SET(MultiMC_VERSION_MINOR 3) set(MultiMC_VERSION_MINOR 3)
SET(MultiMC_VERSION_HOTFIX 2) set(MultiMC_VERSION_HOTFIX 2)
# Build number # Build number
SET(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.") set(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.")
# Version type # Version type
SET(MultiMC_VERSION_TYPE "Custom" CACHE STRING "MultiMC's version type. This should be one of 'Custom', 'Release', 'ReleaseCandidate', or 'Development', depending on what type of version this is.") set(MultiMC_VERSION_TYPE "Custom" CACHE STRING "MultiMC's version type. This should be one of 'Custom', 'Release', 'ReleaseCandidate', or 'Development', depending on what type of version this is.")
# Build platform. # Build platform.
SET(MultiMC_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.") set(MultiMC_BUILD_PLATFORM "" CACHE STRING "A short string identifying the platform that this build was built for. Only used by the notification system and to display in the about dialog.")
# Version channel # Version channel
SET(MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string.") set(MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string.")
# Channel list URL # Channel list URL
SET(MultiMC_CHANLIST_URL "" CACHE STRING "URL for the channel list.") set(MultiMC_CHANLIST_URL "" CACHE STRING "URL for the channel list.")
# Updater enabled? # Updater enabled?
SET(MultiMC_UPDATER false CACHE BOOL "Whether or not the update system is enabled. If this is enabled, you must also set MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL in order for it to work properly.") set(MultiMC_UPDATER false CACHE BOOL "Whether or not the update system is enabled. If this is enabled, you must also set MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL in order for it to work properly.")
# Notification URL # Notification URL
SET(MultiMC_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.") set(MultiMC_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications.")
SET(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}") set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}")
IF (MultiMC_VERSION_HOTFIX GREATER 0) if(MultiMC_VERSION_HOTFIX GREATER 0)
SET(MultiMC_RELEASE_VERSION_NAME "${MultiMC_RELEASE_VERSION_NAME}.${MultiMC_VERSION_HOTFIX}") set(MultiMC_RELEASE_VERSION_NAME "${MultiMC_RELEASE_VERSION_NAME}.${MultiMC_VERSION_HOTFIX}")
ENDIF() endif()
# Build a version string to display in the configure logs. # Build a version string to display in the configure logs.
IF (MultiMC_VERSION_TYPE STREQUAL "Custom") if(MultiMC_VERSION_TYPE STREQUAL "Custom")
MESSAGE(STATUS "Version Type: Custom") message(STATUS "Version Type: Custom")
SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}")
ELSEIF (MultiMC_VERSION_TYPE STREQUAL "Release") elseif(MultiMC_VERSION_TYPE STREQUAL "Release")
MESSAGE(STATUS "Version Type: Stable Release") message(STATUS "Version Type: Stable Release")
SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}") set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}")
ELSEIF (MultiMC_VERSION_TYPE STREQUAL "ReleaseCandidate") elseif(MultiMC_VERSION_TYPE STREQUAL "ReleaseCandidate")
MESSAGE(STATUS "Version Type: Release Candidate") message(STATUS "Version Type: Release Candidate")
SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-rc${MultiMC_VERSION_BUILD}") set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-rc${MultiMC_VERSION_BUILD}")
ELSEIF (MultiMC_VERSION_TYPE STREQUAL "Development") elseif(MultiMC_VERSION_TYPE STREQUAL "Development")
MESSAGE(STATUS "Version Type: Development") message(STATUS "Version Type: Development")
SET(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}") set(MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}")
ELSE () else()
MESSAGE(ERROR "Invalid build type.") message(ERROR "Invalid build type.")
ENDIF () endif()
MESSAGE(STATUS "MultiMC 5 Version: ${MultiMC_VERSION_STRING}") message(STATUS "MultiMC 5 Version: ${MultiMC_VERSION_STRING}")
# If the update system is enabled, make sure MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL are set. # If the update system is enabled, make sure MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL are set.
IF (MultiMC_UPDATER) if(MultiMC_UPDATER)
IF (MultiMC_VERSION_CHANNEL STREQUAL "") if(MultiMC_VERSION_CHANNEL STREQUAL "")
MESSAGE(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_CHANNEL is not set.\n" message(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_CHANNEL is not set.\n"
"Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.")
ENDIF () endif()
IF (MultiMC_CHANLIST_URL STREQUAL "") if(MultiMC_CHANLIST_URL STREQUAL "")
MESSAGE(FATAL_ERROR "Update system is enabled, but MultiMC_CHANLIST_URL is not set.\n" message(FATAL_ERROR "Update system is enabled, but MultiMC_CHANLIST_URL is not set.\n"
"Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.")
ENDIF () endif()
IF (MultiMC_VERSION_BUILD LESS 0) if(MultiMC_VERSION_BUILD LESS 0)
MESSAGE(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_BUILD is not set.\n" message(FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_BUILD is not set.\n"
"Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.") "Please ensure the CMake variables MultiMC_VERSION_CHANNEL, MultiMC_CHANLIST_URL, and MultiMC_VERSION_BUILD are set.")
ENDIF () endif()
message(STATUS "Updater is enabled. Channel list URL: ${MultiMC_CHANLIST_URL}")
MESSAGE(STATUS "Updater is enabled. Channel list URL: ${MultiMC_CHANLIST_URL}") endif()
ENDIF ()
#### Updater-related build config options #### #### Updater-related build config options ####
option(MultiMC_UPDATER_DRY_RUN "Enable updater dry-run mode -- for updater development." OFF) option(MultiMC_UPDATER_DRY_RUN "Enable updater dry-run mode -- for updater development." OFF)
@ -176,7 +180,7 @@ else()
endif() endif()
#### Custom target to just print the version. #### Custom target to just print the version.
ADD_CUSTOM_TARGET(version echo "Version: ${MultiMC_VERSION_STRING}") add_custom_target(version echo "Version: ${MultiMC_VERSION_STRING}")
#### Check the current Git commit #### Check the current Git commit
execute_process(COMMAND git rev-parse HEAD execute_process(COMMAND git rev-parse HEAD
@ -208,39 +212,39 @@ configure_file("${PROJECT_SOURCE_DIR}/BuildConfig.cpp.in" "${PROJECT_BINARY_DIR}
######## Packaging/install paths setup ######## ######## Packaging/install paths setup ########
IF(UNIX AND APPLE) if(UNIX AND APPLE)
SET(BINARY_DEST_DIR MultiMC.app/Contents/MacOS) set(BINARY_DEST_DIR MultiMC.app/Contents/MacOS)
SET(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS) set(PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS)
SET(QTCONF_DEST_DIR MultiMC.app/Contents/Resources) set(QTCONF_DEST_DIR MultiMC.app/Contents/Resources)
SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app") set(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app")
SET(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC") set(MACOSX_BUNDLE_BUNDLE_NAME "MultiMC")
SET(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.") set(MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility.")
SET(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5") set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.multimc.MultiMC5")
SET(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") set(MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}")
SET(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}")
SET(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") set(MACOSX_BUNDLE_LONG_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}")
SET(MACOSX_BUNDLE_ICON_FILE MultiMC.icns) set(MACOSX_BUNDLE_ICON_FILE MultiMC.icns)
SET(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 MultiMC Contributors") set(MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 MultiMC Contributors")
ELSEIF(UNIX) elseif(UNIX)
SET(BINARY_DEST_DIR bin) set(BINARY_DEST_DIR bin)
SET(PLUGIN_DEST_DIR plugins) set(PLUGIN_DEST_DIR plugins)
SET(QTCONF_DEST_DIR .) set(QTCONF_DEST_DIR .)
SET(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC") set(APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC")
ELSEIF(WIN32) elseif(WIN32)
SET(BINARY_DEST_DIR .) set(BINARY_DEST_DIR .)
SET(PLUGIN_DEST_DIR .) set(PLUGIN_DEST_DIR .)
SET(QTCONF_DEST_DIR .) set(QTCONF_DEST_DIR .)
SET(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe") set(APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe")
ENDIF() endif()
# directories to look for dependencies # directories to look for dependencies
SET(DIRS "${QT_LIBS_DIR}") set(DIRS "${QT_LIBS_DIR}")
################################ Included Libs ################################ ################################ Included Libs ################################
# Add quazip # Add quazip
ADD_DEFINITIONS(-DQUAZIP_STATIC) add_definitions(-DQUAZIP_STATIC)
add_subdirectory(depends/quazip) add_subdirectory(depends/quazip)
include_directories(depends/quazip) include_directories(depends/quazip)
@ -259,12 +263,12 @@ include_directories(${PACK200_INCLUDE_DIR})
######## MultiMC Libs ######## ######## MultiMC Libs ########
# Add the util library. # Add the util library.
ADD_DEFINITIONS(-DLIBUTIL_STATIC) add_definitions(-DLIBUTIL_STATIC)
add_subdirectory(depends/util) add_subdirectory(depends/util)
include_directories(${LIBUTIL_INCLUDE_DIR}) include_directories(${LIBUTIL_INCLUDE_DIR})
# Add the settings library. # Add the settings library.
ADD_DEFINITIONS(-DLIBSETTINGS_STATIC) add_definitions(-DLIBSETTINGS_STATIC)
add_subdirectory(depends/settings) add_subdirectory(depends/settings)
include_directories(${LIBSETTINGS_INCLUDE_DIR}) include_directories(${LIBSETTINGS_INCLUDE_DIR})
@ -274,7 +278,7 @@ add_subdirectory(mmc_updater)
################################ FILES ################################ ################################ FILES ################################
######## Sources and headers ######## ######## Sources and headers ########
SET(MULTIMC_SOURCES set(MULTIMC_SOURCES
# Application base # Application base
MultiMC.h MultiMC.h
MultiMC.cpp MultiMC.cpp
@ -519,7 +523,6 @@ logic/icons/MMCIcon.cpp
logic/icons/IconList.h logic/icons/IconList.h
logic/icons/IconList.cpp logic/icons/IconList.cpp
# misc model/view # misc model/view
logic/EnabledItemFilter.h logic/EnabledItemFilter.h
logic/EnabledItemFilter.cpp logic/EnabledItemFilter.cpp
@ -566,8 +569,7 @@ logic/tools/JVisualVM.cpp
######## UIs ######## ######## UIs ########
SET(MULTIMC_UIS set(MULTIMC_UIS
# Windows # Windows
gui/MainWindow.ui gui/MainWindow.ui
gui/ConsoleWindow.ui gui/ConsoleWindow.ui
@ -607,7 +609,7 @@ foreach(file ${MULTIMC_UIS})
list(APPEND FILES_TO_TRANSLATE "${absfile}") list(APPEND FILES_TO_TRANSLATE "${absfile}")
endforeach() endforeach()
SET(MULTIMC_QRCS set(MULTIMC_QRCS
resources/backgrounds/backgrounds.qrc resources/backgrounds/backgrounds.qrc
resources/multimc/multimc.qrc resources/multimc/multimc.qrc
resources/instances/instances.qrc resources/instances/instances.qrc
@ -615,78 +617,78 @@ resources/instances/instances.qrc
######## Windows resource files ######## ######## Windows resource files ########
IF(WIN32) if(WIN32)
SET(MULTIMC_RCS resources/multimc.rc) set(MULTIMC_RCS resources/multimc.rc)
ENDIF() endif()
####### X11 Stuff ####### ####### X11 Stuff #######
IF(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
SET(MultiMC_QT_ADDITIONAL_MODULES ${MultiMC_QT_ADDITIONAL_MODULES} X11Extras) set(MultiMC_QT_ADDITIONAL_MODULES ${MultiMC_QT_ADDITIONAL_MODULES} X11Extras)
SET(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} xcb) set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} xcb)
LIST(APPEND MULTIMC_SOURCES gui/Platform_X11.cpp) list(APPEND MULTIMC_SOURCES gui/Platform_X11.cpp)
ELSE() else()
LIST(APPEND MULTIMC_SOURCES gui/Platform_Other.cpp) list(APPEND MULTIMC_SOURCES gui/Platform_Other.cpp)
ENDIF() endif()
################################ COMPILE ################################ ################################ COMPILE ################################
# Link additional libraries # Link additional libraries
IF(WIN32) if(WIN32)
SET(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} Qt5::WinMain) set(MultiMC_LINK_ADDITIONAL_LIBS ${MultiMC_LINK_ADDITIONAL_LIBS} Qt5::WinMain)
ENDIF(WIN32) endif(WIN32)
# Tell CMake that MultiMCLauncher.jar is generated. # Tell CMake that MultiMCLauncher.jar is generated.
#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED) #SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED)
#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED) #SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED)
# Qt 5 stuff # Qt 5 stuff
QT5_WRAP_UI(MULTIMC_UI ${MULTIMC_UIS}) qt5_wrap_ui(MULTIMC_UI ${MULTIMC_UIS})
QT5_ADD_RESOURCES(MULTIMC_RESOURCES ${MULTIMC_QRCS}) qt5_add_resources(MULTIMC_RESOURCES ${MULTIMC_QRCS})
# Add common library # Add common library
ADD_LIBRARY(MultiMC_common STATIC ${MULTIMC_SOURCES} ${MULTIMC_UI} ${MULTIMC_RESOURCES}) add_library(MultiMC_common STATIC ${MULTIMC_SOURCES} ${MULTIMC_UI} ${MULTIMC_RESOURCES})
# Add executable # Add executable
ADD_EXECUTABLE(MultiMC MACOSX_BUNDLE WIN32 main.cpp ${MULTIMC_RCS}) add_executable(MultiMC MACOSX_BUNDLE WIN32 main.cpp ${MULTIMC_RCS})
# Link # Link
TARGET_LINK_LIBRARIES(MultiMC MultiMC_common) target_link_libraries(MultiMC MultiMC_common)
TARGET_LINK_LIBRARIES(MultiMC_common xz-embedded unpack200 quazip libUtil libSettings ${MultiMC_LINK_ADDITIONAL_LIBS}) target_link_libraries(MultiMC_common xz-embedded unpack200 quazip libUtil libSettings ${MultiMC_LINK_ADDITIONAL_LIBS})
QT5_USE_MODULES(MultiMC Core Widgets Network Xml Concurrent ${MultiMC_QT_ADDITIONAL_MODULES}) qt5_use_modules(MultiMC Core Widgets Network Xml Concurrent ${MultiMC_QT_ADDITIONAL_MODULES})
QT5_USE_MODULES(MultiMC_common Core Widgets Network Xml Concurrent ${MultiMC_QT_ADDITIONAL_MODULES}) qt5_use_modules(MultiMC_common Core Widgets Network Xml Concurrent ${MultiMC_QT_ADDITIONAL_MODULES})
################################ INSTALLATION AND PACKAGING ################################ ################################ INSTALLATION AND PACKAGING ################################
######## Install ######## ######## Install ########
#### Executable #### #### Executable ####
IF(APPLE AND UNIX) ## OSX if(APPLE AND UNIX) ## OSX
INSTALL(TARGETS MultiMC install(TARGETS MultiMC
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime
) )
ELSEIF(UNIX) ## LINUX and similar elseif(UNIX) ## LINUX and similar
INSTALL(TARGETS MultiMC install(TARGETS MultiMC
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime
) )
INSTALL(PROGRAMS package/linux/MultiMC DESTINATION .) install(PROGRAMS package/linux/MultiMC DESTINATION .)
ELSEIF(WIN32) ## WINDOWS elseif(WIN32) ## WINDOWS
INSTALL(TARGETS MultiMC install(TARGETS MultiMC
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
LIBRARY DESTINATION . COMPONENT Runtime LIBRARY DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION . COMPONENT Runtime RUNTIME DESTINATION . COMPONENT Runtime
) )
ENDIF() endif()
#### Dist package logic #### #### Dist package logic ####
if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
# Image formats # Image formats
INSTALL( install(
DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
DESTINATION ${PLUGIN_DEST_DIR} DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime COMPONENT Runtime
@ -694,7 +696,7 @@ INSTALL(
) )
# Platform plugins # Platform plugins
INSTALL( install(
DIRECTORY "${QT_PLUGINS_DIR}/platforms" DIRECTORY "${QT_PLUGINS_DIR}/platforms"
DESTINATION ${PLUGIN_DEST_DIR} DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime COMPONENT Runtime
@ -702,7 +704,7 @@ INSTALL(
) )
else() else()
# Image formats # Image formats
INSTALL( install(
DIRECTORY "${QT_PLUGINS_DIR}/imageformats" DIRECTORY "${QT_PLUGINS_DIR}/imageformats"
DESTINATION ${PLUGIN_DEST_DIR} DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime COMPONENT Runtime
@ -712,7 +714,7 @@ INSTALL(
) )
# Platform plugins # Platform plugins
INSTALL( install(
DIRECTORY "${QT_PLUGINS_DIR}/platforms" DIRECTORY "${QT_PLUGINS_DIR}/platforms"
DESTINATION ${PLUGIN_DEST_DIR} DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime COMPONENT Runtime
@ -720,9 +722,9 @@ INSTALL(
REGEX "d\\." EXCLUDE REGEX "d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE REGEX "_debug\\." EXCLUDE
) )
IF(APPLE) if(APPLE)
# Accessible plugin to make buttons look decent on osx # Accessible plugin to make buttons look decent on osx
INSTALL( install(
DIRECTORY "${QT_PLUGINS_DIR}/accessible" DIRECTORY "${QT_PLUGINS_DIR}/accessible"
DESTINATION ${PLUGIN_DEST_DIR} DESTINATION ${PLUGIN_DEST_DIR}
COMPONENT Runtime COMPONENT Runtime
@ -730,64 +732,63 @@ IF(APPLE)
REGEX "d\\." EXCLUDE REGEX "d\\." EXCLUDE
REGEX "_debug\\." EXCLUDE REGEX "_debug\\." EXCLUDE
) )
ENDIF() endif()
endif() endif()
# qtconf # qtconf
INSTALL( install(
CODE " CODE "
FILE(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\") file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\")
" "
COMPONENT Runtime COMPONENT Runtime
) )
# ICNS file for OS X # ICNS file for OS X
IF(APPLE) if(APPLE)
INSTALL(FILES resources/MultiMC.icns DESTINATION MultiMC.app/Contents/Resources) install(FILES resources/MultiMC.icns DESTINATION MultiMC.app/Contents/Resources)
ENDIF() endif()
CONFIGURE_FILE( configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/install_prereqs.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/install_prereqs.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake"
@ONLY) @ONLY)
INSTALL(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" COMPONENT Runtime) install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" COMPONENT Runtime)
######## Package ######## ######## Package ########
# Package with CPack # Package with CPack
IF(UNIX) if(UNIX)
if(APPLE) if(APPLE)
SET(CPACK_GENERATOR "ZIP") set(CPACK_GENERATOR "ZIP")
else() else()
SET(CPACK_GENERATOR "TGZ") set(CPACK_GENERATOR "TGZ")
endif() endif()
ELSEIF(WIN32) elseif(WIN32)
SET(CPACK_GENERATOR "ZIP") set(CPACK_GENERATOR "ZIP")
ENDIF() endif()
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
SET(CPACK_PACKAGE_NAME "MultiMC 5") set(CPACK_PACKAGE_NAME "MultiMC 5")
SET(CPACK_PACKAGE_VENDOR "") set(CPACK_PACKAGE_VENDOR "")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MultiMC - Minecraft launcher and management tool.") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "MultiMC - Minecraft launcher and management tool.")
SET(CPACK_PACKAGE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}") set(CPACK_PACKAGE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}")
SET(CPACK_PACKAGE_VERSION_MAJOR ${MultiMC_VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MAJOR ${MultiMC_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${MultiMC_VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_MINOR ${MultiMC_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${MultiMC_VERSION_REV}) set(CPACK_PACKAGE_VERSION_PATCH ${MultiMC_VERSION_REV})
IF(CPACK_GENERATOR STREQUAL "NSIS") if(CPACK_GENERATOR STREQUAL "NSIS")
SET(CPACK_PACKAGE_FILE_NAME "Setup-MultiMC") set(CPACK_PACKAGE_FILE_NAME "Setup-MultiMC")
ELSE() else()
SET(CPACK_PACKAGE_FILE_NAME "MultiMC") set(CPACK_PACKAGE_FILE_NAME "MultiMC")
ENDIF() endif()
IF(WIN32) if(WIN32)
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "MultiMC 5") set(CPACK_PACKAGE_INSTALL_DIRECTORY "MultiMC 5")
ENDIF() endif()
INCLUDE(CPack) include(CPack)
include_directories(${PROJECT_BINARY_DIR}/include) include_directories(${PROJECT_BINARY_DIR}/include)

View File

@ -1,33 +0,0 @@
cmake_minimum_required(VERSION 2.8.9)
message(STATUS "Running install script...")
SET(Qt5_DIR @Qt5_DIR@)
IF(WIN32)
SET(LIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
ELSE()
SET(LIB_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}/lib)
ENDIF()
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)
IF(WIN32)
SET(PREREQ_ACTUAL "${Qt5_DIR}/bin/${PREREQ}")
ENDIF()
message(STATUS "Adding install prerequisite: ${PREREQ_NAME}")
FILE(INSTALL
DESTINATION "${LIB_INSTALL_PREFIX}"
TYPE PROGRAM
RENAME "${PREREQ_NAME}"
FILES "${PREREQ_ACTUAL}"
)
ENDFOREACH()

View File

@ -8,7 +8,7 @@ find_package(Qt5Core REQUIRED)
# Include Qt headers. # Include Qt headers.
include_directories(${Qt5Base_INCLUDE_DIRS}) include_directories(${Qt5Base_INCLUDE_DIRS})
SET(CLASSPARSER_HEADERS set(CLASSPARSER_HEADERS
include/classparser_config.h include/classparser_config.h
# Public headers # Public headers
@ -23,13 +23,13 @@ src/javaendian.h
src/membuffer.h src/membuffer.h
) )
SET(CLASSPARSER_SOURCES set(CLASSPARSER_SOURCES
src/javautils.cpp src/javautils.cpp
src/annotations.cpp src/annotations.cpp
) )
# Set the include dir path. # Set the include dir path.
SET(LIBGROUPVIEW_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) set(LIBGROUPVIEW_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
# Include self. # Include self.
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

View File

@ -12,4 +12,4 @@ set(SRC
add_jar(JavaCheck ${SRC}) add_jar(JavaCheck ${SRC})
INSTALL_JAR(JavaCheck "${BINARY_DEST_DIR}/jars") install_jar(JavaCheck "${BINARY_DEST_DIR}/jars")

View File

@ -32,4 +32,4 @@ set(SRC
) )
add_jar(NewLaunch ${SRC}) add_jar(NewLaunch ${SRC})
INSTALL_JAR(NewLaunch "${BINARY_DEST_DIR}/jars") install_jar(NewLaunch "${BINARY_DEST_DIR}/jars")

View File

@ -1,26 +1,26 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
IF(WIN32) if(WIN32)
# In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows # In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows
cmake_policy(SET CMP0020 OLD) cmake_policy(SET CMP0020 OLD)
ENDIF() endif()
project(unpack200) project(unpack200)
# Find ZLIB for quazip # Find ZLIB for quazip
# Use system zlib on unix and Qt ZLIB on Windows # Use system zlib on unix and Qt ZLIB on Windows
IF(UNIX) if(UNIX)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
ELSE(UNIX) else(UNIX)
get_filename_component(ZLIB_FOUND_DIR "${Qt5Core_DIR}/../../../include/QtZlib" ABSOLUTE) get_filename_component(ZLIB_FOUND_DIR "${Qt5Core_DIR}/../../../include/QtZlib" ABSOLUTE)
SET(ZLIB_INCLUDE_DIRS ${ZLIB_FOUND_DIR} CACHE PATH "Path to ZLIB headers of Qt") set(ZLIB_INCLUDE_DIRS ${ZLIB_FOUND_DIR} CACHE PATH "Path to ZLIB headers of Qt")
SET(ZLIB_LIBRARIES "") set(ZLIB_LIBRARIES "")
IF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") if(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
MESSAGE("Please specify a valid zlib include dir") message("Please specify a valid zlib include dir")
ENDIF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") endif(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
ENDIF(UNIX) endif(UNIX)
SET(PACK200_SRC set(PACK200_SRC
include/unpack200.h include/unpack200.h
src/bands.cpp src/bands.cpp
src/bands.h src/bands.h
@ -41,19 +41,19 @@ src/zip.h
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
SET(PACK200_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) set(PACK200_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
include_directories( include_directories(
include include
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
) )
add_library(unpack200 STATIC ${PACK200_SRC}) add_library(unpack200 STATIC ${PACK200_SRC})
IF(UNIX) if(UNIX)
target_link_libraries(unpack200 ${ZLIB_LIBRARIES}) target_link_libraries(unpack200 ${ZLIB_LIBRARIES})
ELSE() else()
# zlib is part of Qt on windows. use it. # zlib is part of Qt on windows. use it.
QT5_USE_MODULES(unpack200 Core) qt5_use_modules(unpack200 Core)
ENDIF() endif()
add_executable(anti200 anti200.cpp) add_executable(anti200 anti200.cpp)
target_link_libraries(anti200 unpack200) target_link_libraries(anti200 unpack200)

View File

@ -2,16 +2,16 @@ project(quazip)
# Find ZLIB for quazip # Find ZLIB for quazip
# Use system zlib on unix and Qt ZLIB on Windows # Use system zlib on unix and Qt ZLIB on Windows
IF(UNIX) if(UNIX)
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
ELSE(UNIX) else(UNIX)
get_filename_component(ZLIB_FOUND_DIR "${Qt5Core_DIR}/../../../include/QtZlib" ABSOLUTE) get_filename_component(ZLIB_FOUND_DIR "${Qt5Core_DIR}/../../../include/QtZlib" ABSOLUTE)
SET(ZLIB_INCLUDE_DIRS ${ZLIB_FOUND_DIR} CACHE PATH "Path to ZLIB headers of Qt") set(ZLIB_INCLUDE_DIRS ${ZLIB_FOUND_DIR} CACHE PATH "Path to ZLIB headers of Qt")
SET(ZLIB_LIBRARIES "") set(ZLIB_LIBRARIES "")
IF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") if(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
MESSAGE("Please specify a valid zlib include dir") message("Please specify a valid zlib include dir")
ENDIF(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h") endif(NOT EXISTS "${ZLIB_INCLUDE_DIRS}/zlib.h")
ENDIF(UNIX) endif(UNIX)
# set all include directories for in and out of source builds # set all include directories for in and out of source builds
include_directories( include_directories(
@ -20,23 +20,12 @@ include_directories(
${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS}
) )
# include with QT_USE selected library parts
# INCLUDE(${QT_USE_FILE})
file(GLOB SRCS "*.c" "*.cpp") file(GLOB SRCS "*.c" "*.cpp")
file(GLOB PUBLIC_HEADERS "*.h") file(GLOB PUBLIC_HEADERS "*.h")
# Static link! # Static link!
ADD_DEFINITIONS(-DQUAZIP_STATIC) add_definitions(-DQUAZIP_STATIC)
#qt5_wrap_cpp(MOC_SRCS ${PUBLIC_HEADERS})
#set(SRCS ${SRCS} ${MOC_SRCS})
#set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_library(quazip STATIC ${SRCS}) add_library(quazip STATIC ${SRCS})
QT5_USE_MODULES(quazip Core) qt5_use_modules(quazip Core)
target_link_libraries(quazip ${ZLIB_LIBRARIES}) target_link_libraries(quazip ${ZLIB_LIBRARIES})
#install(FILES ${PUBLIC_HEADERS} DESTINATION include/quazip)
#install(TARGETS quazip LIBRARY DESTINATION ${LIB_DESTINATION} ARCHIVE DESTINATION ${LIB_DESTINATION} RUNTIME DESTINATION ${LIB_DESTINATION})

View File

@ -7,7 +7,7 @@ find_package(Qt5Core REQUIRED)
include_directories(${Qt5Base_INCLUDE_DIRS}) include_directories(${Qt5Base_INCLUDE_DIRS})
SET(LIBSETTINGS_SOURCES set(LIBSETTINGS_SOURCES
libsettings_config.h libsettings_config.h
inifile.h inifile.h
@ -25,10 +25,10 @@ overridesetting.cpp
) )
# Set the include dir path. # Set the include dir path.
SET(LIBSETTINGS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE) set(LIBSETTINGS_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" PARENT_SCOPE)
# Static link! # Static link!
ADD_DEFINITIONS(-DLIBSETTINGS_STATIC) add_definitions(-DLIBSETTINGS_STATIC)
add_definitions(-DLIBSETTINGS_LIBRARY) add_definitions(-DLIBSETTINGS_LIBRARY)

View File

@ -20,9 +20,8 @@ find_package(Qt5Core REQUIRED)
# Include Qt headers. # Include Qt headers.
include_directories(${Qt5Base_INCLUDE_DIRS}) include_directories(${Qt5Base_INCLUDE_DIRS})
# include_directories(${Qt5Network_INCLUDE_DIRS})
SET(LIBUTIL_SOURCES set(LIBUTIL_SOURCES
include/libutil_config.h include/libutil_config.h
include/pathutils.h include/pathutils.h
@ -41,10 +40,10 @@ src/modutils.cpp
) )
# Set the include dir path. # Set the include dir path.
SET(LIBUTIL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) set(LIBUTIL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
# Static link! # Static link!
ADD_DEFINITIONS(-DLIBUTIL_STATIC) add_definitions(-DLIBUTIL_STATIC)
add_definitions(-DLIBUTIL_LIBRARY) add_definitions(-DLIBUTIL_LIBRARY)
@ -59,6 +58,5 @@ IF(MultiMC_CODE_COVERAGE)
ENDIF(MultiMC_CODE_COVERAGE) ENDIF(MultiMC_CODE_COVERAGE)
add_library(libUtil STATIC ${LIBUTIL_SOURCES}) add_library(libUtil STATIC ${LIBUTIL_SOURCES})
# qt5_use_modules(libUtil Core Network)
qt5_use_modules(libUtil Core) qt5_use_modules(libUtil Core)
target_link_libraries(libUtil) target_link_libraries(libUtil)

View File

@ -8,7 +8,7 @@ option(XZ_BUILD_MINIDEC "Build a tiny utility that decompresses xz streams" OFF)
set(CMAKE_C_FLAGS "-std=c99") set(CMAKE_C_FLAGS "-std=c99")
include_directories(include) include_directories(include)
SET(XZ_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE) set(XZ_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include" PARENT_SCOPE)
# See include/xz.h for manual feature configuration # See include/xz.h for manual feature configuration
# tweak this list and xz.h to fit your needs # tweak this list and xz.h to fit your needs

View File

@ -1,4 +1,4 @@
FILE(GLOB_RECURSE QTPLUGINS "${CMAKE_INSTALL_PREFIX}/@PLUGIN_DEST_DIR@/*@CMAKE_SHARED_LIBRARY_SUFFIX@") file(GLOB_RECURSE QTPLUGINS "${CMAKE_INSTALL_PREFIX}/@PLUGIN_DEST_DIR@/*@CMAKE_SHARED_LIBRARY_SUFFIX@")
function(gp_resolved_file_type_override resolved_file type_var) function(gp_resolved_file_type_override resolved_file type_var)
if(resolved_file MATCHES "^/usr/lib/libQt") if(resolved_file MATCHES "^/usr/lib/libQt")
message("resolving ${resolved_file} as other") message("resolving ${resolved_file} as other")

View File

@ -70,10 +70,7 @@ endif()
add_library(updatershared STATIC ${UPDATER_SOURCES}) add_library(updatershared STATIC ${UPDATER_SOURCES})
target_link_libraries(updatershared target_link_libraries(updatershared anyoption tinyxml)
anyoption
tinyxml
)
if(UNIX) if(UNIX)
if(APPLE) if(APPLE)
@ -92,30 +89,28 @@ endif()
add_executable(updater ${EXE_FLAGS} main.cpp) add_executable(updater ${EXE_FLAGS} main.cpp)
target_link_libraries(updater target_link_libraries(updater updatershared)
updatershared
)
#### Updater Executable #### #### Updater Executable ####
IF(WIN32) if(WIN32)
INSTALL(TARGETS updater install(TARGETS updater
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
LIBRARY DESTINATION . COMPONENT Runtime LIBRARY DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION . COMPONENT Runtime RUNTIME DESTINATION . COMPONENT Runtime
) )
ENDIF() endif()
IF(UNIX) if(UNIX)
IF(APPLE) if(APPLE)
INSTALL(TARGETS updater install(TARGETS updater
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime RUNTIME DESTINATION MultiMC.app/Contents/MacOS COMPONENT Runtime
) )
ELSE() else()
INSTALL(TARGETS updater install(TARGETS updater
BUNDLE DESTINATION . COMPONENT Runtime BUNDLE DESTINATION . COMPONENT Runtime
RUNTIME DESTINATION bin COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime
) )
ENDIF() endif()
ENDIF() endif()

View File

@ -9,8 +9,8 @@ qt5_add_translation(TRANSLATION_QM ${TRANSLATION_FILES})
add_custom_target(translations_update DEPENDS ${TRANSLATION_MESSAGES}) add_custom_target(translations_update DEPENDS ${TRANSLATION_MESSAGES})
add_custom_target(translations DEPENDS ${TRANSLATION_QM}) add_custom_target(translations DEPENDS ${TRANSLATION_QM})
IF(APPLE AND UNIX) ## OSX if(APPLE AND UNIX) ## OSX
install(FILES ${TRANSLATION_QM} DESTINATION MultiMC.app/Contents/MacOS/translations) install(FILES ${TRANSLATION_QM} DESTINATION MultiMC.app/Contents/MacOS/translations)
ELSE() else()
install(FILES ${TRANSLATION_QM} DESTINATION translations) install(FILES ${TRANSLATION_QM} DESTINATION translations)
ENDIF() endif()