diff --git a/CMakeLists.txt b/CMakeLists.txt index e9f90f913..277dd79cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,8 +18,6 @@ option(ENABLE_ERM "Enable compilation of ERM scripting module" OFF) option(ENABLE_LAUNCHER "Enable compilation of launcher" ON) option(ENABLE_TEST "Enable compilation of unit tests" ON) option(ENABLE_PCH "Enable compilation using precompiled headers" ON) -# TODO: default to ON when we start distributing macOS binaries -option(ENABLE_SPARKLE "Enable auto-updating with Sparkle on macOS" OFF) # Allow to pass package name from Travis CI set(PACKAGE_NAME_SUFFIX "" CACHE STRING "Suffix for CPack package name") @@ -84,40 +82,6 @@ if(WIN32) endif() endif(WIN32) -if(APPLE) - # Default location for thirdparty libs - set(CMAKE_INCLUDE_PATH "../include" "${CMAKE_OSX_SYSROOT}/usr/include") - set(CMAKE_LIBRARY_PATH "../lib") - set(CMAKE_FRAMEWORK_PATH "../Frameworks") - set(BOOST_ROOT "../") - - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin") - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin") - set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin") - - set(CMAKE_XCODE_ATTRIBUTE_CONFIGURATION_BUILD_DIR "${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)") - set(CMAKE_XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @executable_path/") - - # Build with clang ang libc++ - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") - set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") - - if(ENABLE_SPARKLE) - # so that OSX_checkForUpdates knows whether to be a noop - add_definitions(-DSPARKLE) - - # On OS X we use Sparkle framework for updates - find_path(SPARKLE_INCLUDE_DIR Sparkle.h) - find_library(SPARKLE_FRAMEWORK NAMES Sparkle) - endif() - - # Xcode 5.0 fix - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftemplate-depth=256") - - # Link with iconv - set(SYSTEM_LIBS ${SYSTEM_LIBS} libiconv.dylib) -endif(APPLE) - if(NOT WIN32) INCLUDE(CheckLibraryExists) @@ -227,7 +191,7 @@ if(ENABLE_ERM) add_subdirectory(scripting/erm) endif() if(NOT MINIZIP_FOUND) - add_subdirectory(lib/minizip) + add_subdirectory_with_folder("3rdparty" lib/minizip) set(MINIZIP_LIBRARIES minizip) endif() add_subdirectory(lib) @@ -317,9 +281,43 @@ if(WIN32) configure_file("${CMAKE_SOURCE_DIR}/cmake_modules/CMakeCPackOptions.cmake.in" "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/CMakeCPackOptions.cmake") elseif(APPLE) - set(CPACK_GENERATOR DragNDrop) + set(CPACK_MONOLITHIC_INSTALL 1) + set(CPACK_GENERATOR "DragNDrop") set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_SOURCE_DIR}/osx/dmg_background.png") set(CPACK_DMG_DS_STORE "${CMAKE_SOURCE_DIR}/osx/dmg_DS_Store") + + if(ENABLE_LAUNCHER) + set(MACOSX_BUNDLE_EXECUTABLE_NAME "vcmilauncher") + else() + set(MACOSX_BUNDLE_EXECUTABLE_NAME "vcmiclient") + endif() + set(MACOSX_BUNDLE_ICON_FILE "vcmi.icns") + + install(DIRECTORY ${CMAKE_SOURCE_DIR}/config/ DESTINATION ${APP_BUNDLE_CONTENTS_DIR}/Data/config/) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/Mods/vcmi/ DESTINATION ${APP_BUNDLE_CONTENTS_DIR}/Data/Mods/vcmi/) + install(DIRECTORY ${CMAKE_SOURCE_DIR}/launcher/icons/ DESTINATION ${APP_BUNDLE_CONTENTS_DIR}/Data/launcher/icons/) + + install(FILES ${CMAKE_SOURCE_DIR}/osx/vcmi.icns DESTINATION ${APP_BUNDLE_RESOURCES_DIR}) + + configure_file(${CMAKE_SOURCE_DIR}/osx/Info.plist.in + "${APP_BUNDLE_CONTENTS_DIR}/Info.plist") + + if(ENABLE_LAUNCHER) + find_program(TOOL_MACDEPLOYQT NAMES macdeployqt PATHS ${qt_base_dir}/bin) + if(NOT TOOL_MACDEPLOYQT) + message(FATAL_ERROR "Could not find macdeployqt") + endif() + string(REPLACE " " "\\ " ESCAPED_BUNDLE_DIR ${APP_BUNDLE_DIR}) + install(CODE "execute_process(COMMAND ${TOOL_MACDEPLOYQT} ${ESCAPED_BUNDLE_DIR} -verbose=2)") + endif() + + INSTALL(CODE " + set(BU_CHMOD_BUNDLE_ITEMS ON) + include(BundleUtilities) + fixup_bundle(\"${APP_BUNDLE_DIR}\" \"\" \"\") + " COMPONENT Runtime) + + install(DIRECTORY ${APP_BUNDLE_DIR} DESTINATION "." USE_SOURCE_PERMISSIONS) else() set(CPACK_GENERATOR TGZ) endif() diff --git a/client/Autoupdate.mm b/client/Autoupdate.mm deleted file mode 100644 index 6cd132e68..000000000 --- a/client/Autoupdate.mm +++ /dev/null @@ -1,11 +0,0 @@ -#ifdef SPARKLE -#import -#import "Sparkle.h" -#endif - -void OSX_checkForUpdates() { -#ifdef SPARKLE - SUUpdater* updater = [[SUUpdater alloc] init]; - [[SUUpdater sharedUpdater] checkForUpdatesInBackground]; -#endif -} diff --git a/client/CMT.cpp b/client/CMT.cpp index c84b3329a..6af5bd698 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -219,10 +219,6 @@ static void SDLLogCallback(void* userdata, logGlobal->debug("SDL(category %d; priority %d) %s", category, priority, message); } -#ifdef VCMI_APPLE -void OSX_checkForUpdates(); -#endif - #if defined(VCMI_WINDOWS) && !defined (__GNUC__) int wmain(int argc, wchar_t* argv[]) #elif defined(VCMI_APPLE) || defined(VCMI_ANDROID) @@ -240,17 +236,6 @@ int main(int argc, char * argv[]) std::string executablePath = argv[0]; std::string workDir = executablePath.substr(0, executablePath.rfind('/')); chdir(workDir.c_str()); - - // Check for updates - OSX_checkForUpdates(); - - // Check that game data is prepared. Otherwise run vcmibuilder helper application - FILE* check = fopen((VCMIDirs::get().userDataPath() / "game_data_prepared").string().c_str(), "r"); - if (check == nullptr) { - system("open ./vcmibuilder.app"); - return 0; - } - fclose(check); #endif std::cout << "Starting... " << std::endl; po::options_description opts("Allowed options"); diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 36436e2e5..7dc078efa 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -120,69 +120,14 @@ if(ANDROID) # android needs client/server to be libraries, not executables, so w endif() if(APPLE) - # OS X specific source files - set(client_SRCS ${client_SRCS} SDLMain.m Autoupdate.mm Info.plist vcmi.icns ../osx/vcmi_dsa_public.pem) + set(client_SRCS ${client_SRCS} SDLMain.m) +elseif(WIN32) + set(client_ICON "VCMI_client.rc") +endif() - if(ENABLE_SPARKLE) - # OS X specific includes - include_directories(${SPARKLE_INCLUDE_DIR}) - - # OS X specific libraries - target_link_libraries(vcmiclient ${SPARKLE_FRAMEWORK}) - endif() - - # Because server and AI libs would be copies to bundle they need to be built before client - add_dependencies(vcmiclient vcmiserver VCAI EmptyAI StupidAI BattleAI minizip) - - # Custom Info.plist - set_target_properties(vcmiclient PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) - - # Copy icon file and public key for Sparkle - set_source_files_properties(vcmi.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - set_source_files_properties(../osx/vcmi_dsa_public.pem PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - - set_target_properties(vcmiclient PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @executable_path/") - - # Copy server executable, libs and game data to bundle - set(BUNDLE_PATH ${CMAKE_HOME_DIRECTORY}/bin/$(CONFIGURATION)/vcmiclient.app/Contents) - - set(CopyVendoredMinizip - mkdir -p ${BUNDLE_PATH}/MacOS && cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/lib/libminizip.dylib ${BUNDLE_PATH}/MacOS/libminizip.dylib) - - set(MakeVCMIBundle - # Copy all needed binaries - mkdir -p ${BUNDLE_PATH}/MacOS/AI && - cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/vcmiserver ${BUNDLE_PATH}/MacOS/vcmiserver && - cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/vcmiclient.app/Contents/MacOS/vcmiclient ${BUNDLE_PATH}/MacOS/vcmiclient && - cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/libvcmi.dylib ${BUNDLE_PATH}/MacOS/libvcmi.dylib && - cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/AI/libVCAI.dylib ${BUNDLE_PATH}/MacOS/AI/libVCAI.dylib && - cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/AI/libStupidAI.dylib ${BUNDLE_PATH}/MacOS/AI/libStupidAI.dylib && - cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/AI/libEmptyAI.dylib ${BUNDLE_PATH}/MacOS/AI/libEmptyAI.dylib && - cp ${CMAKE_BINARY_DIR}/build/$(CONFIGURATION)/AI/libBattleAI.dylib ${BUNDLE_PATH}/MacOS/AI/libBattleAI.dylib && - cp -r ${CMAKE_HOME_DIRECTORY}/osx/vcmibuilder.app ${BUNDLE_PATH}/MacOS/vcmibuilder.app && - - # Copy frameworks - sh -c 'cp -r ${CMAKE_HOME_DIRECTORY}/${CMAKE_FRAMEWORK_PATH} ${BUNDLE_PATH}/Frameworks/ || true' && - - # Copy vcmi data - mkdir -p ${BUNDLE_PATH}/Data && - mkdir -p ${BUNDLE_PATH}/Data/Mods && - mkdir -p ${BUNDLE_PATH}/Data/launcher && - cp -r ${CMAKE_HOME_DIRECTORY}/config/ ${BUNDLE_PATH}/Data/config/ && - cp -r ${CMAKE_HOME_DIRECTORY}/Mods/vcmi/ ${BUNDLE_PATH}/Data/Mods/vcmi/ && - sh -c 'cp -r ${CMAKE_HOME_DIRECTORY}/Mods/WoG/ ${BUNDLE_PATH}/Data/Mods/WoG/ || echo "Download WoG mod from http://wiki.vcmi.eu/index.php?title=Mod_list" ' && - sh -c 'cp -r ${CMAKE_HOME_DIRECTORY}/Mods/hota/ ${BUNDLE_PATH}/Data/Mods/hota/ || echo "Download HOTA mod from http://wiki.vcmi.eu/index.php?title=Mod_list" ' && - cp -r ${CMAKE_HOME_DIRECTORY}/launcher/icons/ ${BUNDLE_PATH}/Data/launcher/icons/) - - if(NOT MINIZIP_FOUND) - add_custom_command(TARGET vcmiclient POST_BUILD COMMAND ${CopyVendoredMinizip}) - endif() - - add_custom_command(TARGET vcmiclient POST_BUILD COMMAND ${MakeVCMIBundle}) -endif(APPLE) +add_executable(vcmiclient WIN32 ${client_SRCS} ${client_HEADERS} ${client_ICON}) if(WIN32) - set(client_ICON VCMI_client.rc) set_target_properties(vcmiclient PROPERTIES OUTPUT_NAME "VCMI_client" @@ -190,14 +135,13 @@ if(WIN32) ) endif() -add_executable(vcmiclient WIN32 MACOSX_BUNDLE ${client_SRCS} ${client_HEADERS} ${client_ICON}) - -target_link_libraries(vcmiclient vcmi ${Boost_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES} ${SYSTEM_LIBS}) +target_link_libraries(vcmiclient vcmi ${Boost_LIBRARIES} ${SDL_LIBRARY} ${SDLIMAGE_LIBRARY} ${SDLMIXER_LIBRARY} ${SDLTTF_LIBRARY} ${ZLIB_LIBRARIES} ${FFMPEG_LIBRARIES} ${FFMPEG_EXTRA_LINKING_OPTIONS} ${SYSTEM_LIBS}) vcmi_set_output_dir(vcmiclient "") set_target_properties(vcmiclient PROPERTIES ${PCH_PROPERTIES}) cotire(vcmiclient) - -install(TARGETS vcmiclient DESTINATION ${BIN_DIR}) +if(NOT APPLE) # Already inside vcmiclient bundle + install(TARGETS vcmiclient DESTINATION ${BIN_DIR}) +endif(NOT APPLE) diff --git a/client/Info.plist b/client/Info.plist deleted file mode 100644 index b34e65ec3..000000000 --- a/client/Info.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - CFBundleIconFile - vcmi.icns - CFBundleVersion - ${VCMI_VERSION_MAJOR}.${VCMI_VERSION_MINOR} - CFBundleIdentifier - com.vcmi.vcmiclient - SUFeedURL - https://vcmi.eu/sparkle_appcast.xml - SUPublicDSAKeyFile - vcmi_dsa_public.pem - - diff --git a/cmake_modules/FindFFmpeg.cmake b/cmake_modules/FindFFmpeg.cmake index 1e0c9d1ea..4557d9d77 100644 --- a/cmake_modules/FindFFmpeg.cmake +++ b/cmake_modules/FindFFmpeg.cmake @@ -156,7 +156,7 @@ endforeach () # On OS X we ffmpeg libraries depend on VideoDecodeAcceleration and CoreVideo frameworks IF (APPLE) - SET(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} "-framework VideoDecodeAcceleration -framework CoreVideo -lbz2") + SET(FFMPEG_EXTRA_LINKING_OPTIONS "-framework VideoDecodeAcceleration -framework CoreVideo -lbz2") ENDIF() # Give a nice error message if some of the required vars are missing. diff --git a/cmake_modules/VCMIUtils.cmake b/cmake_modules/VCMIUtils.cmake index 997ef2e41..71847fd45 100644 --- a/cmake_modules/VCMIUtils.cmake +++ b/cmake_modules/VCMIUtils.cmake @@ -1,26 +1,43 @@ ####################################### -# Output directories # +# Output directories # ####################################### +if(APPLE) + set(MACOSX_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") + set(MACOSX_BUNDLE_BUNDLE_NAME "${CMAKE_PROJECT_NAME}") + set(APP_BUNDLE_NAME "${CMAKE_PROJECT_NAME}.app") + set(APP_BUNDLE_DIR "${CMAKE_BINARY_DIR}/build/${APP_BUNDLE_NAME}") + set(APP_BUNDLE_CONTENTS_DIR "${APP_BUNDLE_DIR}/Contents") + set(APP_BUNDLE_BINARY_DIR "${APP_BUNDLE_CONTENTS_DIR}/MacOS") + set(APP_BUNDLE_RESOURCES_DIR "${APP_BUNDLE_CONTENTS_DIR}/Resources") +endif() macro(vcmi_set_output_dir name dir) - # multi-config builds (e.g. msvc) + # Multi-config builds for Visual Studio, Xcode foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) - string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIGUPPERCASE) - set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/${dir}) - set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/${dir}) - set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/${dir}) + string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIGUPPERCASE) + set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/${dir}) + set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/${dir}) + set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/${dir}) endforeach() - # generic no-config case (e.g. with mingw or MacOS) - set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${dir}) - set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${dir}) - set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${dir}) + # Generic no-config case for Makefiles, Ninja. + # This is what Qt Creator is using + if(APPLE) + set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${APP_BUNDLE_BINARY_DIR}/${dir}) + set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${APP_BUNDLE_BINARY_DIR}/${dir}) + set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${APP_BUNDLE_BINARY_DIR}/${dir}) + else() + set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${dir}) + set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${dir}) + set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/${dir}) + endif() endmacro() ####################################### -# Better Visual Studio solution # +# Better project generation # ####################################### +# Let us have proper tree-like structure in IDEs such as Visual Studio function(assign_source_group) foreach(_source IN ITEMS ${ARGN}) if(IS_ABSOLUTE "${_source}") @@ -34,10 +51,8 @@ function(assign_source_group) endforeach() endfunction(assign_source_group) -####################################### -# Setting folders for 3rd-party # -####################################### - +# Options to enable folders in CMake generated projects for Visual Studio, Xcode, etc +# Very useful to put 3rd-party libraries such as Minizip, GoogleTest and FuzzyLite in their own folders set_property(GLOBAL PROPERTY USE_FOLDERS TRUE) define_property( TARGET @@ -51,3 +66,16 @@ function(add_subdirectory_with_folder _folder_name _folder) add_subdirectory(${_folder} ${ARGN}) set_property(DIRECTORY "${_folder}" PROPERTY FOLDER "${_folder_name}") endfunction() + +# Macro for Xcode Projects generation +# Slightly outdated, but useful reference for all options available here: +# https://pewpewthespells.com/blog/buildsettings.html +# https://github.com/samdmarshall/Xcode-Build-Settings-Reference +if(${CMAKE_GENERATOR} MATCHES "Xcode") + + macro(set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE) + set_property(TARGET ${TARGET} PROPERTY + XCODE_ATTRIBUTE_${XCODE_PROPERTY} ${XCODE_VALUE}) + endmacro(set_xcode_property) + +endif(${CMAKE_GENERATOR} MATCHES "Xcode") diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index f36720db7..a3da4860a 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -67,10 +67,6 @@ set(CMAKE_AUTOMOC ON) # to always look for includes there: set(CMAKE_INCLUDE_CURRENT_DIR ON) -#### We need add -DQT_WIDGETS_LIB when using QtWidgets in Qt 5. -###add_definitions(${Qt5Widgets_DEFINITIONS}) -###add_definitions(${Qt5Network_DEFINITIONS}) - if("${CMAKE_VERSION}" VERSION_LESS 2.8.12) # Executables fail to build with Qt 5 in the default configuration # without -fPIE. We add that here. @@ -114,4 +110,3 @@ if(NOT APPLE) # Already inside bundle # copy whole directory install(DIRECTORY icons DESTINATION ${DATA_DIR}/launcher) endif() - diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index cc7b106b4..05d84cd34 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -288,9 +288,6 @@ set(lib_HEADERS assign_source_group(${lib_SRCS} ${lib_HEADERS}) add_library(vcmi SHARED ${lib_SRCS} ${lib_HEADERS}) -if(APPLE) - set_target_properties(vcmi PROPERTIES XCODE_ATTRIBUTE_LD_DYLIB_INSTALL_NAME "@rpath/libvcmi.dylib") -endif() set_target_properties(vcmi PROPERTIES COMPILE_DEFINITIONS "VCMI_DLL=1") target_link_libraries(vcmi ${MINIZIP_LIBRARIES} ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES} ${SYSTEM_LIBS}) diff --git a/lib/minizip/CMakeLists.txt b/lib/minizip/CMakeLists.txt index 83b3964a2..fa625af67 100644 --- a/lib/minizip/CMakeLists.txt +++ b/lib/minizip/CMakeLists.txt @@ -13,22 +13,9 @@ set(lib_SRCS add_library(minizip SHARED ${lib_SRCS}) if(MSVC) set_target_properties(minizip PROPERTIES COMPILE_DEFINITIONS "MINIZIP_DLL;ZLIB_DLL;ZLIB_INTERNAL") -elseif(APPLE) - set_target_properties(minizip PROPERTIES XCODE_ATTRIBUTE_LD_DYLIB_INSTALL_NAME "@rpath/libminizip.dylib") endif() -# multi-config builds (e.g. msvc) -foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) - string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIGUPPERCASE) - set_target_properties(minizip PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/lib) - set_target_properties(minizip PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/lib) - set_target_properties(minizip PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/${OUTPUTCONFIG}/lib) -endforeach() - -# generic no-config case (e.g. with mingw) -set_target_properties(minizip PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/lib) -set_target_properties(minizip PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/lib) -set_target_properties(minizip PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/build/lib) +vcmi_set_output_dir(minizip "") target_link_libraries(minizip ${ZLIB_LIBRARIES}) diff --git a/osx/Info.plist.in b/osx/Info.plist.in new file mode 100644 index 000000000..23e9cd06a --- /dev/null +++ b/osx/Info.plist.in @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + English + CFBundleExecutable + ${MACOSX_BUNDLE_EXECUTABLE_NAME} + CFBundleGetInfoString + ${MACOSX_BUNDLE_INFO_STRING} + CFBundleIconFile + ${MACOSX_BUNDLE_ICON_FILE} + CFBundleIdentifier + ${MACOSX_BUNDLE_GUI_IDENTIFIER} + CFBundleLongVersionString + ${MACOSX_BUNDLE_LONG_VERSION_STRING} + CFBundleName + ${MACOSX_BUNDLE_BUNDLE_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + ${MACOSX_BUNDLE_SHORT_VERSION_STRING} + CFBundleVersion + ${MACOSX_BUNDLE_BUNDLE_VERSION} + CSResourcesFileMapped + + NSHumanReadableCopyright + ${MACOSX_BUNDLE_COPYRIGHT} + NSPrincipalClass + NSApplication + NSHighResolutionCapable + True + + diff --git a/osx/download_dependencies.sh b/osx/download_dependencies.sh deleted file mode 100644 index baa8272fe..000000000 --- a/osx/download_dependencies.sh +++ /dev/null @@ -1,15 +0,0 @@ -if [ -f ../.osx_dependencies_installed ]; -then - echo "OS X prebuilt dependencies are already installled" -else - # Download and unpack OS X prebuilt dependencies - curl -o ../xcode-pack.zip -L http://download.vcmi.eu/xcode-pack.zip - unzip ../xcode-pack.zip -d ../ - rm -rf ../__MACOSX - - # Build vcmibuilder - xcodebuild -project osx/osx-vcmibuilder/vcmibuilder.xcodeproj/ -configuration Release - mv osx/osx-vcmibuilder/build/Release/vcmibuilder.app osx/vcmibuilder.app - - touch ../.osx_dependencies_installed -fi \ No newline at end of file diff --git a/osx/osx-vcmibuilder/innoextract b/osx/osx-vcmibuilder/innoextract deleted file mode 100755 index 60fdd7515..000000000 Binary files a/osx/osx-vcmibuilder/innoextract and /dev/null differ diff --git a/osx/osx-vcmibuilder/unshield b/osx/osx-vcmibuilder/unshield deleted file mode 100755 index 124ff27fc..000000000 Binary files a/osx/osx-vcmibuilder/unshield and /dev/null differ diff --git a/osx/osx-vcmibuilder/vcmibuilder.icns b/osx/osx-vcmibuilder/vcmibuilder.icns deleted file mode 100644 index a660e31c5..000000000 Binary files a/osx/osx-vcmibuilder/vcmibuilder.icns and /dev/null differ diff --git a/osx/osx-vcmibuilder/vcmibuilder.xcodeproj/project.pbxproj b/osx/osx-vcmibuilder/vcmibuilder.xcodeproj/project.pbxproj deleted file mode 100644 index adfa1df4d..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder.xcodeproj/project.pbxproj +++ /dev/null @@ -1,307 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - A8467DFF16760A4E00A9F095 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A8467DFE16760A4E00A9F095 /* Cocoa.framework */; }; - A8467E0916760A4E00A9F095 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A8467E0716760A4E00A9F095 /* InfoPlist.strings */; }; - A8467E0B16760A4E00A9F095 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A8467E0A16760A4E00A9F095 /* main.m */; }; - A8467E1216760A4E00A9F095 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A8467E1116760A4E00A9F095 /* AppDelegate.m */; }; - A8467E1516760A4E00A9F095 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = A8467E1316760A4E00A9F095 /* MainMenu.xib */; }; - A866001516760C5B00DBFB19 /* vcmibuilder.icns in Resources */ = {isa = PBXBuildFile; fileRef = A866001416760C5B00DBFB19 /* vcmibuilder.icns */; }; - A8F36836167632DC0009832A /* innoextract in Resources */ = {isa = PBXBuildFile; fileRef = A8F36834167632DC0009832A /* innoextract */; }; - A8F36837167632DC0009832A /* unshield in Resources */ = {isa = PBXBuildFile; fileRef = A8F36835167632DC0009832A /* unshield */; }; -/* End PBXBuildFile section */ - -/* Begin PBXFileReference section */ - A8467DFA16760A4E00A9F095 /* vcmibuilder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = vcmibuilder.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A8467DFE16760A4E00A9F095 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; - A8467E0116760A4E00A9F095 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; - A8467E0216760A4E00A9F095 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; - A8467E0316760A4E00A9F095 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - A8467E0616760A4E00A9F095 /* vcmibuilder-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "vcmibuilder-Info.plist"; sourceTree = ""; }; - A8467E0816760A4E00A9F095 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - A8467E0A16760A4E00A9F095 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - A8467E0C16760A4E00A9F095 /* vcmibuilder-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "vcmibuilder-Prefix.pch"; sourceTree = ""; }; - A8467E1016760A4E00A9F095 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - A8467E1116760A4E00A9F095 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - A8467E1416760A4E00A9F095 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainMenu.xib; sourceTree = ""; }; - A866001416760C5B00DBFB19 /* vcmibuilder.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = vcmibuilder.icns; sourceTree = ""; }; - A8F36834167632DC0009832A /* innoextract */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = innoextract; sourceTree = ""; }; - A8F36835167632DC0009832A /* unshield */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = unshield; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - A8467DF716760A4E00A9F095 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - A8467DFF16760A4E00A9F095 /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - A8467DEF16760A4E00A9F095 = { - isa = PBXGroup; - children = ( - A8F36834167632DC0009832A /* innoextract */, - A8F36835167632DC0009832A /* unshield */, - A866001416760C5B00DBFB19 /* vcmibuilder.icns */, - A8467E0416760A4E00A9F095 /* vcmibuilder */, - A8467DFD16760A4E00A9F095 /* Frameworks */, - A8467DFB16760A4E00A9F095 /* Products */, - ); - sourceTree = ""; - }; - A8467DFB16760A4E00A9F095 /* Products */ = { - isa = PBXGroup; - children = ( - A8467DFA16760A4E00A9F095 /* vcmibuilder.app */, - ); - name = Products; - sourceTree = ""; - }; - A8467DFD16760A4E00A9F095 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A8467DFE16760A4E00A9F095 /* Cocoa.framework */, - A8467E0016760A4E00A9F095 /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - A8467E0016760A4E00A9F095 /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - A8467E0116760A4E00A9F095 /* AppKit.framework */, - A8467E0216760A4E00A9F095 /* CoreData.framework */, - A8467E0316760A4E00A9F095 /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - A8467E0416760A4E00A9F095 /* vcmibuilder */ = { - isa = PBXGroup; - children = ( - A8467E1016760A4E00A9F095 /* AppDelegate.h */, - A8467E1116760A4E00A9F095 /* AppDelegate.m */, - A8467E1316760A4E00A9F095 /* MainMenu.xib */, - A8467E0516760A4E00A9F095 /* Supporting Files */, - ); - path = vcmibuilder; - sourceTree = ""; - }; - A8467E0516760A4E00A9F095 /* Supporting Files */ = { - isa = PBXGroup; - children = ( - A8467E0616760A4E00A9F095 /* vcmibuilder-Info.plist */, - A8467E0716760A4E00A9F095 /* InfoPlist.strings */, - A8467E0A16760A4E00A9F095 /* main.m */, - A8467E0C16760A4E00A9F095 /* vcmibuilder-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - A8467DF916760A4E00A9F095 /* vcmibuilder */ = { - isa = PBXNativeTarget; - buildConfigurationList = A8467E1816760A4E00A9F095 /* Build configuration list for PBXNativeTarget "vcmibuilder" */; - buildPhases = ( - A8467DF616760A4E00A9F095 /* Sources */, - A8467DF716760A4E00A9F095 /* Frameworks */, - A8467DF816760A4E00A9F095 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = vcmibuilder; - productName = vcmibuilder; - productReference = A8467DFA16760A4E00A9F095 /* vcmibuilder.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - A8467DF116760A4E00A9F095 /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0450; - ORGANIZATIONNAME = "Alexey Petruchik"; - }; - buildConfigurationList = A8467DF416760A4E00A9F095 /* Build configuration list for PBXProject "vcmibuilder" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - ); - mainGroup = A8467DEF16760A4E00A9F095; - productRefGroup = A8467DFB16760A4E00A9F095 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - A8467DF916760A4E00A9F095 /* vcmibuilder */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - A8467DF816760A4E00A9F095 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A8467E0916760A4E00A9F095 /* InfoPlist.strings in Resources */, - A8467E1516760A4E00A9F095 /* MainMenu.xib in Resources */, - A866001516760C5B00DBFB19 /* vcmibuilder.icns in Resources */, - A8F36836167632DC0009832A /* innoextract in Resources */, - A8F36837167632DC0009832A /* unshield in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - A8467DF616760A4E00A9F095 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A8467E0B16760A4E00A9F095 /* main.m in Sources */, - A8467E1216760A4E00A9F095 /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - A8467E0716760A4E00A9F095 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - A8467E0816760A4E00A9F095 /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - A8467E1316760A4E00A9F095 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - A8467E1416760A4E00A9F095 /* en */, - ); - name = MainMenu.xib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - A8467E1616760A4E00A9F095 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_INHIBIT_ALL_WARNINGS = NO; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - }; - name = Debug; - }; - A8467E1716760A4E00A9F095 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_INHIBIT_ALL_WARNINGS = NO; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.7; - SDKROOT = macosx; - }; - name = Release; - }; - A8467E1916760A4E00A9F095 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "vcmibuilder/vcmibuilder-Prefix.pch"; - INFOPLIST_FILE = "vcmibuilder/vcmibuilder-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - A8467E1A16760A4E00A9F095 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "vcmibuilder/vcmibuilder-Prefix.pch"; - INFOPLIST_FILE = "vcmibuilder/vcmibuilder-Info.plist"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - A8467DF416760A4E00A9F095 /* Build configuration list for PBXProject "vcmibuilder" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A8467E1616760A4E00A9F095 /* Debug */, - A8467E1716760A4E00A9F095 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - A8467E1816760A4E00A9F095 /* Build configuration list for PBXNativeTarget "vcmibuilder" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A8467E1916760A4E00A9F095 /* Debug */, - A8467E1A16760A4E00A9F095 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = A8467DF116760A4E00A9F095 /* Project object */; -} diff --git a/osx/osx-vcmibuilder/vcmibuilder/AppDelegate.h b/osx/osx-vcmibuilder/vcmibuilder/AppDelegate.h deleted file mode 100644 index ebfb447f4..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder/AppDelegate.h +++ /dev/null @@ -1,53 +0,0 @@ -#import - -@interface AppDelegate : NSObject -{ - NSString* outputDir; - NSString* tempDir; - NSString* dataDir; - NSString* currentArchiveName; - NSString* currentArchiveFilename; - - NSMutableArray* actions; - - int64_t bytesRecieved; - int64_t bytesExpected; - - BOOL installationCompleted; -} - -@property (strong) IBOutlet NSWindow *window; -@property (weak) IBOutlet NSButton *cd1Button; -@property (weak) IBOutlet NSTextField *cd1TextField; -@property (weak) IBOutlet NSButton *cd2Button; -@property (weak) IBOutlet NSTextField *cd2TextField; -@property (weak) IBOutlet NSProgressIndicator *progressIndicator; -@property (weak) IBOutlet NSTextField *progressLabel; -@property (weak) IBOutlet NSButton *installButton; -@property (weak) IBOutlet NSTextField *errorLabel; - -@property (strong) NSURLDownload* download; - -- (IBAction)selectCD1:(id)sender; -- (IBAction)selectCD2:(id)sender; -- (IBAction)install:(id)sender; - -- (void)selectFile:(NSArray*)fileTypes withTextField:(NSTextField*)textField; -- (void)showProgressText:(NSString*)text; -- (void)showErrorText:(NSString*)text; -- (void)showNotification:(NSString*)text; -- (void)nextAction; -- (int)runTask:(NSString*)executable withArgs:(NSArray*)args withWorkingDir:(NSString*)workingDir withPipe:(NSPipe*)pipe; - -- (void)downloadWogArchive; -- (void)unzipWogArchive; -- (void)downloadVcmiArchive; -- (void)unzipVcmiArchive; -- (void)extractGameData; -- (void)innoexctract; -- (NSString*)attachDiskImage:(NSString*)path; -- (void)unshield; -- (void)detachDiskImage:(NSString*)mountedPath; -- (void)extractionCompleted; - -@end diff --git a/osx/osx-vcmibuilder/vcmibuilder/AppDelegate.m b/osx/osx-vcmibuilder/vcmibuilder/AppDelegate.m deleted file mode 100644 index 31082c1ed..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder/AppDelegate.m +++ /dev/null @@ -1,395 +0,0 @@ -#import "AppDelegate.h" - -@implementation AppDelegate - -- (void)applicationDidFinishLaunching:(NSNotification*)aNotification -{ - installationCompleted = NO; - outputDir = [[[NSBundle mainBundle] bundlePath] stringByAppendingString:@"/../../Data"]; - tempDir = NSTemporaryDirectory(); - - // Output to Application Support - NSArray* appSupportDirs = [[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:NSUserDomainMask]; - outputDir = [[appSupportDirs[0] path] stringByAppendingString:@"/vcmi"]; -} - -- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication*)sender -{ - return YES; -} - -- (void)download:(NSURLDownload*)download didReceiveResponse:(NSURLResponse*)response -{ - self->bytesRecieved = 0; - self->bytesExpected = [response expectedContentLength]; -} - -- (void)download:(NSURLDownload*)download didReceiveDataOfLength:(NSUInteger)length -{ - self->bytesRecieved += length; - [self showProgressText:[NSString stringWithFormat:@"Downloading %@ archive: %3.1f Mb / %3.1f Mb", self->currentArchiveName, - self->bytesRecieved / 1024.0f / 1024.0f, self->bytesExpected / 1024.0f / 1024.0f]]; -} - -- (void)download:(NSURLDownload*)download decideDestinationWithSuggestedFilename:(NSString*)filename -{ - [download setDestination:[tempDir stringByAppendingString:currentArchiveFilename] allowOverwrite:YES]; -} - -- (void)downloadDidFinish:(NSURLDownload*)download -{ - [self showProgressText:[NSString stringWithFormat:@"Downloading %@ archive: completed", self->currentArchiveName]]; - [self nextAction]; -} - -- (void)download:(NSURLDownload*)download didFailWithError:(NSError*)error -{ - [self showProgressText:[NSString stringWithFormat:@"Downloading %@ archive: failed", self->currentArchiveName]]; - [self showErrorText:[error localizedDescription]]; -} - -- (void)nextAction -{ - dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ - if ([actions count] > 0) { - SEL sel = NSSelectorFromString(actions[0]); - [actions removeObjectAtIndex:0]; - @try { - [self performSelector:sel]; - } - @catch (NSException* e) { - [self showErrorText:[e name]]; - } - } - }); -} - -- (int)runTask:(NSString*)executable withArgs:(NSArray*)args withWorkingDir:(NSString*)workingDir withPipe:(NSPipe*)pipe -{ - if (![executable hasPrefix:@"/usr/"]) { - executable = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:executable]; - } - - NSTask* task = [[NSTask alloc] init]; - [task setLaunchPath:executable]; - if (workingDir != nil) { - [task setCurrentDirectoryPath:workingDir]; - } - if (pipe != nil) { - [task setStandardOutput:pipe]; - } - [task setArguments:args]; - - [task launch]; - [task waitUntilExit]; - - return [task terminationStatus]; -} - -- (void)validateAction -{ - // Before starting anything run validations - if (![[NSFileManager defaultManager] fileExistsAtPath:[self.cd1TextField stringValue]]) { - return [self showErrorText:@"Please select existing file"]; - } - - // Show progress controls - [self.progressIndicator setHidden:NO]; - [self.progressIndicator startAnimation:self]; - [self showProgressText:@"Installing VCMI..."]; - - [self nextAction]; -} - -- (void)downloadWogArchive -{ - // First of all we need to download WoG archive - // Downloading should be done on main thread because of callbacks - dispatch_async(dispatch_get_main_queue(), ^{ - self->currentArchiveName = @"WoG"; - self->currentArchiveFilename = @"/wog.zip"; - NSURL* url = [NSURL URLWithString:@"https://download.vcmi.eu/WoG/wog.zip"]; - self.download = [[NSURLDownload alloc] initWithRequest:[NSURLRequest requestWithURL:url] delegate:self]; - }); -} - -- (void)unzipWogArchive -{ - // Then we unzip downloaded WoG archive - [self showProgressText:@"Unzipping WoG archive"]; - if ([self runTask:@"/usr/bin/unzip" withArgs:@[@"-qo", [tempDir stringByAppendingString:currentArchiveFilename], @"-d", outputDir] withWorkingDir:nil withPipe:nil] != 0) { - return [self showErrorText:@"Failed to unzip WoG archive"]; - } - - [self nextAction]; -} - -- (void)downloadVcmiArchive -{ - // Than we need to download VCMI archive - // Downloading should be done on main thread because of callbacks - dispatch_async(dispatch_get_main_queue(), ^{ - self->currentArchiveName = @"VCMI"; - self->currentArchiveFilename = @"/core.zip"; - NSURL* url = [NSURL URLWithString:@"https://download.vcmi.eu/core.zip"]; - self.download = [[NSURLDownload alloc] initWithRequest:[NSURLRequest requestWithURL:url] delegate:self]; - }); -} - -- (void)unzipVcmiArchive -{ - // Then we unzip downloaded VCMI archive - [self showProgressText:@"Unzipping VCMI archive"]; - if ([self runTask:@"/usr/bin/unzip" withArgs:@[@"-qo", [tempDir stringByAppendingString:currentArchiveFilename], @"-d", outputDir, @"-x", @"*.json", @"*.txt", @"*.PAL"] withWorkingDir:nil withPipe:nil] != 0) { - return [self showErrorText:@"Failed to unzip VCMI archive"]; - } - - [self nextAction]; -} - -- (void)extractGameData -{ - // Then we extract game data from provided iso files using unshield or from innosetup exe - if ([[self.cd1TextField stringValue] hasSuffix:@".exe"]) { - [self innoexctract]; - } else { - [self unshield]; - } - - [self nextAction]; -} - -- (void)innoexctract -{ - // Extraction via innoextact is pretty straightforward - [self showProgressText:@"Extracting game data using innoextract..."]; - if ([self runTask:@"/innoextract" withArgs:@[[self.cd1TextField stringValue]] withWorkingDir:tempDir withPipe:nil] != 0) { - [self showErrorText:@"Failed to exctract game data using innoextract"]; - } - - dataDir = [tempDir stringByAppendingString:@"/app"]; -} - -- (NSString*)attachDiskImage:(NSString*)path -{ - [self showProgressText:[NSString stringWithFormat:@"Mounting image \"%@\"", path]]; - - // Run hdiutil to mount specified disk image - NSPipe* pipe = [NSPipe pipe]; - if ([self runTask:@"/usr/bin/hdiutil" withArgs:@[@"attach", path] withWorkingDir:nil withPipe:pipe] != 0) { - [NSException raise:[NSString stringWithFormat:@"Failed to mount \"%@\"", path] format:nil]; - } - - // Capture hdiutil output to get mounted disk image filesystem path - NSFileHandle* file = [pipe fileHandleForReading]; - NSString* output = [[NSString alloc] initWithData:[file readDataToEndOfFile] encoding:NSUTF8StringEncoding]; - - NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:@"(/Volumes/.*)$" options:0 error:nil]; - NSTextCheckingResult* match = [regex firstMatchInString:output options:0 range:NSMakeRange(0, [output length])]; - - return [output substringWithRange:[match range]]; -} - -- (void)detachDiskImage:(NSString*)mountedPath -{ - if ([self runTask:@"/usr/bin/hdiutil" withArgs:@[@"detach", mountedPath] withWorkingDir:nil withPipe:nil] != 0) { - [NSException raise:[NSString stringWithFormat:@"Failed to unmount \"%@\"", mountedPath] format:nil]; - } -} - -- (void)unshield -{ - // In case of iso files we should mount them first - // If CD2 is not specified use the same path as for CD1 - NSString* cd1 = [self attachDiskImage:[self.cd1TextField stringValue]]; - NSString* cd2 = [[self.cd2TextField stringValue] isEqualToString:@""] ? cd1 : [self attachDiskImage:[self.cd2TextField stringValue]]; - - // Extract - [self showProgressText:@"Extracting game data using unshield..."]; - - NSArray* knownLocations = @[ - @"/_setup/data1.cab", - @"/Autorun/Setup/data1.cab" - ]; - - bool success = false; - for (NSString* location in knownLocations) { - NSString* cabLocation = [cd1 stringByAppendingString:location]; - if ([[NSFileManager defaultManager] fileExistsAtPath:cabLocation]) { - int result = [self runTask:@"/unshield" withArgs:@[@"-d", tempDir, @"x", cabLocation] withWorkingDir:tempDir withPipe:nil]; - - if (result == 0) { - success = true; - break; - } - } - } - - if (!success) { - return [self showErrorText:@"Failed to extract game data using unshield"]; - } - - NSArray* knownDataDirs = @[ - @"/Heroes3", - @"/Program_Files", - @"/Data", - ]; - - success = false; - for (NSString* knownDir in knownDataDirs) { - dataDir = [tempDir stringByAppendingString:knownDir]; - if ([[NSFileManager defaultManager] fileExistsAtPath:dataDir]) { - success = true; - break; - } - } - - if (!success) { - return [self showErrorText:@"Failed to extract game data using unshield"]; - } - - // Unmount CD1. Unmount CD2 if needed - [self detachDiskImage:cd1]; - if (![cd1 isEqualToString:cd2]) { - [self detachDiskImage:cd2]; - } -} - -- (void)extractionCompleted -{ - // After game data is extracted we should move it to destination place - [self showProgressText:@"Moving items into place"]; - - NSFileManager* fileManager = [NSFileManager defaultManager]; - - [fileManager moveItemAtPath:[dataDir stringByAppendingString:@"/Data"] toPath:[outputDir stringByAppendingString:@"/Data"] error:nil]; - [fileManager moveItemAtPath:[dataDir stringByAppendingString:@"/Maps"] toPath:[outputDir stringByAppendingString:@"/Maps"] error:nil]; - - if ([fileManager fileExistsAtPath:[dataDir stringByAppendingString:@"/MP3"] isDirectory:nil]) { - [fileManager moveItemAtPath:[dataDir stringByAppendingString:@"/MP3"] toPath:[outputDir stringByAppendingString:@"/Mp3"] error:nil]; - } else { - [fileManager moveItemAtPath:[dataDir stringByAppendingString:@"/Mp3"] toPath:[outputDir stringByAppendingString:@"/Mp3"] error:nil]; - } - - // After everythin is complete we create marker file. VCMI will look for this file to exists on startup and - // will run this setup otherwise - system([[NSString stringWithFormat:@"touch \"%@/game_data_prepared\"", outputDir] UTF8String]); - - [self showProgressText:@"Installation complete"]; - [self.installButton setTitle:@"Run VCMI"]; - [self.progressIndicator stopAnimation:self]; - - // Notify user that installation completed - [self showNotification:@"Installation completed"]; - - // Hide all progress related controls - [self.progressIndicator setHidden:YES]; - [self.progressIndicator stopAnimation:self]; - [self.progressLabel setHidden:YES]; - - [self.installButton setEnabled:YES]; - installationCompleted = YES; -} - -- (void)selectFile:(NSArray*)fileTypes withTextField:(NSTextField*)textField -{ - NSOpenPanel* openPanel = [NSOpenPanel openPanel]; - [openPanel setCanChooseFiles:YES]; - [openPanel setAllowedFileTypes:fileTypes]; - [openPanel setAllowsMultipleSelection:NO]; - - if ([openPanel runModal] == NSOKButton) { - NSString* path = [[openPanel URL] path]; - [textField setStringValue:path]; - } -} - -- (IBAction)selectCD1:(id)sender -{ - [self selectFile:@[@"iso", @"exe"] withTextField:self.cd1TextField]; -} - -- (IBAction)selectCD2:(id)sender -{ - [self selectFile:@[@"iso"] withTextField:self.cd2TextField]; -} - -- (IBAction)install:(id)sender -{ - if (installationCompleted) { - // Run vcmi - system([[NSString stringWithFormat:@"open %@/../../..", [[NSBundle mainBundle] bundlePath]] UTF8String]); - [NSApp terminate: nil]; - } else { - // Run installation - [self.cd1Button setEnabled:NO]; - [self.cd2Button setEnabled:NO]; - [self.installButton setEnabled:NO]; - - actions = [NSMutableArray arrayWithObjects: - @"validateAction", - @"downloadWogArchive", - @"unzipWogArchive", - @"downloadVcmiArchive", - @"unzipVcmiArchive", - @"extractGameData", - @"extractionCompleted", - nil - ]; - - [self nextAction]; - } -} - -- (void)showNotification:(NSString*)text -{ - // Notification Center is supported only on OS X 10.8 and newer - NSUserNotification* notification = [[NSUserNotification alloc] init]; - if (notification != nil) { - notification.title = @"VCMI"; - notification.informativeText = text; - notification.deliveryDate = [NSDate dateWithTimeInterval:0 sinceDate:[NSDate date]]; - notification.soundName = NSUserNotificationDefaultSoundName; - - [[NSUserNotificationCenter defaultUserNotificationCenter] scheduleNotification:notification]; - } else { - // On older OS X version force dock icon to jump - [NSApp requestUserAttention:NSCriticalRequest]; - } -} - -- (void)showProgressText:(NSString*)text -{ - // All GUI updates should be done on main thread - dispatch_async(dispatch_get_main_queue(), ^{ - [self.progressLabel setHidden:NO]; - [self.progressLabel setStringValue:text]; - }); -} - -- (void)showErrorText:(NSString*)text -{ - // All GUI updates should be done on main thread - dispatch_async(dispatch_get_main_queue(), ^{ - [self showNotification:@"Installation failed"]; - - // Show error alert - NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText:@"Error"]; - [alert setInformativeText:text]; - [alert beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:nil contextInfo:nil]; - - // Enable select file buttons again - [self.cd1Button setEnabled:YES]; - [self.cd2Button setEnabled:YES]; - [self.installButton setEnabled:YES]; - - // Hide all progress related controls - [self.progressIndicator setHidden:YES]; - [self.progressIndicator stopAnimation:self]; - - [self.progressLabel setHidden:YES]; - }); -} - -@end diff --git a/osx/osx-vcmibuilder/vcmibuilder/en.lproj/InfoPlist.strings b/osx/osx-vcmibuilder/vcmibuilder/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/osx/osx-vcmibuilder/vcmibuilder/en.lproj/MainMenu.xib b/osx/osx-vcmibuilder/vcmibuilder/en.lproj/MainMenu.xib deleted file mode 100644 index da95fd9ce..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder/en.lproj/MainMenu.xib +++ /dev/null @@ -1,772 +0,0 @@ - - - - 1070 - 11G63 - 2844 - 1138.51 - 569.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 2844 - - - NSButton - NSButtonCell - NSCustomObject - NSMenu - NSMenuItem - NSProgressIndicator - NSTextField - NSTextFieldCell - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - NSApplication - - - FirstResponder - - - NSApplication - - - AMainMenu - - - - vcmibuilder - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - submenuAction: - - vcmibuilder - - - - About vcmibuilder - - 2147483647 - - - - - - YES - YES - - - 1048576 - 2147483647 - - - - - - Quit vcmibuilder - q - 1048576 - 2147483647 - - - - - _NSAppleMenu - - - - _NSMainMenu - - - 7 - 2 - {{335, 390}, {572, 194}} - 1954021376 - VCMI Install - NSWindow - - - {572, 207} - - - 256 - - - - 12 - {{20, 83}, {483, 22}} - - - - _NS:9 - YES - - -2074083263 - 272631872 - - - LucidaGrande - 13 - 1044 - - CD1 ISO disk image or installer executable - _NS:9 - - YES - - 6 - System - textBackgroundColor - - 3 - MQA - - - - 6 - System - textColor - - 3 - MAA - - - - - - - 12 - {{20, 51}, {483, 22}} - - - - _NS:9 - YES - - -2074083263 - 272631872 - - - CD2 ISO disk image (optional) - _NS:9 - - YES - - - - - - - 268 - {{17, 140}, {538, 34}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - In order to complete VCMI installation you need original Heroes III: Shadow of Death
game data. Please select ISO disk image or installer executable and press Install. - - _NS:1535 - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 6 - System - controlTextColor - - - - - - - 268 - {{505, 76}, {53, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - ... - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - - - - 268 - {{505, 44}, {53, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - ... - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - - - - 268 - {{461, 12}, {97, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - Install - - _NS:9 - - -2038284288 - 129 - - - 200 - 25 - - - - - -2147483380 - {{20, 22}, {16, 16}} - - - - _NS:945 - 20746 - 100 - - - - -2147483380 - {{41, 22}, {419, 17}} - - - - _NS:1535 - YES - - 67108928 - 272631808 - Label - - _NS:1535 - - - - - - - {572, 194} - - - - - {{0, 0}, {1680, 1028}} - {572, 229} - {10000000000000, 10000000000000} - YES - - - AppDelegate - - - NSFontManager - - - - - - - terminate: - - - - 449 - - - - orderFrontStandardAboutPanel: - - - - 142 - - - - delegate - - - - 495 - - - - window - - - - 532 - - - - cd1Button - - - - 615 - - - - cd2Button - - - - 616 - - - - cd1TextField - - - - 617 - - - - cd2TextField - - - - 618 - - - - selectCD1: - - - - 619 - - - - selectCD2: - - - - 620 - - - - progressLabel - - - - 622 - - - - progressIndicator - - - - 623 - - - - installButton - - - - 624 - - - - install: - - - - 625 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 29 - - - - - - - - 56 - - - - - - - - 57 - - - - - - - - - - 58 - - - - - 136 - - - - - 149 - - - - - 371 - - - - - - - - 372 - - - - - - - - - - - - - - - 420 - - - - - 494 - - - - - 536 - - - - - - - - 537 - - - - - 541 - - - - - - - - 542 - - - - - 549 - - - - - - - - 550 - - - - - 562 - - - - - - - - 563 - - - - - 569 - - - - - - - - 570 - - - - - 581 - - - - - - - - 582 - - - - - 587 - - - - - 593 - - - - - - - - 594 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - {{380, 496}, {480, 360}} - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 730 - - - - - AppDelegate - NSObject - - id - id - id - - - - install: - id - - - selectCD1: - id - - - selectCD2: - id - - - - NSButton - NSTextField - NSButton - NSTextField - NSTextField - NSButton - NSProgressIndicator - NSTextField - NSWindow - - - - cd1Button - NSButton - - - cd1TextField - NSTextField - - - cd2Button - NSButton - - - cd2TextField - NSTextField - - - errorLabel - NSTextField - - - installButton - NSButton - - - progressIndicator - NSProgressIndicator - - - progressLabel - NSTextField - - - window - NSWindow - - - - IBProjectSource - ./Classes/AppDelegate.h - - - - - 0 - IBCocoaFramework - YES - 3 - - {11, 11} - {10, 3} - - - diff --git a/osx/osx-vcmibuilder/vcmibuilder/main.m b/osx/osx-vcmibuilder/vcmibuilder/main.m deleted file mode 100644 index 04d99dab9..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder/main.m +++ /dev/null @@ -1,6 +0,0 @@ -#import - -int main(int argc, char *argv[]) -{ - return NSApplicationMain(argc, (const char **)argv); -} diff --git a/osx/osx-vcmibuilder/vcmibuilder/vcmibuilder-Info.plist b/osx/osx-vcmibuilder/vcmibuilder/vcmibuilder-Info.plist deleted file mode 100644 index 0d2eff163..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder/vcmibuilder-Info.plist +++ /dev/null @@ -1,34 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - vcmibuilder - CFBundleIdentifier - com.vcmi.${PRODUCT_NAME:rfc1034identifier} - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSMinimumSystemVersion - ${MACOSX_DEPLOYMENT_TARGET} - NSHumanReadableCopyright - Copyright © 2012 Alexey Petruchik. All rights reserved. - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/osx/osx-vcmibuilder/vcmibuilder/vcmibuilder-Prefix.pch b/osx/osx-vcmibuilder/vcmibuilder/vcmibuilder-Prefix.pch deleted file mode 100644 index 63c1a5e8b..000000000 --- a/osx/osx-vcmibuilder/vcmibuilder/vcmibuilder-Prefix.pch +++ /dev/null @@ -1,7 +0,0 @@ -// -// Prefix header for all source files of the 'vcmibuilder' target in the 'vcmibuilder' project -// - -#ifdef __OBJC__ - #import -#endif diff --git a/osx/package.sh b/osx/package.sh deleted file mode 100644 index a3d0547dd..000000000 --- a/osx/package.sh +++ /dev/null @@ -1,15 +0,0 @@ -# Clean previous build -rm -rf build -rm -rf bin -rm -rf osx/osx-vcmibuilder/build -rm -rf osx/vcmibuilder.app - -# Build vcmibuilder -xcodebuild -project osx/osx-vcmibuilder/vcmibuilder.xcodeproj/ -configuration Release -mv osx/osx-vcmibuilder/build/Release/vcmibuilder.app osx/vcmibuilder.app - -# Build vcmi -mkdir build -cd build -cmake -G Xcode .. -DENABLE_LAUNCHER=OFF -xcodebuild -project vcmi.xcodeproj/ -configuration Release -target package \ No newline at end of file diff --git a/osx/sparkle_appcast.xml b/osx/sparkle_appcast.xml deleted file mode 100644 index 8ffd00a7d..000000000 --- a/osx/sparkle_appcast.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - VCMI App Changelog - https://vcmi.eu/sparkle_appcast.xml - Most recent changes with links to updates. - en - - Version 0.94 - Version 0.94 - Wed, 09 Jan 2006 19:20:11 +0000 - http://vcmi.eu/sparkle_release_notes.html - - - - Version 0.93 - Version 0.93 - Wed, 09 Jan 2006 19:20:11 +0000 - http://vcmi.eu/sparkle_release_notes.html - - - - Version 0.92 - Version 0.92 - Wed, 09 Jan 2006 19:20:11 +0000 - http://vcmi.eu/sparkle_release_notes.html - - - - diff --git a/osx/sparkle_release_notes.html b/osx/sparkle_release_notes.html deleted file mode 100644 index 35e989fc4..000000000 --- a/osx/sparkle_release_notes.html +++ /dev/null @@ -1,171 +0,0 @@ - - -

0.94

- GENERAL -
    -
  • Filesystem now supports zip archives. They can be loaded similarly to other archives in filesystem.json. Mods can use Content.zip instead of Content/ directory.
  • -
  • fixed "get txt" console command
  • -
  • command "extract" to extract file by name
  • -
  • command "def2bmp" to convert def into set of frames.
  • -
  • fixed crash related to cammander's SPELL_AFTER_ATTACK spell id not initialized properly (text id was resolved on copy of bonus)
  • -
  • fixed duels, added no-GUI mode for automatic AI testing
  • -
  • Sir Mullich is available at the start of the game
  • -
  • Upgrade cost will never be negative.
  • -
  • support for Chinese fonts (GBK 2-byte encoding)
  • -
- ADVENTURE MAP -
    -
  • if Quick Combat option is turned on, battles will be resolved by AI
  • -
  • first hero is awakened on new turn
  • -
  • fixed 3000 gems reward in shipwreck
  • -
- BATTLES -
    -
  • autofight implemented
  • -
  • most of the animations is time-based
  • -
  • simplified postioning of units in battle, should fix remaining issues with unit positioning
  • -
  • synchronized attack/defence animation
  • -
  • spell animation speed uses game settings
  • -
  • fixed disrupting ray duration
  • -
  • added logging domain for battle animations
  • -
  • Fixed crashes on Land Mines / Fire Wall casting.
  • -
  • UI will be correctly greyed-out during opponent turn
  • -
  • fixed remaining issues with blit order
  • -
  • Catapult attacks should be identical to H3. Catapult may miss and attack another part of wall instead (this is how it works in H3)
  • -
  • Fixed Remove Obstacle.
  • -
  • defeating hero will yield 500 XP
  • -
  • Added lots of missing spell immunities from Strategija
  • -
  • Added stone gaze immunity for Troglodytes (did you know about it?)
  • -
  • damage done by turrets is properly increased by built buldings
  • -
  • Wyverns will cast Poison instead of Stone Gaze.
  • -
- TOWN -
    -
  • Fixed issue that allowed to build multiple boats in town.
  • -
  • fix for lookout tower
  • -
-
- -

0.93

- GENERAL -
    -
  • Support for SoD-only installations, WoG becomes optional addition
  • -
  • New logging framework
  • -
  • Negative luck support, disabled by default
  • -
  • Several new icons for creature abilities (Fire Shield, Non-living, Magic Mirror, Spell-like Attack)
  • -
  • Fixed stack artifact (and related buttons) not displaying in creature window.
  • -
  • Fixed crash at month of double population.
  • -
- MODS -
    -
  • See http://wiki.vcmi.eu/index.php?title=Modding_changelog#0.92_-.3E_0.93 for compatibility info.
  • -
  • Improved json validation. Now it support most of features from latest json schema draft.
  • -
  • Icons use path to icon instead of image indexes.
  • -
  • It is possible to edit data of another mod or H3 data via mods.
  • -
  • Mods can access only ID's from dependenies, virtual "core" mod and itself (optional for some mods compatibility)
  • -
  • Removed no longer needed field "projectile spins"
  • -
  • Heroes: split heroes.json in manner similar to creatures\factions; string ID's for H3 heroes; h3 hero classes and artifacts can be modified via json.
  • -
- BATTLES -
    -
  • Fixed Death Stare of Commanders
  • -
  • Projectile blitting should be closer to original H3. But still not perfect.
  • -
  • Fixed missing Mirth effects
  • -
  • Stack affected by Berserk should not try to attack itself
  • -
  • Fixed several cases of incorrect positioning of creatures in battles
  • -
  • Fixed abilities of Efreet.
  • -
  • Fixed broken again palette in some battle backgrounds
  • -
- TOWN -
    -
  • VCMI will not crash if building selection area is smaller than def
  • -
  • Detection of transparency on selection area is closer to H3
  • -
  • Improved handling buildings with mode "auto": -
      -
    • they will be properly processed (new creatures will be added if dwelling, spells learned if mage guild, and so on)
    • -
    • transitive dependencies are handled (A makes B build, and B makes C and D)
    • -
    -
  • -
- SOUND -
    -
  • Added missing WoG creature sounds (from Kuririn).
  • -
  • The Windows package comes with DLLs needed to play .ogg files
  • -
  • (linux) convertMP3 option for vcmibuilder for systems where SDL_Mixer can't play mp3's
  • -
  • some missing sounds for battle effects
  • -
- ARTIFACTS -
    -
  • Several fixes to combined artifacts added via mods.
  • -
  • Fixed Spellbinder's Hat giving level 1 spells instead of 5.
  • -
  • Fixed incorrect components of Cornucopia.
  • -
  • Cheat code with grant all artifacts, including the ones added by mods
  • -
-
- -

0.92

- GENERAL -
    -
  • hero crossover between missions in campaigns
  • -
  • introduction before missions in campaigns
  • -
- MODS -
    -
  • Added CREATURE_SPELL_POWER for commanders
  • -
  • Added spell modifiers to various spells: Hypnotize (Astral), Firewall (Luna), Landmine
  • -
  • Fixed ENEMY_DEFENCE_REDUCTION, GENERAL_ATTACK_REDUCTION
  • -
  • Extended usefulness of ONLY_DISTANCE_FIGHT, ONLY_MELEE_FIGHT ranges
  • -
  • Double growth creatures are configurable now
  • -
  • Drain Life now has % effect depending on bonus value
  • -
  • Stack can use more than 2 attacks. Additional attacks can now be separated as "ONLY_MELEE_FIGHT and "ONLY_DISTANCE_FIGHT".
  • -
  • Moat damage configurable
  • -
  • More config options for spells: -
      -
    • mind immunity handled by config
    • -
    • direct damage immunity handled by config
    • -
    • immunity icon configurable
    • -
    • removed mind_spell flag
    • -
    -
  • -
  • creature config use string ids now.
  • -
  • support for string subtype id in short bonus format
  • -
  • primary skill identifiers for bonuses
  • -
-

0.91

- GENERAL -
    -
  • VCMI build on OS X is now supported
  • -
  • Completely removed autotools
  • -
  • Added RMG interace and ability to generate simplest working maps
  • -
  • Added loading screen
  • -
- MODS -
    -
  • Simplified mod structure. Mods from 0.9 will not be compatible.
  • -
      -
    • Mods can be turned on and off in config/modSettings.json file
    • -
    • Support for new factions, including:
    • -
    -
  • New towns
  • -
  • New hero classes
  • -
  • New heroes
  • -
  • New town-related external dwellings
  • -
      -
    • Support for new artifact, including combined, commander and stack artifacts
    • -
    • Extended configuration options
    • -
    -
  • All game objects are referenced by string identifiers
  • -
  • Subtype resolution for bonuses
  • -
- BATTLES -
    -
  • Support for "enchanted" WoG ability
  • -
- ADVENTURE AI -
    -
  • AI will try to use Subterranean Gate, Redwood Observatory and Cartographer for exploration
  • -
  • Improved exploration algorithm
  • -
  • AI will prioritize dwellings and mines when there are no opponents visible
  • -
- - \ No newline at end of file diff --git a/client/vcmi.icns b/osx/vcmi.icns similarity index 100% rename from client/vcmi.icns rename to osx/vcmi.icns diff --git a/osx/vcmi_dsa_public.pem b/osx/vcmi_dsa_public.pem deleted file mode 100644 index c1092aff0..000000000 --- a/osx/vcmi_dsa_public.pem +++ /dev/null @@ -1,12 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIIBuDCCASwGByqGSM44BAEwggEfAoGBAPBRGeziJsHw0F7CM9JmSOiIOBmJ4hYl -dbmdU1iJR7XHX5lZIUOl323cCANhzOogVAzkvEVhFedA6H4iO6VRt7nTJSgLA4hO -gMqMJGKp4bDQIwupUK5xQUUcaXumT03Aj8jzzibW9YjNB8NeuSSMfMi5KGZw5pkf -nSvZM0TUVVX/AhUA74nJWqRFwUPc6aPGCOgfsRzPYMsCgYEApYMP5/tIr4yrqHVM -xHLj1s+Y/Zgs3+kRqudTLgYE20Br3Tmmi2ejM9phrEHn5mv6Ss/FYyWqKxdtzCEN -PjRA/JkKMpoX+sy/S3OE/NrrnikVjCRvgOJcM6FPt9iaENRqjz20dZMIq42vqeE9 -K5u1XJ/YtiwU2b1fX0nNtREhjUwDgYUAAoGBAJT2cMQ2qTGecdNIjEByCFMZpWg0 -nV+jKgpthNUahwxbUN3ru9nrWMUNv1pBiS3pxqFV6ec7qozKnedwyTx+IRJXTN4T -IrxYsgPJDHhkBeoVVAkacihkLUtwPSphorZWF4OMFmrlc5WsmYt2lEahR2TZGQrW -5GBNP18/S/nDBe7j ------END PUBLIC KEY----- diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 71d48f070..517553876 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -39,7 +39,6 @@ endif() vcmi_set_output_dir(vcmiserver "") set_target_properties(vcmiserver PROPERTIES ${PCH_PROPERTIES}) -set_target_properties(vcmiserver PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @executable_path/") cotire(vcmiserver) if(NOT APPLE) # Already inside vcmiclient bundle diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 729104cd1..e12a32011 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -38,7 +38,7 @@ set(mock_HEADERS mock/mock_UnitHealthInfo.h ) -add_subdirectory(googletest EXCLUDE_FROM_ALL) +add_subdirectory_with_folder("3rdparty" googletest EXCLUDE_FROM_ALL) add_executable(vcmitest ${test_SRCS} ${test_HEADERS} ${mock_HEADERS} ${GTestSrc}/src/gtest-all.cc ${GMockSrc}/src/gmock-all.cc) target_link_libraries(vcmitest vcmi ${RT_LIB} ${DL_LIB})