2013-01-11 01:25:40 +00:00
cmake_minimum_required ( VERSION 2.8.9 )
2013-09-26 12:49:58 +01:00
2013-10-06 01:09:21 +01:00
IF ( WIN32 )
# In Qt 5.1+ we have our own main() function, don't autolink to qtmain on Windows
cmake_policy ( SET CMP0020 OLD )
ENDIF ( )
2013-09-26 12:49:58 +01:00
2013-02-05 18:09:20 +00:00
project ( MultiMC )
2013-12-14 13:17:59 +00:00
enable_testing ( )
2013-01-11 01:25:40 +00:00
2013-02-21 16:32:13 +00:00
######## Set CMake options ########
SET ( CMAKE_AUTOMOC ON )
SET ( CMAKE_INCLUDE_CURRENT_DIR ON )
2013-09-08 19:18:55 +01:00
SET ( FILES_TO_TRANSLATE )
2013-01-11 01:25:40 +00:00
2013-11-24 05:36:16 +00:00
######## Set module path ########
SET ( CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/" )
SET ( MMC_SRC "${PROJECT_SOURCE_DIR}" )
SET ( MMC_BIN "${PROJECT_BINARY_DIR}" )
2013-02-21 16:32:13 +00:00
# Output all executables and shared libs in the main build folder, not in subfolders.
2013-02-21 01:10:09 +00:00
SET ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } )
2013-01-11 01:25:40 +00:00
2013-02-21 20:52:23 +00:00
IF ( UNIX )
SET ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } )
ENDIF ( )
2014-01-11 01:06:22 +00:00
set ( CMAKE_JAVA_TARGET_OUTPUT_DIR ${ PROJECT_BINARY_DIR } /jars )
2013-02-21 18:35:33 +00:00
######## Set compiler flags ########
IF ( APPLE )
message ( STATUS "Using APPLE CMAKE_CXX_FLAGS" )
2013-12-01 15:34:51 +00:00
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall" )
2013-02-21 18:35:33 +00:00
ELSEIF ( UNIX )
# assume GCC, add C++0x/C++11 stuff
MESSAGE ( STATUS "Using UNIX CMAKE_CXX_FLAGS" )
2013-12-01 15:34:51 +00:00
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall" )
2013-02-21 18:35:33 +00:00
ELSEIF ( MINGW )
MESSAGE ( STATUS "Using MINGW CMAKE_CXX_FLAGS" )
2013-12-01 15:34:51 +00:00
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall" )
2013-02-21 18:35:33 +00:00
ENDIF ( )
2013-02-21 16:32:13 +00:00
2014-01-08 00:27:40 +00:00
################################ 3rd Party Libs ################################
2013-02-21 16:32:13 +00:00
# Find the required Qt parts
2013-12-17 01:09:58 +00:00
find_package ( Qt5Core REQUIRED )
2013-02-20 14:32:26 +00:00
find_package ( Qt5Widgets REQUIRED )
find_package ( Qt5Network REQUIRED )
2013-12-17 01:09:58 +00:00
find_package ( Qt5Test REQUIRED )
2014-01-01 18:21:58 +00:00
find_package ( Qt5Concurrent REQUIRED )
2013-09-08 19:18:55 +01:00
find_package ( Qt5LinguistTools REQUIRED )
2013-01-11 01:25:40 +00:00
2013-12-17 01:09:58 +00:00
include_directories (
$ { Q t 5 C o r e _ I N C L U D E _ D I R S }
$ { Q t 5 W i d g e t s _ I N C L U D E _ D I R S }
2014-01-01 18:21:58 +00:00
$ { Q t 5 C o n c u r r e n t _ I N C L U D E _ D I R S }
2013-12-17 01:09:58 +00:00
$ { Q t 5 N e t w o r k _ I N C L U D E _ D I R S }
$ { Q t 5 T e s t _ I N C L U D E _ D I R S }
)
2013-01-11 01:25:40 +00:00
2013-12-01 15:34:51 +00:00
# The Qt5 cmake files don't provide its install paths, so ask qmake.
get_target_property ( QMAKE_EXECUTABLE Qt5::qmake LOCATION )
function ( QUERY_QMAKE VAR RESULT )
exec_program ( ${ QMAKE_EXECUTABLE } ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
if ( NOT return_code )
file ( TO_CMAKE_PATH "${output}" output )
set ( ${ RESULT } ${ output } PARENT_SCOPE )
endif ( NOT return_code )
endfunction ( QUERY_QMAKE )
query_qmake ( QT_INSTALL_PLUGINS QT_PLUGINS_DIR )
query_qmake ( QT_INSTALL_IMPORTS QT_IMPORTS_DIR )
query_qmake ( QT_INSTALL_LIBS QT_LIBS_DIR )
query_qmake ( QT_HOST_DATA QT_DATA_DIR )
set ( QT_MKSPECS_DIR ${ QT_DATA_DIR } /mkspecs )
2013-02-21 16:32:13 +00:00
################################ SET UP BUILD OPTIONS ################################
######## Check endianness ########
INCLUDE ( TestBigEndian )
TEST_BIG_ENDIAN ( BIGENDIAN )
IF ( ${ BIGENDIAN } )
2013-03-20 00:15:19 +00:00
ADD_DEFINITIONS ( -DMULTIMC_BIG_ENDIAN )
2013-02-21 16:32:13 +00:00
ENDIF ( ${ BIGENDIAN } )
2013-12-15 20:48:58 +00:00
######## Set URLs ########
SET ( MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch MultiMC's news RSS feed from." )
2013-02-21 16:32:13 +00:00
######## Set version numbers ########
2014-01-05 03:44:18 +00:00
SET ( MultiMC_VERSION_MAJOR 0 )
2014-01-20 00:14:11 +00:00
SET ( MultiMC_VERSION_MINOR 2 )
2014-01-22 21:40:17 +00:00
SET ( MultiMC_VERSION_HOTFIX 1 )
2013-01-11 01:25:40 +00:00
2013-10-01 23:01:41 +01:00
# Build number
2013-12-01 20:27:36 +00:00
SET ( MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number." )
2014-01-08 00:09:05 +00:00
# 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." )
# 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." )
2013-12-01 20:27:36 +00:00
2013-12-04 18:34:12 +00:00
# Version channel
SET ( MultiMC_VERSION_CHANNEL "" CACHE STRING "The current build's channel. Included in the version string." )
# Channel list URL
SET ( MultiMC_CHANLIST_URL "" CACHE STRING "URL for the channel list." )
2013-12-01 20:27:36 +00:00
2013-12-04 18:34:12 +00:00
# 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." )
2013-12-01 20:27:36 +00:00
2014-01-03 18:19:27 +00:00
# Notification URL
SET ( MultiMC_NOTIFICATION_URL "" CACHE STRING "URL for checking for notifications." )
2013-12-04 18:34:12 +00:00
2014-01-08 00:09:05 +00:00
SET ( MultiMC_RELEASE_VERSION_NAME "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}" )
IF ( MultiMC_VERSION_HOTFIX GREATER 0 )
SET ( MultiMC_RELEASE_VERSION_NAME "${MultiMC_RELEASE_VERSION_NAME}.${MultiMC_VERSION_HOTFIX}" )
ENDIF ( )
2013-12-04 18:34:12 +00:00
# Build a version string to display in the configure logs.
2014-01-08 01:30:08 +00:00
IF ( MultiMC_VERSION_TYPE STREQUAL "Custom" )
MESSAGE ( STATUS "Version Type: Custom" )
SET ( MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}" )
ELSEIF ( MultiMC_VERSION_TYPE STREQUAL "Release" )
MESSAGE ( STATUS "Version Type: Stable Release" )
2014-01-08 00:09:05 +00:00
SET ( MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}" )
ELSEIF ( MultiMC_VERSION_TYPE STREQUAL "ReleaseCandidate" )
2014-01-08 01:30:08 +00:00
MESSAGE ( STATUS "Version Type: Release Candidate" )
2014-01-08 00:09:05 +00:00
SET ( MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-rc${MultiMC_VERSION_BUILD}" )
ELSEIF ( MultiMC_VERSION_TYPE STREQUAL "Development" )
2014-01-08 01:30:08 +00:00
MESSAGE ( STATUS "Version Type: Development" )
2014-01-08 00:09:05 +00:00
SET ( MultiMC_VERSION_STRING "${MultiMC_RELEASE_VERSION_NAME}-dev${MultiMC_VERSION_BUILD}" )
ELSE ( )
MESSAGE ( ERROR "Invalid build type." )
2013-12-01 20:27:36 +00:00
ENDIF ( )
2014-01-08 01:30:08 +00:00
MESSAGE ( STATUS "MultiMC 5 Version: ${MultiMC_VERSION_STRING}" )
2013-02-21 16:32:13 +00:00
2013-12-04 18:34:12 +00:00
# If the update system is enabled, make sure MultiMC_CHANLIST_URL and MultiMC_VERSION_CHANNEL are set.
IF ( MultiMC_UPDATER )
IF ( MultiMC_VERSION_CHANNEL STREQUAL "" )
MESSAGE ( FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_CHANNEL is not set.\n"
" P l e a s e e n s u r e t h e C M a k e v a r i a b l e s M u l t i M C _ V E R S I O N _ C H A N N E L , M u l t i M C _ C H A N L I S T _ U R L , a n d M u l t i M C _ V E R S I O N _ B U I L D a r e s e t . " )
ENDIF ( )
IF ( MultiMC_CHANLIST_URL STREQUAL "" )
MESSAGE ( FATAL_ERROR "Update system is enabled, but MultiMC_CHANLIST_URL is not set.\n"
" P l e a s e e n s u r e t h e C M a k e v a r i a b l e s M u l t i M C _ V E R S I O N _ C H A N N E L , M u l t i M C _ C H A N L I S T _ U R L , a n d M u l t i M C _ V E R S I O N _ B U I L D a r e s e t . " )
ENDIF ( )
IF ( MultiMC_VERSION_BUILD LESS 0 )
MESSAGE ( FATAL_ERROR "Update system is enabled, but MultiMC_VERSION_BUILD is not set.\n"
" P l e a s e e n s u r e t h e C M a k e v a r i a b l e s M u l t i M C _ V E R S I O N _ C H A N N E L , M u l t i M C _ C H A N L I S T _ U R L , a n d M u l t i M C _ V E R S I O N _ B U I L D a r e s e t . " )
ENDIF ( )
MESSAGE ( STATUS "Updater is enabled. Channel list URL: ${MultiMC_CHANLIST_URL}" )
ENDIF ( )
2013-12-01 23:55:24 +00:00
#### Custom target to just print the version.
2013-12-01 20:27:36 +00:00
ADD_CUSTOM_TARGET ( version echo "Version: ${MultiMC_VERSION_STRING}" )
2013-10-01 23:01:41 +01:00
2013-12-01 23:55:24 +00:00
#### Check the current Git commit
2013-02-21 17:02:48 +00:00
execute_process ( COMMAND git rev-parse HEAD
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ S O U R C E _ D I R }
R E S U L T _ V A R I A B L E G I T _ C O M M I T _ C H E C K _ R E S U L T V A R
O U T P U T _ V A R I A B L E G I T _ C O M M I T _ C H E C K _ O U T V A R
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
IF ( GIT_COMMIT_CHECK_RESULTVAR EQUAL 0 )
SET ( MultiMC_GIT_COMMIT "${GIT_COMMIT_CHECK_OUTVAR}" )
MESSAGE ( STATUS "Git commit: ${MultiMC_GIT_COMMIT}" )
ELSE ( )
SET ( MultiMC_GIT_COMMIT "Unknown" )
MESSAGE ( STATUS "Failed to check Git commit. ${GIT_COMMIT_CHECK_RESULTVAR}" )
ENDIF ( )
2013-02-21 16:32:13 +00:00
######## Configure header ########
2013-12-01 23:55:24 +00:00
configure_file ( "${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/include/config.h" )
2013-01-11 01:25:40 +00:00
2013-02-21 16:32:13 +00:00
2013-04-01 18:04:40 +01:00
######## Other Stuff ########
ADD_DEFINITIONS ( -DQUAZIP_STATIC )
2013-08-26 01:53:29 +01:00
ADD_DEFINITIONS ( -DLIBSETTINGS_STATIC )
ADD_DEFINITIONS ( -DLIBUTIL_STATIC )
ADD_DEFINITIONS ( -DLIBGROUPVIEW_STATIC )
2013-04-01 18:04:40 +01:00
2014-01-08 00:27:40 +00:00
######## Packaging/install paths setup ########
IF ( UNIX AND APPLE )
SET ( BINARY_DEST_DIR MultiMC.app/Contents/MacOS )
SET ( PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS )
SET ( QTCONF_DEST_DIR MultiMC.app/Contents/Resources )
SET ( APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app" )
SET ( MACOSX_BUNDLE_BUNDLE_NAME "MultiMC" )
SET ( MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility." )
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_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_ICON_FILE MultiMC.icns )
SET ( MACOSX_BUNDLE_COPYRIGHT "Copyright 2013 MultiMC Contributors" )
ELSEIF ( UNIX )
SET ( BINARY_DEST_DIR bin )
SET ( PLUGIN_DEST_DIR plugins )
SET ( QTCONF_DEST_DIR . )
SET ( APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC" )
ELSEIF ( WIN32 )
SET ( BINARY_DEST_DIR . )
SET ( PLUGIN_DEST_DIR . )
SET ( QTCONF_DEST_DIR . )
SET ( APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.exe" )
ENDIF ( )
# directories to look for dependencies
SET ( DIRS "${QT_LIBS_DIR}" )
################################ Included Libs ################################
# Add quazip
add_subdirectory ( depends/quazip )
include_directories ( depends/quazip )
# Add the java launcher and checker
add_subdirectory ( depends/launcher )
add_subdirectory ( depends/javacheck )
# Add xz decompression
add_subdirectory ( depends/xz-embedded )
include_directories ( ${ XZ_INCLUDE_DIR } )
# Add pack200 decompression
add_subdirectory ( depends/pack200 )
include_directories ( ${ PACK200_INCLUDE_DIR } )
######## MultiMC Libs ########
# Add the util library.
add_subdirectory ( depends/util )
include_directories ( ${ LIBUTIL_INCLUDE_DIR } )
# Add the settings library.
add_subdirectory ( depends/settings )
include_directories ( ${ LIBSETTINGS_INCLUDE_DIR } )
# Add the group view library.
add_subdirectory ( depends/groupview )
include_directories ( ${ LIBGROUPVIEW_INCLUDE_DIR } )
# Add the updater
add_subdirectory ( mmc_updater )
2013-02-21 16:32:13 +00:00
################################ FILES ################################
2013-09-22 03:21:36 +01:00
######## Sources and headers ########
SET ( MULTIMC_SOURCES
# Application base
2013-09-07 03:00:58 +01:00
M u l t i M C . h
2013-09-22 03:21:36 +01:00
M u l t i M C . c p p
2013-09-07 03:00:58 +01:00
M u l t i M C V e r s i o n . h
2013-07-28 23:59:35 +01:00
2013-10-06 00:13:40 +01:00
# Logging
l o g g e r / Q s D e b u g O u t p u t . c p p
l o g g e r / Q s D e b u g O u t p u t . h
l o g g e r / Q s L o g . c p p
l o g g e r / Q s L o g . h
l o g g e r / Q s L o g D e s t . c p p
l o g g e r / Q s L o g D e s t . h
2013-11-04 01:53:05 +00:00
# GUI - windows
g u i / M a i n W i n d o w . h
g u i / M a i n W i n d o w . c p p
g u i / C o n s o l e W i n d o w . h
g u i / C o n s o l e W i n d o w . c p p
# GUI - dialogs
g u i / d i a l o g s / S e t t i n g s D i a l o g . h
g u i / d i a l o g s / S e t t i n g s D i a l o g . c p p
g u i / d i a l o g s / C o p y I n s t a n c e D i a l o g . h
g u i / d i a l o g s / C o p y I n s t a n c e D i a l o g . c p p
g u i / d i a l o g s / N e w I n s t a n c e D i a l o g . c p p
g u i / d i a l o g s / P r o g r e s s D i a l o g . h
g u i / d i a l o g s / P r o g r e s s D i a l o g . c p p
g u i / d i a l o g s / A b o u t D i a l o g . h
g u i / d i a l o g s / A b o u t D i a l o g . c p p
g u i / d i a l o g s / V e r s i o n S e l e c t D i a l o g . h
g u i / d i a l o g s / V e r s i o n S e l e c t D i a l o g . c p p
g u i / d i a l o g s / L w j g l S e l e c t D i a l o g . h
g u i / d i a l o g s / L w j g l S e l e c t D i a l o g . c p p
g u i / d i a l o g s / I n s t a n c e S e t t i n g s . h
g u i / d i a l o g s / I n s t a n c e S e t t i n g s . c p p
g u i / d i a l o g s / I c o n P i c k e r D i a l o g . h
g u i / d i a l o g s / I c o n P i c k e r D i a l o g . c p p
g u i / d i a l o g s / L e g a c y M o d E d i t D i a l o g . h
g u i / d i a l o g s / L e g a c y M o d E d i t D i a l o g . c p p
g u i / d i a l o g s / O n e S i x M o d E d i t D i a l o g . h
g u i / d i a l o g s / O n e S i x M o d E d i t D i a l o g . c p p
g u i / d i a l o g s / M o d E d i t D i a l o g C o m m o n . h
g u i / d i a l o g s / M o d E d i t D i a l o g C o m m o n . c p p
g u i / d i a l o g s / E d i t N o t e s D i a l o g . h
g u i / d i a l o g s / E d i t N o t e s D i a l o g . c p p
g u i / d i a l o g s / C u s t o m M e s s a g e B o x . h
g u i / d i a l o g s / C u s t o m M e s s a g e B o x . c p p
2013-11-29 03:40:40 +00:00
g u i / d i a l o g s / E d i t A c c o u n t D i a l o g . h
g u i / d i a l o g s / E d i t A c c o u n t D i a l o g . c p p
2013-11-18 18:05:35 +00:00
g u i / d i a l o g s / A c c o u n t L i s t D i a l o g . h
g u i / d i a l o g s / A c c o u n t L i s t D i a l o g . c p p
2013-11-27 22:14:18 +00:00
g u i / d i a l o g s / A c c o u n t S e l e c t D i a l o g . h
g u i / d i a l o g s / A c c o u n t S e l e c t D i a l o g . c p p
2013-12-01 23:55:24 +00:00
g u i / d i a l o g s / U p d a t e D i a l o g . h
g u i / d i a l o g s / U p d a t e D i a l o g . c p p
2013-11-04 01:53:05 +00:00
# GUI - widgets
2014-01-29 00:20:19 +00:00
g u i / w i d g e t s / C o m m o n . h
g u i / w i d g e t s / C o m m o n . c p p
2013-11-04 01:53:05 +00:00
g u i / w i d g e t s / I n s t a n c e D e l e g a t e . h
g u i / w i d g e t s / I n s t a n c e D e l e g a t e . c p p
g u i / w i d g e t s / M o d L i s t V i e w . h
g u i / w i d g e t s / M o d L i s t V i e w . c p p
2014-01-29 00:20:19 +00:00
g u i / w i d g e t s / V e r s i o n L i s t V i e w . h
g u i / w i d g e t s / V e r s i o n L i s t V i e w . c p p
2013-11-04 01:53:05 +00:00
g u i / w i d g e t s / L a b e l e d T o o l B u t t o n . h
g u i / w i d g e t s / L a b e l e d T o o l B u t t o n . c p p
g u i / w i d g e t s / M C M o d I n f o F r a m e . h
g u i / w i d g e t s / M C M o d I n f o F r a m e . c p p
2013-08-17 12:40:51 +01:00
# Base classes and infrastructure
2013-09-15 23:54:39 +01:00
l o g i c / B a s e V e r s i o n . h
2013-08-17 12:40:51 +01:00
l o g i c / M i n e c r a f t V e r s i o n . h
l o g i c / I n s t a n c e F a c t o r y . h
2013-09-22 03:21:36 +01:00
l o g i c / I n s t a n c e F a c t o r y . c p p
2013-08-17 12:40:51 +01:00
l o g i c / B a s e I n s t a n c e . h
2013-09-22 03:21:36 +01:00
l o g i c / B a s e I n s t a n c e . c p p
2013-08-17 12:40:51 +01:00
l o g i c / B a s e I n s t a n c e _ p . h
2013-09-22 03:21:36 +01:00
2013-08-17 12:40:51 +01:00
l o g i c / M i n e c r a f t P r o c e s s . h
2013-09-22 03:21:36 +01:00
l o g i c / M i n e c r a f t P r o c e s s . c p p
2013-08-17 12:40:51 +01:00
l o g i c / M o d . h
2013-09-22 03:21:36 +01:00
l o g i c / M o d . c p p
2013-08-17 12:40:51 +01:00
l o g i c / M o d L i s t . h
2013-09-22 03:21:36 +01:00
l o g i c / M o d L i s t . c p p
2013-08-17 12:40:51 +01:00
2013-09-07 03:00:58 +01:00
# Basic instance launcher for starting from terminal
l o g i c / I n s t a n c e L a u n c h e r . h
2013-09-22 03:21:36 +01:00
l o g i c / I n s t a n c e L a u n c h e r . c p p
2013-09-07 03:00:58 +01:00
2013-08-17 12:40:51 +01:00
# network stuffs
2013-10-26 18:55:48 +01:00
l o g i c / n e t / N e t A c t i o n . h
2013-12-10 06:12:52 +00:00
l o g i c / n e t / M D 5 E t a g D o w n l o a d . h
l o g i c / n e t / M D 5 E t a g D o w n l o a d . c p p
2013-09-08 01:15:20 +01:00
l o g i c / n e t / B y t e A r r a y D o w n l o a d . h
2013-09-22 03:21:36 +01:00
l o g i c / n e t / B y t e A r r a y D o w n l o a d . c p p
2013-09-08 01:15:20 +01:00
l o g i c / n e t / C a c h e D o w n l o a d . h
2013-09-22 03:21:36 +01:00
l o g i c / n e t / C a c h e D o w n l o a d . c p p
2013-11-17 10:44:18 +00:00
l o g i c / n e t / F o r g e M i r r o r s . h
l o g i c / n e t / F o r g e M i r r o r s . c p p
2013-09-30 01:34:46 +01:00
l o g i c / n e t / F o r g e X z D o w n l o a d . h
l o g i c / n e t / F o r g e X z D o w n l o a d . c p p
2013-10-26 18:55:48 +01:00
l o g i c / n e t / N e t J o b . h
l o g i c / n e t / N e t J o b . c p p
2013-09-06 20:58:51 +01:00
l o g i c / n e t / H t t p M e t a C a c h e . h
2013-09-22 03:21:36 +01:00
l o g i c / n e t / H t t p M e t a C a c h e . c p p
2013-12-06 22:37:12 +00:00
l o g i c / n e t / P a s t e U p l o a d . h
l o g i c / n e t / P a s t e U p l o a d . c p p
2013-12-13 14:58:11 +00:00
l o g i c / n e t / U R L C o n s t a n t s . h
2013-10-26 18:55:48 +01:00
2013-11-11 18:59:59 +00:00
# Yggdrasil login stuff
2014-01-27 02:00:49 +00:00
l o g i c / a u t h / A u t h S e s s i o n . h
l o g i c / a u t h / A u t h S e s s i o n . c p p
2013-12-13 01:47:59 +00:00
l o g i c / a u t h / M o j a n g A c c o u n t L i s t . h
l o g i c / a u t h / M o j a n g A c c o u n t L i s t . c p p
2013-11-11 18:59:59 +00:00
l o g i c / a u t h / M o j a n g A c c o u n t . h
l o g i c / a u t h / M o j a n g A c c o u n t . c p p
2013-11-13 18:38:28 +00:00
l o g i c / a u t h / Y g g d r a s i l T a s k . h
l o g i c / a u t h / Y g g d r a s i l T a s k . c p p
2013-12-01 01:00:42 +00:00
l o g i c / a u t h / f l o w s / A u t h e n t i c a t e T a s k . h
l o g i c / a u t h / f l o w s / A u t h e n t i c a t e T a s k . c p p
l o g i c / a u t h / f l o w s / R e f r e s h T a s k . c p p
l o g i c / a u t h / f l o w s / R e f r e s h T a s k . c p p
l o g i c / a u t h / f l o w s / V a l i d a t e T a s k . h
l o g i c / a u t h / f l o w s / V a l i d a t e T a s k . c p p
2013-08-17 12:40:51 +01:00
2013-12-04 18:34:12 +00:00
# Update system
l o g i c / u p d a t e r / U p d a t e C h e c k e r . h
l o g i c / u p d a t e r / U p d a t e C h e c k e r . c p p
2013-12-05 19:52:55 +00:00
l o g i c / u p d a t e r / D o w n l o a d U p d a t e T a s k . h
l o g i c / u p d a t e r / D o w n l o a d U p d a t e T a s k . c p p
2014-01-03 18:19:27 +00:00
l o g i c / u p d a t e r / N o t i f i c a t i o n C h e c k e r . h
l o g i c / u p d a t e r / N o t i f i c a t i o n C h e c k e r . c p p
2013-12-04 18:34:12 +00:00
2013-12-15 20:48:58 +00:00
# News System
l o g i c / n e w s / N e w s C h e c k e r . h
l o g i c / n e w s / N e w s C h e c k e r . c p p
l o g i c / n e w s / N e w s E n t r y . h
l o g i c / n e w s / N e w s E n t r y . c p p
2014-01-12 18:28:42 +00:00
# Status system
l o g i c / s t a t u s / S t a t u s C h e c k e r . h
l o g i c / s t a t u s / S t a t u s C h e c k e r . c p p
2013-08-17 12:40:51 +01:00
# legacy instances
l o g i c / L e g a c y I n s t a n c e . h
2013-09-22 03:21:36 +01:00
l o g i c / L e g a c y I n s t a n c e . c p p
2013-08-17 12:40:51 +01:00
l o g i c / L e g a c y I n s t a n c e _ p . h
l o g i c / L e g a c y U p d a t e . h
2013-09-22 03:21:36 +01:00
l o g i c / L e g a c y U p d a t e . c p p
2013-08-17 12:40:51 +01:00
l o g i c / L e g a c y F o r g e . h
2013-09-22 03:21:36 +01:00
l o g i c / L e g a c y F o r g e . c p p
2013-08-17 12:40:51 +01:00
2014-01-24 17:12:02 +00:00
# OneSix instances
2013-08-17 12:40:51 +01:00
l o g i c / O n e S i x U p d a t e . h
l o g i c / O n e S i x U p d a t e . c p p
2013-09-22 03:21:36 +01:00
l o g i c / O n e S i x V e r s i o n . h
2013-09-11 22:43:17 +01:00
l o g i c / O n e S i x V e r s i o n . c p p
2013-09-22 03:21:36 +01:00
l o g i c / O n e S i x L i b r a r y . h
2013-09-11 22:43:17 +01:00
l o g i c / O n e S i x L i b r a r y . c p p
2013-09-22 03:21:36 +01:00
l o g i c / O n e S i x R u l e . h
2013-09-11 22:43:17 +01:00
l o g i c / O n e S i x R u l e . c p p
2013-09-22 03:21:36 +01:00
l o g i c / O p S y s . h
2013-09-11 22:43:17 +01:00
l o g i c / O p S y s . c p p
2014-01-23 20:31:41 +00:00
l o g i c / B a s e I n s t a l l e r . h
l o g i c / B a s e I n s t a l l e r . c p p
2013-09-22 03:21:36 +01:00
l o g i c / F o r g e I n s t a l l e r . h
l o g i c / F o r g e I n s t a l l e r . c p p
2013-12-28 13:22:36 +00:00
l o g i c / L i t e L o a d e r I n s t a l l e r . h
l o g i c / L i t e L o a d e r I n s t a l l e r . c p p
2014-01-24 17:12:02 +00:00
l o g i c / O n e S i x I n s t a n c e . h
l o g i c / O n e S i x I n s t a n c e . c p p
l o g i c / O n e S i x I n s t a n c e _ p . h
l o g i c / O n e S i x V e r s i o n B u i l d e r . h
l o g i c / O n e S i x V e r s i o n B u i l d e r . c p p
2013-08-17 12:40:51 +01:00
# Nostalgia
2013-09-22 03:21:36 +01:00
l o g i c / N o s t a l g i a I n s t a n c e . h
2013-08-17 12:40:51 +01:00
l o g i c / N o s t a l g i a I n s t a n c e . c p p
2013-12-20 13:47:26 +00:00
# FTB
l o g i c / O n e S i x F T B I n s t a n c e . h
l o g i c / O n e S i x F T B I n s t a n c e . c p p
l o g i c / L e g a c y F T B I n s t a n c e . h
l o g i c / L e g a c y F T B I n s t a n c e . c p p
2013-08-17 12:40:51 +01:00
# Lists
2013-09-22 03:21:36 +01:00
l o g i c / l i s t s / I n s t a n c e L i s t . h
2013-08-17 12:40:51 +01:00
l o g i c / l i s t s / I n s t a n c e L i s t . c p p
2013-09-22 03:21:36 +01:00
l o g i c / l i s t s / B a s e V e r s i o n L i s t . h
2013-09-15 23:54:39 +01:00
l o g i c / l i s t s / B a s e V e r s i o n L i s t . c p p
2013-09-22 03:21:36 +01:00
l o g i c / l i s t s / M i n e c r a f t V e r s i o n L i s t . h
2013-08-17 12:40:51 +01:00
l o g i c / l i s t s / M i n e c r a f t V e r s i o n L i s t . c p p
2013-09-22 03:21:36 +01:00
l o g i c / l i s t s / L w j g l V e r s i o n L i s t . h
2013-08-17 12:40:51 +01:00
l o g i c / l i s t s / L w j g l V e r s i o n L i s t . c p p
2013-09-22 03:21:36 +01:00
l o g i c / l i s t s / F o r g e V e r s i o n L i s t . h
2013-09-15 23:54:39 +01:00
l o g i c / l i s t s / F o r g e V e r s i o n L i s t . c p p
2013-10-14 02:59:21 +01:00
l o g i c / l i s t s / J a v a V e r s i o n L i s t . h
l o g i c / l i s t s / J a v a V e r s i o n L i s t . c p p
2013-09-15 23:54:39 +01:00
2013-12-31 00:24:28 +00:00
# Icons
l o g i c / i c o n s / M M C I c o n . h
l o g i c / i c o n s / M M C I c o n . c p p
l o g i c / i c o n s / I c o n L i s t . h
l o g i c / i c o n s / I c o n L i s t . c p p
2013-09-15 23:54:39 +01:00
# misc model/view
2013-09-22 03:21:36 +01:00
l o g i c / E n a b l e d I t e m F i l t e r . h
2013-09-15 23:54:39 +01:00
l o g i c / E n a b l e d I t e m F i l t e r . c p p
2013-08-17 12:40:51 +01:00
# Tasks
2013-09-22 03:21:36 +01:00
l o g i c / t a s k s / P r o g r e s s P r o v i d e r . h
l o g i c / t a s k s / T a s k . h
2013-08-17 12:40:51 +01:00
l o g i c / t a s k s / T a s k . c p p
2014-01-01 18:21:58 +00:00
l o g i c / t a s k s / T h r e a d T a s k . h
l o g i c / t a s k s / T h r e a d T a s k . c p p
2013-12-20 13:47:26 +00:00
l o g i c / t a s k s / S e q u e n t i a l T a s k . h
l o g i c / t a s k s / S e q u e n t i a l T a s k . c p p
2013-09-22 23:23:50 +01:00
2013-10-05 01:08:13 +01:00
# Utilities
2013-11-24 05:36:16 +00:00
l o g i c / J a v a C h e c k e r . h
l o g i c / J a v a C h e c k e r . c p p
2013-10-05 01:08:13 +01:00
l o g i c / J a v a U t i l s . h
l o g i c / J a v a U t i l s . c p p
2013-11-03 15:20:26 +00:00
l o g i c / N a g U t i l s . h
l o g i c / N a g U t i l s . c p p
2013-11-27 16:56:15 +00:00
l o g i c / S k i n U t i l s . h
l o g i c / S k i n U t i l s . c p p
2013-12-11 03:54:39 +00:00
l o g i c / J a v a C h e c k e r J o b . h
l o g i c / J a v a C h e c k e r J o b . c p p
2013-09-22 03:21:36 +01:00
2013-12-08 02:58:44 +00:00
# Assets
2014-01-01 14:56:26 +00:00
l o g i c / a s s e t s / A s s e t s M i g r a t e T a s k . h
l o g i c / a s s e t s / A s s e t s M i g r a t e T a s k . c p p
2013-12-08 02:58:44 +00:00
l o g i c / a s s e t s / A s s e t s U t i l s . h
l o g i c / a s s e t s / A s s e t s U t i l s . c p p
2013-02-21 01:10:09 +00:00
)
2013-02-21 16:32:13 +00:00
######## UIs ########
SET ( MULTIMC_UIS
2013-11-04 01:53:05 +00:00
# Windows
g u i / M a i n W i n d o w . u i
g u i / C o n s o l e W i n d o w . u i
# Dialogs
g u i / d i a l o g s / S e t t i n g s D i a l o g . u i
g u i / d i a l o g s / C o p y I n s t a n c e D i a l o g . u i
g u i / d i a l o g s / N e w I n s t a n c e D i a l o g . u i
g u i / d i a l o g s / A b o u t D i a l o g . u i
g u i / d i a l o g s / V e r s i o n S e l e c t D i a l o g . u i
g u i / d i a l o g s / L w j g l S e l e c t D i a l o g . u i
g u i / d i a l o g s / I n s t a n c e S e t t i n g s . u i
g u i / d i a l o g s / P r o g r e s s D i a l o g . u i
g u i / d i a l o g s / I c o n P i c k e r D i a l o g . u i
g u i / d i a l o g s / L e g a c y M o d E d i t D i a l o g . u i
g u i / d i a l o g s / O n e S i x M o d E d i t D i a l o g . u i
g u i / d i a l o g s / E d i t N o t e s D i a l o g . u i
2013-11-18 18:05:35 +00:00
g u i / d i a l o g s / A c c o u n t L i s t D i a l o g . u i
2013-11-27 22:14:18 +00:00
g u i / d i a l o g s / A c c o u n t S e l e c t D i a l o g . u i
2013-11-29 03:40:40 +00:00
g u i / d i a l o g s / E d i t A c c o u n t D i a l o g . u i
2013-12-01 23:55:24 +00:00
g u i / d i a l o g s / U p d a t e D i a l o g . u i
2013-11-04 01:53:05 +00:00
# Widgets/other
g u i / w i d g e t s / M C M o d I n f o F r a m e . u i
2013-01-20 00:16:07 +00:00
)
2013-09-22 03:21:36 +01:00
set ( FILES_TO_TRANSLATE ${ FILES_TO_TRANSLATE } ${ MULTIMC_SOURCES } ${ MULTIMC_UIS } )
2013-09-08 19:18:55 +01:00
2014-01-19 03:52:34 +00:00
SET ( MULTIMC_QRCS
r e s o u r c e s / b a c k g r o u n d s / b a c k g r o u n d s . q r c
r e s o u r c e s / m u l t i m c / m u l t i m c . q r c
r e s o u r c e s / i n s t a n c e s / i n s t a n c e s . q r c
)
2013-02-18 18:59:01 +00:00
2013-02-21 16:32:13 +00:00
######## Windows resource files ########
IF ( WIN32 )
2014-01-19 04:21:09 +00:00
SET ( MULTIMC_RCS resources/multimc.rc )
2013-02-21 16:32:13 +00:00
ENDIF ( )
2013-10-18 17:42:41 +01:00
####### X11 Stuff #######
IF ( UNIX AND NOT APPLE )
SET ( MultiMC_QT_ADDITIONAL_MODULES ${ MultiMC_QT_ADDITIONAL_MODULES } X11Extras )
SET ( MultiMC_LINK_ADDITIONAL_LIBS ${ MultiMC_LINK_ADDITIONAL_LIBS } xcb )
2013-11-04 01:53:05 +00:00
LIST ( APPEND MULTIMC_SOURCES gui/Platform_X11.cpp )
2013-10-18 17:42:41 +01:00
ELSE ( )
2013-11-04 01:53:05 +00:00
LIST ( APPEND MULTIMC_SOURCES gui/Platform_Other.cpp )
2013-10-18 17:42:41 +01:00
ENDIF ( )
2013-02-21 16:32:13 +00:00
################################ COMPILE ################################
2013-02-18 18:59:01 +00:00
2013-02-21 16:32:13 +00:00
# Link additional libraries
IF ( WIN32 )
2013-03-20 00:15:19 +00:00
SET ( MultiMC_LINK_ADDITIONAL_LIBS ${ MultiMC_LINK_ADDITIONAL_LIBS }
Q t 5 : : W i n M a i n # Link WinMain
)
2013-02-21 16:32:13 +00:00
ENDIF ( WIN32 )
2013-02-05 18:09:20 +00:00
2014-01-05 13:24:33 +00:00
OPTION ( MultiMC_UPDATER_DRY_RUN "Enable updater dry-run mode -- for updater development." OFF )
OPTION ( MultiMC_UPDATER_FORCE_LOCAL "Do not download updated updater -- for updater development." OFF )
2014-01-04 23:06:55 +00:00
2013-12-02 10:09:56 +00:00
OPTION ( MultiMC_CODE_COVERAGE "Compiles for code coverage" OFF )
IF ( MultiMC_CODE_COVERAGE )
SET ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 --coverage" )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 --coverage" )
SET ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 --coverage" )
SET ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -O0 --coverage" )
SET ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -O0 --coverage" )
ENDIF ( MultiMC_CODE_COVERAGE )
2013-02-21 16:32:13 +00:00
# Tell CMake that MultiMCLauncher.jar is generated.
2014-01-08 00:27:40 +00:00
#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/launcher/MultiMCLauncher.jar GENERATED)
#SET_SOURCE_FILES_PROPERTIES(${PROJECT_BINARY_DIR}/depends/javacheck/JavaCheck.jar GENERATED)
2013-01-11 01:25:40 +00:00
2013-02-21 16:32:13 +00:00
# Qt 5 stuff
QT5_WRAP_UI ( MULTIMC_UI ${ MULTIMC_UIS } )
2014-01-19 03:52:34 +00:00
QT5_ADD_RESOURCES ( MULTIMC_RESOURCES ${ MULTIMC_QRCS } )
2013-11-24 05:36:16 +00:00
2013-12-02 10:09:56 +00:00
# Add common library
2014-01-19 03:52:34 +00:00
ADD_LIBRARY ( MultiMC_common STATIC ${ MULTIMC_SOURCES } ${ MULTIMC_UI } ${ MULTIMC_RESOURCES } )
2013-12-02 10:09:56 +00:00
2013-02-21 16:32:13 +00:00
# Add executable
2014-01-08 00:27:40 +00:00
ADD_EXECUTABLE ( MultiMC MACOSX_BUNDLE WIN32 main.cpp ${ MULTIMC_RCS } )
2013-02-21 16:32:13 +00:00
# Link
2013-12-02 10:09:56 +00:00
TARGET_LINK_LIBRARIES ( MultiMC MultiMC_common )
TARGET_LINK_LIBRARIES ( MultiMC_common xz-embedded unpack200 quazip libUtil libSettings libGroupView ${ MultiMC_LINK_ADDITIONAL_LIBS } )
2014-01-02 20:37:56 +00:00
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 } )
2013-06-30 21:39:57 +01:00
2013-02-21 16:32:13 +00:00
################################ INSTALLATION AND PACKAGING ################################
2013-02-12 16:14:23 +00:00
2013-02-21 16:32:13 +00:00
######## Install ########
2013-02-12 17:57:18 +00:00
2013-02-21 16:32:13 +00:00
#### Executable ####
2013-12-01 15:34:51 +00:00
IF ( APPLE AND UNIX ) ## OSX
INSTALL ( TARGETS MultiMC
B U N D L E D E S T I N A T I O N . C O M P O N E N T R u n t i m e
R U N T I M E D E S T I N A T I O N M u l t i M C . a p p / C o n t e n t s / M a c O S C O M P O N E N T R u n t i m e
)
2013-02-05 18:09:20 +00:00
2013-12-01 15:34:51 +00:00
ELSEIF ( UNIX ) ## LINUX and similar
INSTALL ( TARGETS MultiMC
B U N D L E D E S T I N A T I O N . C O M P O N E N T R u n t i m e
R U N T I M E D E S T I N A T I O N b i n C O M P O N E N T R u n t i m e
)
INSTALL ( PROGRAMS package/linux/MultiMC DESTINATION . )
2013-02-21 16:32:13 +00:00
2013-12-01 15:34:51 +00:00
ELSEIF ( WIN32 ) ## WINDOWS
INSTALL ( TARGETS MultiMC
B U N D L E D E S T I N A T I O N . C O M P O N E N T R u n t i m e
L I B R A R Y D E S T I N A T I O N . C O M P O N E N T R u n t i m e
R U N T I M E D E S T I N A T I O N . C O M P O N E N T R u n t i m e
)
ENDIF ( )
2013-02-12 16:14:23 +00:00
2013-12-01 15:34:51 +00:00
#### Dist package logic ####
2013-09-19 18:19:01 +01:00
2013-12-01 16:33:40 +00:00
if ( CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" )
# Image formats
INSTALL (
D I R E C T O R Y " $ { Q T _ P L U G I N S _ D I R } / i m a g e f o r m a t s "
D E S T I N A T I O N $ { P L U G I N _ D E S T _ D I R }
C O M P O N E N T R u n t i m e
R E G E X " t g a | s v g | t i f f | m n g " E X C L U D E
)
2013-09-19 18:19:01 +01:00
2013-12-01 16:33:40 +00:00
# Platform plugins
INSTALL (
D I R E C T O R Y " $ { Q T _ P L U G I N S _ D I R } / p l a t f o r m s "
D E S T I N A T I O N $ { P L U G I N _ D E S T _ D I R }
C O M P O N E N T R u n t i m e
R E G E X " m i n i m a l | l i n u x f b | o f f s c r e e n " E X C L U D E
)
else ( )
2013-12-01 15:34:51 +00:00
# Image formats
INSTALL (
D I R E C T O R Y " $ { Q T _ P L U G I N S _ D I R } / i m a g e f o r m a t s "
D E S T I N A T I O N $ { P L U G I N _ D E S T _ D I R }
C O M P O N E N T R u n t i m e
R E G E X " t g a | s v g | t i f f | m n g " E X C L U D E
R E G E X " d \ \ . " E X C L U D E
2013-12-01 16:33:40 +00:00
R E G E X " _ d e b u g \ \ . " E X C L U D E
2013-12-01 15:34:51 +00:00
)
2013-09-19 18:19:01 +01:00
2013-12-01 15:34:51 +00:00
# Platform plugins
INSTALL (
D I R E C T O R Y " $ { Q T _ P L U G I N S _ D I R } / p l a t f o r m s "
D E S T I N A T I O N $ { P L U G I N _ D E S T _ D I R }
C O M P O N E N T R u n t i m e
R E G E X " m i n i m a l | l i n u x f b | o f f s c r e e n " E X C L U D E
R E G E X " d \ \ . " E X C L U D E
2013-12-01 16:33:40 +00:00
R E G E X " _ d e b u g \ \ . " E X C L U D E
2013-12-01 15:34:51 +00:00
)
2014-01-02 14:22:57 +00:00
IF ( APPLE )
# Accessible plugin to make buttons look decent on osx
INSTALL (
D I R E C T O R Y " $ { Q T _ P L U G I N S _ D I R } / a c c e s s i b l e "
D E S T I N A T I O N $ { P L U G I N _ D E S T _ D I R }
C O M P O N E N T R u n t i m e
R E G E X " q u i c k " E X C L U D E
R E G E X " d \ \ . " E X C L U D E
R E G E X " _ d e b u g \ \ . " E X C L U D E
)
ENDIF ( )
2013-12-01 16:33:40 +00:00
endif ( )
2013-09-19 18:19:01 +01:00
2013-12-01 15:34:51 +00:00
# qtconf
INSTALL (
C O D E "
FILE ( WRITE \"\${CMAKE_INSTALL_PREFIX}/${QTCONF_DEST_DIR}/qt.conf\" \"\")
"
C O M P O N E N T R u n t i m e
)
2013-09-19 18:19:01 +01:00
2014-01-08 20:06:31 +00:00
# ICNS file for OS X
IF ( APPLE )
2014-01-19 04:21:09 +00:00
INSTALL ( FILES resources/MultiMC.icns DESTINATION MultiMC.app/Contents/Resources )
2014-01-08 20:06:31 +00:00
ENDIF ( )
2013-12-10 19:37:15 +00:00
CONFIGURE_FILE (
" $ { C M A K E _ C U R R E N T _ S O U R C E _ D I R } / i n s t a l l _ p r e r e q s . c m a k e . i n "
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / i n s t a l l _ p r e r e q s . c m a k e "
@ O N L Y )
INSTALL ( SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install_prereqs.cmake" COMPONENT Runtime )
2013-09-19 18:19:01 +01:00
2013-02-06 06:37:51 +00:00
2013-02-05 18:09:20 +00:00
2013-02-21 16:32:13 +00:00
######## Package ########
2013-02-05 18:09:20 +00:00
# Package with CPack
IF ( UNIX )
2013-03-20 00:15:19 +00:00
if ( APPLE )
SET ( CPACK_GENERATOR "ZIP" )
else ( )
SET ( CPACK_GENERATOR "TGZ" )
endif ( )
2013-02-05 18:09:20 +00:00
ELSEIF ( WIN32 )
2013-03-20 00:15:19 +00:00
SET ( CPACK_GENERATOR "ZIP" )
2013-02-05 18:09:20 +00:00
ENDIF ( )
2013-02-12 17:57:18 +00:00
SET ( CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0 )
SET ( CPACK_PACKAGE_NAME "MultiMC 5" )
SET ( CPACK_PACKAGE_VENDOR "" )
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_MAJOR ${ MultiMC_VERSION_MAJOR } )
SET ( CPACK_PACKAGE_VERSION_MINOR ${ MultiMC_VERSION_MINOR } )
SET ( CPACK_PACKAGE_VERSION_PATCH ${ MultiMC_VERSION_REV } )
IF ( CPACK_GENERATOR STREQUAL "NSIS" )
SET ( CPACK_PACKAGE_FILE_NAME "Setup-MultiMC" )
ELSE ( )
SET ( CPACK_PACKAGE_FILE_NAME "MultiMC" )
ENDIF ( )
IF ( WIN32 )
SET ( CPACK_PACKAGE_INSTALL_DIRECTORY "MultiMC 5" )
ENDIF ( )
2013-02-05 18:09:20 +00:00
INCLUDE ( CPack )
2013-03-19 20:17:35 +00:00
include_directories ( ${ PROJECT_BINARY_DIR } /include )
2013-09-08 19:18:55 +01:00
### translation stuff
file ( GLOB TRANSLATIONS_FILES translations/*.ts )
option ( UPDATE_TRANSLATIONS "Update source translation translations/*.ts files (WARNING: make clean will delete the source .ts files! Danger!)" )
2013-12-01 15:34:51 +00:00
IF ( UPDATE_TRANSLATIONS )
qt5_create_translation ( QM_FILES ${ FILES_TO_TRANSLATE } ${ TRANSLATIONS_FILES } )
ELSE ( )
qt5_add_translation ( QM_FILES ${ TRANSLATIONS_FILES } )
ENDIF ( )
2013-09-08 19:18:55 +01:00
2013-10-01 22:13:21 +01:00
add_custom_target ( translations DEPENDS ${ QM_FILES } )
2013-12-28 01:03:53 +00:00
IF ( APPLE AND UNIX ) ## OSX
install ( FILES ${ QM_FILES } DESTINATION MultiMC.app/Contents/MacOS/translations )
ELSE ( )
install ( FILES ${ QM_FILES } DESTINATION translations )
ENDIF ( )
2013-09-08 19:18:55 +01:00
2013-12-02 10:09:56 +00:00
# Tests
add_subdirectory ( tests )