2013-01-11 06:55:40 +05:30
cmake_minimum_required ( VERSION 2.8.9 )
2013-09-26 17:19:58 +05:30
2013-10-06 05:39:21 +05:30
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 17:19:58 +05:30
2013-02-05 23:39:20 +05:30
project ( MultiMC )
2013-01-11 06:55:40 +05:30
2013-02-21 22:02:13 +05:30
######## Set CMake options ########
SET ( CMAKE_AUTOMOC ON )
SET ( CMAKE_INCLUDE_CURRENT_DIR ON )
2013-09-08 23:48:55 +05:30
SET ( FILES_TO_TRANSLATE )
2013-01-11 06:55:40 +05:30
2013-11-24 11:06:16 +05:30
######## 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 22:02:13 +05:30
# Output all executables and shared libs in the main build folder, not in subfolders.
2013-02-21 06:40:09 +05:30
SET ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } )
2013-01-11 06:55:40 +05:30
2013-02-22 02:22:23 +05:30
IF ( UNIX )
SET ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } )
ENDIF ( )
2013-02-22 00:05:33 +05:30
######## Set compiler flags ########
IF ( APPLE )
message ( STATUS "Using APPLE CMAKE_CXX_FLAGS" )
2013-12-01 21:04:51 +05:30
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall" )
2013-02-22 00:05:33 +05:30
ELSEIF ( UNIX )
# assume GCC, add C++0x/C++11 stuff
MESSAGE ( STATUS "Using UNIX CMAKE_CXX_FLAGS" )
2013-12-01 21:04:51 +05:30
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall" )
2013-02-22 00:05:33 +05:30
ELSEIF ( MINGW )
MESSAGE ( STATUS "Using MINGW CMAKE_CXX_FLAGS" )
2013-12-01 21:04:51 +05:30
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall" )
2013-02-22 00:05:33 +05:30
ENDIF ( )
2013-02-21 22:02:13 +05:30
################################ INCLUDE LIBRARIES ################################
2013-01-11 06:55:40 +05:30
2013-02-21 22:02:13 +05:30
######## 3rd Party Libs ########
# Find the required Qt parts
2013-02-20 20:02:26 +05:30
find_package ( Qt5Widgets REQUIRED )
find_package ( Qt5Network REQUIRED )
2013-09-08 23:48:55 +05:30
find_package ( Qt5LinguistTools REQUIRED )
2013-01-11 06:55:40 +05:30
include_directories ( ${ Qt5Widgets_INCLUDE_DIRS } )
2013-12-01 21:04:51 +05:30
# 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 22:02:13 +05:30
######## Included Libs ########
2013-01-11 06:55:40 +05:30
# Add quazip
2013-08-17 17:10:51 +05:30
add_subdirectory ( depends/quazip )
2013-08-26 06:23:29 +05:30
include_directories ( depends/quazip )
2013-01-11 06:55:40 +05:30
2013-11-24 11:06:16 +05:30
# Add the java launcher and checker
2013-08-17 17:10:51 +05:30
add_subdirectory ( depends/launcher )
2013-11-24 11:06:16 +05:30
add_subdirectory ( depends/javacheck )
2013-02-21 06:40:09 +05:30
2013-09-28 22:13:30 +05:30
# Add xz decompression
add_subdirectory ( depends/xz-embedded )
2013-09-30 06:04:46 +05:30
include_directories ( ${ XZ_INCLUDE_DIR } )
2013-09-28 22:13:30 +05:30
# Add pack200 decompression
add_subdirectory ( depends/pack200 )
2013-09-30 06:04:46 +05:30
include_directories ( ${ PACK200_INCLUDE_DIR } )
2013-09-28 22:13:30 +05:30
2013-02-21 22:02:13 +05:30
######## MultiMC Libs ########
2013-02-21 06:40:09 +05:30
# Add the util library.
2013-08-17 17:10:51 +05:30
add_subdirectory ( depends/util )
2013-02-27 04:17:39 +05:30
include_directories ( ${ LIBUTIL_INCLUDE_DIR } )
2013-02-21 06:40:09 +05:30
# Add the settings library.
2013-08-17 17:10:51 +05:30
add_subdirectory ( depends/settings )
2013-02-27 04:17:39 +05:30
include_directories ( ${ LIBSETTINGS_INCLUDE_DIR } )
2013-02-21 06:40:09 +05:30
2013-03-12 02:49:17 +05:30
# Add the group view library.
2013-08-17 17:10:51 +05:30
add_subdirectory ( depends/groupview )
2013-03-12 02:49:17 +05:30
include_directories ( ${ LIBGROUPVIEW_INCLUDE_DIR } )
2013-12-02 05:25:24 +05:30
# Add the updater
add_subdirectory ( mmc_updater )
2013-02-21 22:02:13 +05:30
################################ SET UP BUILD OPTIONS ################################
######## Check endianness ########
INCLUDE ( TestBigEndian )
TEST_BIG_ENDIAN ( BIGENDIAN )
IF ( ${ BIGENDIAN } )
2013-03-20 05:45:19 +05:30
ADD_DEFINITIONS ( -DMULTIMC_BIG_ENDIAN )
2013-02-21 22:02:13 +05:30
ENDIF ( ${ BIGENDIAN } )
######## Set version numbers ########
2013-12-02 01:57:36 +05:30
SET ( MultiMC_VERSION_MAJOR 1 )
2013-02-21 22:02:13 +05:30
SET ( MultiMC_VERSION_MINOR 0 )
2013-01-11 06:55:40 +05:30
2013-10-02 03:31:41 +05:30
# Build number
2013-12-02 01:57:36 +05:30
SET ( MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number." )
# Build type
2013-12-05 00:04:12 +05:30
SET ( MultiMC_VERSION_BUILD_TYPE "custombuild" CACHE STRING "Build type. If this is set, it is appended to the end of the version string with a dash (<version string>-<build type>. It is not used for anything other than indicating in the version string what type of build this is (eg 'lin64')." )
2013-12-02 01:57:36 +05:30
2013-12-05 00:04:12 +05:30
# 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-02 01:57:36 +05:30
2013-12-05 00:04:12 +05:30
# 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-02 01:57:36 +05:30
2013-12-05 00:04:12 +05:30
# Build a version string to display in the configure logs.
SET ( MultiMC_VERSION_STRING "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}" )
2013-12-02 01:57:36 +05:30
IF ( MultiMC_VERSION_BUILD GREATER -1 )
SET ( MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}.${MultiMC_VERSION_BUILD}" )
ENDIF ( )
2013-12-05 00:04:12 +05:30
IF ( NOT MultiMC_VERSION_CHANNEL STREQUAL "" )
SET ( MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}-${MultiMC_VERSION_CHANNEL}" )
ENDIF ( )
2013-12-02 01:57:36 +05:30
IF ( NOT MultiMC_VERSION_BUILD_TYPE STREQUAL "" )
SET ( MultiMC_VERSION_STRING "${MultiMC_VERSION_STRING}-${MultiMC_VERSION_BUILD_TYPE}" )
ENDIF ( )
MESSAGE ( STATUS "MultiMC 5 version ${MultiMC_VERSION_STRING}" )
2013-02-21 22:02:13 +05:30
2013-12-05 00:04:12 +05:30
# 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-02 05:25:24 +05:30
#### Custom target to just print the version.
2013-12-02 01:57:36 +05:30
ADD_CUSTOM_TARGET ( version echo "Version: ${MultiMC_VERSION_STRING}" )
2013-10-02 03:31:41 +05:30
2013-12-02 05:25:24 +05:30
#### Check the current Git commit
2013-02-21 22:32:48 +05:30
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 22:02:13 +05:30
######## Configure header ########
2013-12-02 05:25:24 +05:30
configure_file ( "${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/include/config.h" )
2013-01-11 06:55:40 +05:30
2013-02-21 22:02:13 +05:30
2013-04-01 22:34:40 +05:30
######## Other Stuff ########
ADD_DEFINITIONS ( -DQUAZIP_STATIC )
2013-08-26 06:23:29 +05:30
ADD_DEFINITIONS ( -DLIBSETTINGS_STATIC )
ADD_DEFINITIONS ( -DLIBUTIL_STATIC )
ADD_DEFINITIONS ( -DLIBGROUPVIEW_STATIC )
2013-04-01 22:34:40 +05:30
2013-02-21 22:02:13 +05:30
################################ FILES ################################
2013-09-22 07:51:36 +05:30
######## Sources and headers ########
SET ( MULTIMC_SOURCES
# Application base
2013-09-07 07:30:58 +05:30
M u l t i M C . h
2013-09-22 07:51:36 +05:30
M u l t i M C . c p p
2013-09-07 07:30:58 +05:30
M u l t i M C V e r s i o n . h
2013-07-29 04:29:35 +05:30
2013-10-06 04:43:40 +05:30
# 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 07:23:05 +05:30
# 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 / d i a l o g s /
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 09:10:40 +05:30
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 23:35:35 +05:30
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-28 03:44:18 +05:30
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-02 05:25:24 +05:30
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 07:23:05 +05:30
# GUI - widgets
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
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 17:10:51 +05:30
# Base classes and infrastructure
2013-09-16 04:24:39 +05:30
l o g i c / B a s e V e r s i o n . h
2013-08-17 17:10:51 +05:30
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 07:51:36 +05:30
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 17:10:51 +05:30
l o g i c / B a s e I n s t a n c e . h
2013-09-22 07:51:36 +05:30
l o g i c / B a s e I n s t a n c e . c p p
2013-08-17 17:10:51 +05:30
l o g i c / B a s e I n s t a n c e _ p . h
2013-09-22 07:51:36 +05:30
2013-08-17 17:10:51 +05:30
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 07:51:36 +05:30
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 17:10:51 +05:30
l o g i c / M o d . h
2013-09-22 07:51:36 +05:30
l o g i c / M o d . c p p
2013-08-17 17:10:51 +05:30
l o g i c / M o d L i s t . h
2013-09-22 07:51:36 +05:30
l o g i c / M o d L i s t . c p p
2013-08-17 17:10:51 +05:30
2013-09-07 07:30:58 +05:30
# 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 07:51:36 +05:30
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 07:30:58 +05:30
2013-08-17 17:10:51 +05:30
# network stuffs
2013-10-26 23:25:48 +05:30
l o g i c / n e t / N e t A c t i o n . h
2013-12-10 11:42:52 +05:30
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 05:45:20 +05:30
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 07:51:36 +05:30
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 05:45:20 +05:30
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 07:51:36 +05:30
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 16:14:18 +05:30
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 06:04:46 +05:30
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 23:25:48 +05:30
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-07 01:28:51 +05:30
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 07:51:36 +05:30
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-10-26 23:25:48 +05:30
l o g i c / n e t / S 3 L i s t B u c k e t . h
l o g i c / n e t / S 3 L i s t B u c k e t . c p p
2013-12-07 04:07:12 +05:30
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-10-26 23:25:48 +05:30
2013-11-12 00:29:59 +05:30
# Yggdrasil login stuff
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-14 00:08:28 +05:30
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 06:30:42 +05:30
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 17:10:51 +05:30
2013-12-05 00:04:12 +05:30
# 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-06 01:22:55 +05:30
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
2013-12-05 00:04:12 +05:30
2013-08-17 17:10:51 +05:30
# 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 07:51:36 +05:30
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 17:10:51 +05:30
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 07:51:36 +05:30
l o g i c / L e g a c y U p d a t e . c p p
2013-08-17 17:10:51 +05:30
l o g i c / L e g a c y F o r g e . h
2013-09-22 07:51:36 +05:30
l o g i c / L e g a c y F o r g e . c p p
2013-08-17 17:10:51 +05:30
# 1.6 instances
l o g i c / O n e S i x I n s t a n c e . h
2013-09-22 07:51:36 +05:30
l o g i c / O n e S i x I n s t a n c e . c p p
2013-08-17 17:10:51 +05:30
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 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 07:51:36 +05:30
l o g i c / O n e S i x V e r s i o n . h
2013-09-12 03:13:17 +05:30
l o g i c / O n e S i x V e r s i o n . c p p
2013-09-22 07:51:36 +05:30
l o g i c / O n e S i x L i b r a r y . h
2013-09-12 03:13:17 +05:30
l o g i c / O n e S i x L i b r a r y . c p p
2013-09-22 07:51:36 +05:30
l o g i c / O n e S i x R u l e . h
2013-09-12 03:13:17 +05:30
l o g i c / O n e S i x R u l e . c p p
2013-09-22 07:51:36 +05:30
l o g i c / O p S y s . h
2013-09-12 03:13:17 +05:30
l o g i c / O p S y s . c p p
2013-09-22 07:51:36 +05:30
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-08-17 17:10:51 +05:30
# Nostalgia
2013-09-22 07:51:36 +05:30
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 17:10:51 +05:30
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
# Lists
2013-09-22 07:51:36 +05:30
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 17:10:51 +05:30
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 07:51:36 +05:30
l o g i c / l i s t s / I c o n L i s t . h
2013-09-16 04:24:39 +05:30
l o g i c / l i s t s / I c o n L i s t . c p p
2013-09-22 07:51:36 +05:30
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-16 04:24:39 +05:30
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 07:51:36 +05:30
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 17:10:51 +05:30
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 07:51:36 +05:30
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 17:10:51 +05:30
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 07:51:36 +05:30
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-16 04:24:39 +05:30
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 07:29:21 +05:30
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-11-18 23:35:35 +05:30
l o g i c / l i s t s / M o j a n g A c c o u n t L i s t . h
l o g i c / l i s t s / M o j a n g A c c o u n t L i s t . c p p
2013-09-16 04:24:39 +05:30
# misc model/view
2013-09-22 07:51:36 +05:30
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-16 04:24:39 +05:30
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 17:10:51 +05:30
# Tasks
2013-09-22 07:51:36 +05:30
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 17:10:51 +05:30
l o g i c / t a s k s / T a s k . c p p
2013-09-23 03:53:50 +05:30
2013-10-05 05:38:13 +05:30
# Utilities
2013-11-24 11:06:16 +05:30
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 05:38:13 +05:30
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 20:50:26 +05:30
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 22:26:15 +05:30
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-09-22 07:51:36 +05:30
2013-12-08 08:28:44 +05:30
# Assets
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 06:40:09 +05:30
)
2013-02-21 22:02:13 +05:30
######## UIs ########
SET ( MULTIMC_UIS
2013-11-04 07:23:05 +05:30
# 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 23:35:35 +05:30
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-28 03:44:18 +05:30
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 09:10:40 +05:30
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-02 05:25:24 +05:30
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 07:23:05 +05:30
# 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 05:46:07 +05:30
)
2013-09-22 07:51:36 +05:30
set ( FILES_TO_TRANSLATE ${ FILES_TO_TRANSLATE } ${ MULTIMC_SOURCES } ${ MULTIMC_UIS } )
2013-09-08 23:48:55 +05:30
2013-02-19 00:29:01 +05:30
2013-02-21 22:02:13 +05:30
######## Windows resource files ########
IF ( WIN32 )
SET ( MULTIMC_RCS multimc.rc )
ENDIF ( )
2013-10-18 22:12:41 +05:30
####### 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 07:23:05 +05:30
LIST ( APPEND MULTIMC_SOURCES gui/Platform_X11.cpp )
2013-10-18 22:12:41 +05:30
ELSE ( )
2013-11-04 07:23:05 +05:30
LIST ( APPEND MULTIMC_SOURCES gui/Platform_Other.cpp )
2013-10-18 22:12:41 +05:30
ENDIF ( )
2013-02-21 22:02:13 +05:30
################################ COMPILE ################################
2013-02-19 00:29:01 +05:30
2013-02-21 22:02:13 +05:30
# ICNS file for OS X
2013-02-19 00:29:01 +05:30
IF ( APPLE )
2013-03-12 02:49:17 +05:30
SET ( MACOSX_BUNDLE_ICON_FILE MultiMC.icns )
2013-02-19 00:29:01 +05:30
SET_SOURCE_FILES_PROPERTIES ( ${ CMAKE_CURRENT_SOURCE_DIR } /MultiMC.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
SET ( MULTIMC_SOURCES ${ MULTIMC_SOURCES } ${ CMAKE_CURRENT_SOURCE_DIR } /MultiMC.icns )
ENDIF ( APPLE )
2013-02-21 22:02:13 +05:30
# Link additional libraries
IF ( WIN32 )
2013-03-20 05:45:19 +05:30
SET ( MultiMC_LINK_ADDITIONAL_LIBS ${ MultiMC_LINK_ADDITIONAL_LIBS }
Q t 5 : : W i n M a i n # Link WinMain
)
2013-02-21 22:02:13 +05:30
ENDIF ( WIN32 )
2013-02-05 23:39:20 +05:30
2013-02-21 22:02:13 +05:30
# Tell CMake that MultiMCLauncher.jar is generated.
2013-11-24 11:06:16 +05:30
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 06:55:40 +05:30
2013-02-21 22:02:13 +05:30
# Qt 5 stuff
QT5_WRAP_UI ( MULTIMC_UI ${ MULTIMC_UIS } )
2013-11-24 11:06:16 +05:30
CONFIGURE_FILE ( generated.qrc.in generated.qrc )
QT5_ADD_RESOURCES ( GENERATED_QRC ${ CMAKE_CURRENT_BINARY_DIR } /generated.qrc )
QT5_ADD_RESOURCES ( GRAPHICS_QRC graphics.qrc )
2013-02-21 22:02:13 +05:30
# Add executable
ADD_EXECUTABLE ( MultiMC MACOSX_BUNDLE WIN32
2013-11-24 11:06:16 +05:30
$ { M U L T I M C _ S O U R C E S } $ { M U L T I M C _ U I } $ { G R A P H I C S _ Q R C } $ { G E N E R A T E D _ Q R C } $ { M U L T I M C _ R C S } )
2013-02-21 22:02:13 +05:30
# Link
2013-09-30 06:56:23 +05:30
TARGET_LINK_LIBRARIES ( MultiMC xz-embedded unpack200 quazip libUtil libSettings libGroupView ${ MultiMC_LINK_ADDITIONAL_LIBS } )
2013-10-18 22:12:41 +05:30
QT5_USE_MODULES ( MultiMC Core Widgets Network Xml ${ MultiMC_QT_ADDITIONAL_MODULES } )
2013-11-24 11:06:16 +05:30
ADD_DEPENDENCIES ( MultiMC MultiMCLauncher JavaCheck )
2013-07-01 02:09:57 +05:30
2013-02-21 22:02:13 +05:30
################################ INSTALLATION AND PACKAGING ################################
2013-02-12 21:44:23 +05:30
2013-12-01 21:04:51 +05:30
######## Packaging/install paths setup ########
2013-02-21 22:02:13 +05:30
2013-12-01 21:04:51 +05:30
IF ( UNIX AND APPLE )
2013-02-19 00:29:01 +05:30
SET ( PLUGIN_DEST_DIR MultiMC.app/Contents/MacOS )
SET ( QTCONF_DEST_DIR MultiMC.app/Contents/Resources )
2013-12-01 21:04:51 +05:30
SET ( APPS "\${CMAKE_INSTALL_PREFIX}/MultiMC.app" )
2013-02-12 23:27:18 +05:30
2013-02-19 00:29:01 +05:30
SET ( MACOSX_BUNDLE_BUNDLE_NAME "MultiMC" )
SET ( MACOSX_BUNDLE_INFO_STRING "MultiMC Minecraft launcher and management utility." )
2013-12-01 21:04:51 +05:30
SET ( MACOSX_BUNDLE_BUNDLE_VERSION "${MultiMC_VERSION_MAJOR}.${MultiMC_VERSION_MINOR}.${MultiMC_VERSION_REV}.${MultiMC_VERSION_BUILD}" )
2013-02-19 00:29:01 +05:30
#SET(MACOSX_BUNDLE_GUI_IDENTIFIER "")
SET ( MACOSX_BUNDLE_ICON_FILE MultiMC.icns )
2013-12-01 21:04:51 +05:30
ELSEIF ( UNIX )
SET ( PLUGIN_DEST_DIR plugins )
SET ( QTCONF_DEST_DIR . )
SET ( APPS "\${CMAKE_INSTALL_PREFIX}/bin/MultiMC" )
ELSEIF ( WIN32 )
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}" )
2013-02-13 00:19:13 +05:30
2013-02-21 22:02:13 +05:30
######## Install ########
2013-02-12 23:27:18 +05:30
2013-02-21 22:02:13 +05:30
#### Executable ####
2013-12-01 21:04:51 +05:30
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 23:39:20 +05:30
2013-12-01 21:04:51 +05:30
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 22:02:13 +05:30
2013-12-01 21:04:51 +05:30
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 21:44:23 +05:30
2013-12-01 21:04:51 +05:30
#### Dist package logic ####
2013-09-19 22:49:01 +05:30
2013-12-01 22:03:40 +05:30
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 22:49:01 +05:30
2013-12-01 22:03:40 +05:30
# 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 21:04:51 +05:30
# 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 22:03:40 +05:30
R E G E X " _ d e b u g \ \ . " E X C L U D E
2013-12-01 21:04:51 +05:30
)
2013-09-19 22:49:01 +05:30
2013-12-01 21:04:51 +05:30
# 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 22:03:40 +05:30
R E G E X " _ d e b u g \ \ . " E X C L U D E
2013-12-01 21:04:51 +05:30
)
2013-12-01 22:03:40 +05:30
endif ( )
2013-09-19 22:49:01 +05:30
2013-12-01 21:04:51 +05:30
# 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 22:49:01 +05:30
2013-12-01 21:04:51 +05:30
INSTALL (
C O D E "
FILE ( GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${PLUGIN_DEST_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
function ( gp_resolved_file_type_override resolved_file type_var )
if ( resolved_file MATCHES \"^/usr/lib/libQt\")
2013-12-01 22:03:40 +05:30
message ( \"resolving \${resolved_file} as other\ " )
2013-12-01 21:04:51 +05:30
set ( \${type_var} other PARENT_SCOPE )
endif ( )
endfunction ( )
include ( BundleUtilities )
fixup_bundle ( \"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
"
C O M P O N E N T R u n t i m e
)
2013-09-19 22:49:01 +05:30
2013-02-06 12:07:51 +05:30
2013-02-05 23:39:20 +05:30
2013-02-21 22:02:13 +05:30
######## Package ########
2013-02-05 23:39:20 +05:30
# Package with CPack
IF ( UNIX )
2013-03-20 05:45:19 +05:30
if ( APPLE )
SET ( CPACK_GENERATOR "ZIP" )
else ( )
SET ( CPACK_GENERATOR "TGZ" )
endif ( )
2013-02-05 23:39:20 +05:30
ELSEIF ( WIN32 )
2013-03-20 05:45:19 +05:30
SET ( CPACK_GENERATOR "ZIP" )
2013-02-05 23:39:20 +05:30
ENDIF ( )
2013-02-12 23:27:18 +05:30
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 23:39:20 +05:30
INCLUDE ( CPack )
2013-03-20 01:47:35 +05:30
include_directories ( ${ PROJECT_BINARY_DIR } /include )
2013-09-08 23:48:55 +05:30
### 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 21:04:51 +05:30
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 23:48:55 +05:30
2013-10-02 02:43:21 +05:30
add_custom_target ( translations DEPENDS ${ QM_FILES } )
2013-09-08 23:48:55 +05:30
2013-09-12 03:13:17 +05:30
install ( FILES ${ QM_FILES } DESTINATION ${ CMAKE_INSTALL_PREFIX } /translations )