diff --git a/.gitignore b/.gitignore index 0c3c42fd4a9..49d05ab2d45 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ assets/* /Fonts /Textures /JSVendor +/Videos # ue4 stuff diff --git a/CMakeLists.txt b/CMakeLists.txt index c27413f444e..463fe390fec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,6 @@ endif() option(USE_BREAKPAD "For enabling breakpad crash handling, set off for local debugging" OFF) option(COPY_BOOST_TO_PACKAGE "If on copies all boost libraries to package" ON) -option(STRIP_SYMBOLS_ON_INSTALL "For stripping debug symbols on install" ON) ########################### @@ -70,8 +69,6 @@ include(LeviathanFindLibraries) include(LeviathanUtility) # Leviathan Required settings -set(CMAKE_INSTALL_PREFIX "./Install" CACHE FILEPATH "Install path") - DefinePreprocessorMacro(USE_BREAKPAD LEVIATHAN_USING_BREAKPAD) include(LeviathanDefaultFileCopy) @@ -88,8 +85,10 @@ endif() if(WIN32) file(COPY "${LEVIATHAN_SRC}/build/bin/Engine.dll" DESTINATION "${CMAKE_BINARY_DIR}/bin") file(COPY "${LEVIATHAN_SRC}/build/bin/Engine.pdb" DESTINATION "${CMAKE_BINARY_DIR}/bin") + install(FILES "${LEVIATHAN_SRC}/build/bin/Engine.dll" DESTINATION "bin") else() file(COPY "${LEVIATHAN_SRC}/build/bin/libEngine.so" DESTINATION "${CMAKE_BINARY_DIR}/bin") + install(FILES "${LEVIATHAN_SRC}/build/bin/libEngine.so" DESTINATION "bin") endif() # Link own bin directory @@ -103,8 +102,9 @@ set(PROGRAM_VERSION_STABLE 0) set(PROGRAM_VERSION_MAJOR 4) set(PROGRAM_VERSION_MINOR 0) set(PROGRAM_VERSION_PATCH 0) +set(PROGRAM_VERSION_SUFFIX "-rc1") -set(PROGRAM_VERSION_STR ${PROGRAM_VERSION_STABLE}.${PROGRAM_VERSION_MAJOR}.${PROGRAM_VERSION_MINOR}.${PROGRAM_VERSION_PATCH}) +set(PROGRAM_VERSION_STR ${PROGRAM_VERSION_STABLE}.${PROGRAM_VERSION_MAJOR}.${PROGRAM_VERSION_MINOR}.${PROGRAM_VERSION_PATCH}${PROGRAM_VERSION_SUFFIX}) set(PROGRAM_VERSION ${PROGRAM_VERSION_STABLE}.${PROGRAM_VERSION_MAJOR}${PROGRAM_VERSION_MINOR}${PROGRAM_VERSION_PATCH}) set(PROGRAM_VERSIONS "\"${PROGRAM_VERSION_STR}\"") @@ -143,42 +143,39 @@ set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY # Copy script files to the bin folder file(GLOB THRIVE_SCRIPTS "scripts/*") file(COPY ${THRIVE_SCRIPTS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Scripts") +InstallContentsOfFolder("scripts" "bin/Data/Scripts") -# Copy javascript libraries -file(GLOB THRIVE_VENDOR_SCRIPTS "assets/jsvendor/*") -file(COPY ${THRIVE_VENDOR_SCRIPTS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/jsvendor") +# Right now we only use what the engine needs +# # Copy javascript libraries +# file(GLOB THRIVE_VENDOR_SCRIPTS "assets/jsvendor/*") +# file(COPY ${THRIVE_VENDOR_SCRIPTS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/jsvendor") # Copy other data assets -file(GLOB THRIVE_LOOKNFEEL "assets/gui/looknfeel/*") -file(COPY ${THRIVE_LOOKNFEEL} DESTINATION - "${PROJECT_BINARY_DIR}/bin/Data/Scripts/gui/looknfeel") - -file(GLOB THRIVE_ANIMATIONS "assets/gui/animations/*") -file(COPY ${THRIVE_ANIMATIONS} DESTINATION - "${PROJECT_BINARY_DIR}/bin/Data/Scripts/gui/animations") - file(GLOB THRIVE_TEXTURES "assets/textures/*") file(COPY ${THRIVE_TEXTURES} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Textures/") +InstallContentsOfFolder("assets/textures" "bin/Data/Textures") -file(GLOB THRIVE_GUI_TEXTURES "assets/gui/imagesets/*") -file(COPY ${THRIVE_GUI_TEXTURES} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Textures/gui/") file(GLOB THRIVE_FONTS "assets/fonts/*") file(COPY ${THRIVE_FONTS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Fonts/") +InstallContentsOfFolder("assets/fonts" "bin/Data/Fonts") file(GLOB THRIVE_MATERIALS "assets/materials/*") file(COPY ${THRIVE_MATERIALS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Materials/") +InstallContentsOfFolder("assets/materials" "bin/Data/Materials") file(GLOB THRIVE_MODELS "assets/models/*") file(COPY ${THRIVE_MODELS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Models/") +InstallContentsOfFolder("assets/models" "bin/Data/Models") file(GLOB THRIVE_SOUNDS "assets/sounds/*") file(COPY ${THRIVE_SOUNDS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Sound/") +InstallContentsOfFolder("assets/sounds" "bin/Data/Sound") file(GLOB THRIVE_VIDEOS "assets/videos/*") file(COPY ${THRIVE_VIDEOS} DESTINATION "${PROJECT_BINARY_DIR}/bin/Data/Videos/") - +InstallContentsOfFolder("assets/videos" "bin/Data/Videos") file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/bin/Data/Screenshots") file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/bin/Data/Cache") @@ -240,42 +237,3 @@ if(DOXYGEN_FOUND) SOURCES "${DOXYGEN_CONFIG_FILE}" ) endif() - -############################################################################### -# Linux package -############################################################################### - -if(UNIX) - # TODO: fix this, also add windows support - - set(LINUX_LIBRARIES "${cAudio_LIBRARIES}" "${BULLET_LIBRARIES}" - "${SWRESAMPLE_LIBRARIES}" "${OgreFFMPEG_LIBRARIES}" "${FFMPEG_LIBRARIES}" - "${Boost_LIBRARIES}" "${OGRE_LIBRARIES}" "${OIS_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}" - "${BULLET_LIBRARIES}" "${CEGUI_LIBRARY}" "${TINYXML_LIBRARIES}" "${OpenAL_LIBRARIES}") - - # Linux setup - configure_file("${CMAKE_SOURCE_DIR}/cpack/CMakeLibraryList.xml.in" - "${CMAKE_CURRENT_BINARY_DIR}/CMakeLibraryList.xml" @ONLY - ) - - if(LUA_CHECKS) - - # creating debug releases is bad - add_custom_target(linuxrelease - # Please don't touch this really complex command output format - COMMAND "ruby" "-e" \"puts \\\"\\033[31m\\\"\; puts 'ERROR: LUA_CHECKS is on. release build is disabled. Please run \\'cmake .. -DLUA_CHECKS=OFF\\' and try again'\; puts \\\"\\033[0m\\\"\; exit(3) \" - ) - - else() - - add_custom_target(linuxrelease - COMMAND "${CMAKE_SOURCE_DIR}/cpack/PackageProject.rb" "${CMAKE_CURRENT_BINARY_DIR}" - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cpack" - DEPENDS ThriveLib doc - ) - # The name of the Thrive target somehow breaks in the above command - add_dependencies(linuxrelease Thrive) - - endif() - -endif() diff --git a/MakeRelease.rb b/MakeRelease.rb new file mode 100755 index 00000000000..1809f67dc17 --- /dev/null +++ b/MakeRelease.rb @@ -0,0 +1,51 @@ +#!/usr/bin/env ruby +# Creates release packages for Thrive. +# You MUST compile thrive in RelWithDebInfo with release cmake options before running this +require 'os' + +if OS.mac? + onError "unsupported platform" +end + +require_relative 'RubySetupSystem/ReleaseCreator' + + +# Customize options for Thrive +VERSION = File.read("src/thrive_version.h").match(/Thrive_VERSIONS\s+"(.*)"/).captures[0] + +if !VERSION + onError "Failed to detect version from 'thrive_version.h'" +end + +# Create a readme file +readmeText = "This is Thrive release #{VERSION} for " + +if OS.windows? + readmeText += "Windows\n\n" + + readmeText += "To run the game run 'bin/Thrive.exe'." +elsif OS.linux? + readmeText += "Linux\n\n" + + readmeText += "To run the game run 'bin/Thrive' executable." +else + onError "unknown platform" +end + +readmeText += "\n\nVisit http://revolutionarygamesstudio.com/ for more info" + + +File.write File.join(CurrentDir, "README.TXT"), readmeText + + +props = ReleaseProperties.new("Thrive-#{VERSION}") + +props.addExecutable "Thrive" +props.addExecutable "ThriveServer" + +props.addFile File.join ProjectDir, "gpl.txt" +props.addFile File.join ProjectDir, "LICENSE.txt" +props.addFile File.join CurrentDir, "README.TXT" + +# Run the packaging +runMakeRelease(props) diff --git a/RubySetupSystem b/RubySetupSystem index 09b9af5e701..0136afcd9ff 160000 --- a/RubySetupSystem +++ b/RubySetupSystem @@ -1 +1 @@ -Subproject commit 09b9af5e70155d71ae02f1a19d1b078d92de052f +Subproject commit 0136afcd9ffd618d15f3e629f69879526e321501 diff --git a/SetupThrive.rb b/SetupThrive.rb index b2334148763..2009e283d9a 100755 --- a/SetupThrive.rb +++ b/SetupThrive.rb @@ -78,7 +78,7 @@ def parseExtraArgs leviathan = Leviathan.new( # Use this if you always want the latest commit # version: "develop", - version: "c2fbfa2775ba0605e1abf871eab7e15404f50883", + version: "a71bdfda4095e50f272d53554e1290aaba6d7f1a", # Doesn't actually work, but leviathan doesn't install with sudo by # default, or install at all for that matter noInstallSudo: true diff --git a/cpack/CMakeLibraryList.xml.in b/cpack/CMakeLibraryList.xml.in deleted file mode 100644 index 68cdb4c0443..00000000000 --- a/cpack/CMakeLibraryList.xml.in +++ /dev/null @@ -1,11 +0,0 @@ - - - - - @FIND_CEGUI_VERSION@ - @THRIVE_VERSION@ - @LINUX_LIBRARIES@ - - - - diff --git a/cpack/Linux_package_readme.md b/cpack/Linux_package_readme.md deleted file mode 100644 index 231a1c3fc81..00000000000 --- a/cpack/Linux_package_readme.md +++ /dev/null @@ -1,5 +0,0 @@ -This is a precompiled Thrive release. - -To start Thrive run 'launch.sh' script. If you have any issues with -the game please report them on the community forums http://thrivegame.freeforums.net/ - diff --git a/cpack/PackageProject.rb b/cpack/PackageProject.rb deleted file mode 100755 index 8c3457793d7..00000000000 --- a/cpack/PackageProject.rb +++ /dev/null @@ -1,267 +0,0 @@ -#!/usr/bin/env ruby -# -# This is a packaging script for Thrive linux releases -# It creates two packages one universal with literally every library ever in it -# (and one with only the Thrive specific libraries, todo: do this) - -require 'fileutils' -require 'nokogiri' - -# Setup -# If true 'strip' is used to get rid of debugging info -StripFiles = true - -# If false will skip compressing the staging folder, useful for checking which files would -# be included without having to compress them -ZipIt = true - - -if ARGV.count > 1 - - onError "Expected 0 or 1 argument. The argument is the build directory to use" - -end - -def checkRunFolder(suggestedfolder) - - if ARGV.count > 0 - ARGV[0] - else - File.expand_path("../build", suggestedfolder) - end -end - -def projectFolder(baseDir) - - return baseDir - -end - -require_relative '../linux_setup/RubySetupSystem' - -Dir.chdir(CurrentDir) do - - if not File.exists? "CMakeLibraryList.xml" - - onError "Selected build folder doesn't contain library lists file 'CMakeLibraryList.xml' " - - end - -end - -info "Running Thrive packaging script for linux" - -doc = File.open(File.join(CurrentDir, "CMakeLibraryList.xml")) { |f| Nokogiri::XML(f) } - -ThriveVersion = doc.at_xpath("//version").content.strip - -LibraryList = doc.at_xpath("//libraries").content.split(';') - -CEGUIVersion = doc.at_xpath("//CEGUI_version").content.strip - -info "For version #{ThriveVersion} with #{LibraryList.count} libraries and "+ - "CEGUI #{CEGUIVersion}" - - -# Constant name stuff (these aren't configuration options) -PackageName = "Thrive-#{ThriveVersion}" - -ZipName = "#{PackageName}.7z" - -# Add Ogre plugins to the library list -findOgrePlugins(LibraryList, ["RenderSystem_GL", "RenderSystem_GL3Plus", "Plugin_ParticleFX"]) - -# Add CEGUI plugins to the list -findCEGUIPlugins(LibraryList, CEGUIVersion) - -# Find actual libboost_thread files -findRealBoostThread(LibraryList) - - -# Create staging folder -Dir.chdir(CurrentDir) do - - FileUtils.mkdir_p PackageName - FileUtils.mkdir_p File.join(PackageName, "bin") - -end - -TargetRoot = File.join(CurrentDir, PackageName) - -info "Copying all the files to staging directory at: #{TargetRoot}" - -info "Copying core files" - -# Copy all required files -Dir.chdir(CurrentDir) do - - copyPossibleSymlink("Thrive", File.join(TargetRoot, "bin/"), StripFiles, true) - copyPossibleSymlink("liblua.so", File.join(TargetRoot, "bin/"), StripFiles, true) - -end - -success "Core Thrive binaries copied" - -info "Copying direct dependencies" - -puts LibraryList - -copyDependencyLibraries(LibraryList, File.join(TargetRoot, "bin/"), StripFiles, true) - -success "Copied direct libraries" - -# Use ldd to find more dependencies -lddfound = lddFindLibraries File.join(TargetRoot, "bin/Thrive") - -info "Copying #{lddfound.count} libraries found by ldd on Thrive binary" - -copyDependencyLibraries(lddfound, File.join(TargetRoot, "bin/"), StripFiles, true) - - -# Find dependencies of dynamic Ogre libraries -lddfound = lddFindLibraries File.join(TargetRoot, "bin/Plugin_ParticleFX.so") - -info "Copying #{lddfound.count} libraries found by ldd on random things" - -copyDependencyLibraries(lddfound, File.join(TargetRoot, "bin/"), StripFiles, true) - -success "Copied ldd found libraries" - -info "Copied #{HandledLibraries.count} libraries to staging directory" - - -info "Copying assets" - - -# Assets -# TODO: see if these could be symlinks -FileUtils.cp_r File.join(CurrentDir, "../assets/fonts"), TargetRoot -FileUtils.cp_r File.join(CurrentDir, "../assets/gui"), TargetRoot -FileUtils.cp_r File.join(CurrentDir, "../assets/materials"), TargetRoot -FileUtils.cp_r File.join(CurrentDir, "../assets/models"), TargetRoot -FileUtils.cp_r File.join(CurrentDir, "../assets/sounds"), TargetRoot -FileUtils.cp_r File.join(CurrentDir, "../assets/videos"), TargetRoot - -FileUtils.cp_r File.join(CurrentDir, "../scripts"), TargetRoot - -success "Assets copied" - - -info "Copying documentation and creating scripts" - -info "Creating launch scripts" - -# Launch links - -File.open(File.join(TargetRoot, "launch.sh"), 'w') { - |file| file.write(<<-eos) -#!/bin/sh -SCRIPTPATH=$( cd $(dirname $0) ; pwd -P ) -( cd "$SCRIPTPATH/bin" -LD_LIBRARY_PATH="$(pwd)" -export LD_LIBRARY_PATH -./Thrive -) -eos -} - -systemChecked "chmod +x \"#{File.join(TargetRoot, "launch.sh")}\"" - -# Source code setup script -FileUtils.mkdir_p File.join(TargetRoot, "source_build") -FileUtils.cp File.join(CurrentDir, "../SetupThrive.rb"), File.join(TargetRoot, "source_build") - -File.open(File.join(TargetRoot, "source_build/README.md"), 'w') { - |file| file.write(<<-eos) -Contained in this directory is a script that downloads and setups Thrive project build. -You should probably ignore it if you don't plan on doing development on the C++ side of Thrive. -Note: the script requires root, so you should read through it before running it -eos -} - -info "Copying Ogre scripts" - -File.open(File.join(TargetRoot, "bin/plugins.cfg"), 'w') { - |file| file.write(<<-eos) -# Defines plugins to load -PluginFolder=./ - Define plugins -# Plugin=RenderSystem_Direct3D9 -# Plugin=RenderSystem_Direct3D11 -Plugin=RenderSystem_GL -Plugin=RenderSystem_GL3Plus -# Plugin=RenderSystem_GLES -# Plugin=RenderSystem_GLES2 - Plugin=Plugin_ParticleFX -# Plugin=Plugin_CgProgramManager -eos -} - -Dir.chdir(File.join(CurrentDir, "../ogre_cfg")) do - - FileUtils.cp "resources.cfg", File.join(TargetRoot, "bin") - -end - -# Info files -FileUtils.cp File.join(CurrentDir, "../LICENSE.txt"), TargetRoot -FileUtils.cp File.join(CurrentDir, "../README.md"), - File.join(TargetRoot, "REPOSITORY_README.md") -FileUtils.cp File.join(CurrentDir, "../gpl.txt"), TargetRoot - -FileUtils.cp File.join(CurrentDir, "../cpack/Linux_package_readme.md"), - File.join(TargetRoot, "README.md") - -# Version file -FileUtils.cp File.join(CurrentDir, "../thriveversion.ver"), TargetRoot - -FileUtils.touch(File.join(TargetRoot, "package.version.#{ThriveVersion}")) - -Dir.chdir(File.join(CurrentDir, "..")) do - - File.open(File.join(TargetRoot, "revision.txt"), 'w') { - |file| file.write("Package time: " + `date --iso-8601=seconds` + "\n\n" + `git log -n 1`) - } -end - - -info "Copying documentation" - -# documentation -FileUtils.cp_r File.join(CurrentDir, "doc"), TargetRoot - -success "Done" - -success "Done copying" - -info "Deleting log and settings files if they exist" - -FileUtils.rm_f File.join(TargetRoot, "bin/cAudioEngineLog.html") -FileUtils.rm_f File.join(TargetRoot, "bin/CEGUI.log") -FileUtils.rm_f File.join(TargetRoot, "bin/default") -FileUtils.rm_f File.join(TargetRoot, "bin/ogre.cfg") - - - -if ZipIt - - info "Creating a zip of the staging folder" - - Dir.chdir(CurrentDir) do - - systemChecked "7za a '#{ZipName}' '#{PackageName}'" - - end - - success "Zip completed" - -else - - warning "Skipping zip, deleting existing one if one exists"; - FileUtils.rm_f File.join(CurrentDir, ZipName) - -end - -success "Package #{ZipName} completed" - - diff --git a/cpack/zip.cmake.in b/cpack/zip.cmake.in deleted file mode 100644 index da92325089a..00000000000 --- a/cpack/zip.cmake.in +++ /dev/null @@ -1,18 +0,0 @@ -SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} @CMAKE_SOURCE_DIR@/cmake_modules) - -SET(CPACK_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CPACK_GENERATOR "ZIP") -SET(CPACK_INSTALL_CMAKE_PROJECTS - "@CMAKE_BINARY_DIR@;Thrive;ALL;/" -) -#SET(CPACK_PACKAGE_CONTACT "blank@mail.org") -SET(CPACK_PACKAGE_DESCRIPTION_FILE "@CMAKE_SOURCE_DIR@/README.md") -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Evolve your own species") -SET(CPACK_PACKAGE_FILE_NAME "Thrive") -SET(CPACK_PACKAGE_NAME "Thrive") -SET(CPACK_PACKAGE_VENDOR "Revolutionary Games") -SET(CPACK_PACKAGE_VERSION "@THRIVE_VERSION@") -SET(CPACK_RESOURCE_FILE_LICENSE "@CMAKE_SOURCE_DIR@/LICENSE.txt") -SET(CPACK_RESOURCE_FILE_README "@CMAKE_SOURCE_DIR@/README.md") - -SET(CPACK_PACKAGE_EXECUTABLE "Thrive;Thrive") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 45ebe8a1936..deeaa041d46 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,6 +20,7 @@ set(AllProjectFiles "${LEVIATHAN_SRC}/LeviathanTest/DummyLog.cpp" ) +set(SKIP_INSTALL ON) set(CREATE_CONSOLE_APP ON) include(LeviathanUsingProject)