Provide initial cpack support. Mainly for devs.

There are two targets you may not be familiar with, `install` and `package`.
* For Linux, `install` now defaults to `/usr/local`, but you can set it back to `/opt` with `cmake -DCMAKE_INSTALL_PREFIX=/opt` if you wish.
* For Windows, `install` may not work, but this is not a target you would want usually.
* For Linux, `package` has not been tested yet. It will likely create an archive file of what is installed.
* For Windows, `package` will create an NSIS package that can be used to install StepMania. One minor change as a result is that the binary and companion dlls will be placed in `bin` instead of `Program` now, but it makes no difference code-wise.

Mac OS X users: for now, use the `dmg` target instead.

This commit does *not* deprecate the original nsi script yet. The Texture Font Generator program has not been addressed yet.
This commit is contained in:
Jason Felds
2015-04-11 23:47:42 -04:00
parent 84b57e7ca4
commit 361df3a496
6 changed files with 142 additions and 60 deletions
+18 -1
View File
@@ -2,7 +2,7 @@ Warning
==
Make sure you read README.md first if you have not.
Installing StepMania
Compiling StepMania
==
To use StepMania on your computer, it is first assumed that cmake is run (see README.md for more information). Then, follow the guide based on your operating system.
@@ -18,3 +18,20 @@ Linux
===
Using the command line, simply type make and it will place stepmania and GtkModule.so (if requested) in the root StepMania directory. There is no more need to symlink the files.
Installing StepMania
==
Installing in this context refers to placing the folders and generated binary in a standard location based on your operating system.
This guide assumes default install locations. If you want to change the initial location, pass in `-DCMAKE_INSTALL_PREFIX=/new/path/here` when configuring your local setup.
Windows
===
The default installation directory is `C:\Program Files (x86)\Stepmania 5`.
Mac OS X
===
The `StepMania.app` package can be copied to `/Applications` and it will work as expected.
Linux
===
After installing, run `sudo make install`. The files will be placed in the location specified: by default, that is now `/usr/local/stepmania-5.0`.
+8
View File
@@ -0,0 +1,8 @@
LICENSE
=======
StepMania's source code and resulting binary is licensed under the MIT license. Go to http://opensource.org/licenses/MIT for more information.
A few sample songs were provided that can be distributed. They are under the CC-NC (Creative Commons Non-Commercial) license. Go to https://creativecommons.org/ for more information.
The FFMPEG codes (see https://www.ffmpeg.org/ for more) and the MAD library (see http://www.underbit.com/products/mad/ for more) use the GPL license. Go to http://www.gnu.org for more information.
+27
View File
@@ -0,0 +1,27 @@
set(CPACK_PACKAGE_NAME "${SM_EXE_NAME}")
set(CPACK_PACKAGE_VENDOR "StepMania")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Rhythm Game Simulator")
set(CPACK_PACKAGE_VERSION_MAJOR "${SM_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${SM_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${SM_VERSION_PATCH}")
set(CPACK_PACKAGE_VERSION "${SM_VERSION_TRADITIONAL}")
set(CPACK_NSIS_HELP_LINK "https://github.com/stepmania/stepmania/issues")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.stepmania.com/")
set(CPACK_RESOURCE_FILE_README "${SM_ROOT_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${SM_BUILD_DIR}/license_install.txt")
set(CPACK_PACKAGE_EXECUTABLES
"${SM_EXE_NAME}" "StepMania ${SM_VERSION_MAJOR}"
)
if(WIN32)
# By setting these install keys manually,
# The default directory of "StepMania major.minor.patch" is lost.
# This is currently done to maintain backwards compatibility.
# However, removing these two will allow for multiple versions of StepMania
# to be installed relatively cleanly.
set(CPACK_PACKAGE_INSTALL_DIRECTORY "StepMania ${SM_VERSION_MAJOR}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "StepMania ${SM_VERSION_MAJOR}")
endif()
include(CPack)
+38
View File
@@ -0,0 +1,38 @@
# Prep options that are needed for each platform.
option(WITH_NETWORKING "Build with networking support." ON)
# This option quiets warnings that are a part of external projects.
option(WITH_EXTERNAL_WARNINGS "Build with warnings for all components, not just StepMania." OFF)
# This option is not yet working, but will likely default to ON in the future.
option(WITH_LTO "Build with Link Time Optimization (LTO)/Whole Program Optimization." OFF)
# This option handles if we use SSE2 processing.
option(WITH_SSE2 "Build with SSE2 Optimizations." ON)
# This option may go away in the future: if it does, JPEG will always be required.
option(WITH_JPEG "Build with JPEG Image Support." ON)
# Turn this on to set this to a specific release mode.
option(WITH_FULL_RELEASE "Build as a proper, full release." OFF)
# Turn this option off to not use the GPL exclusive components.
option(WITH_GPL_LIBS "Build with GPL libraries." ON)
if(WIN32)
option(WITH_MINIMAID "Build with Mimimaid Lights Support." OFF)
else()
if(LINUX)
option(WITH_FFMPEG "Build with FFMPEG." ON)
# Builder beware: later versions of ffmpeg may break!
option(WITH_SYSTEM_FFMPEG "Build with the system's FFMPEG." OFF)
option(WITH_TTY "Build with Linux TTY Input Support." OFF)
option(WITH_PROFILING "Build with Profiling Support." OFF)
option(WITH_GLES2 "Build with OpenGL ES 2.0 Support." ON)
option(WITH_GTK2 "Build with GTK2 Support." ON)
option(WITH_OGG "Build with OGG/Vorbis Support." ON)
option(WITH_MP3 "Build with MP3 Support." ON)
option(WITH_PARALLEL_PORT "Build with Parallel Lights I/O Support." OFF)
option(WITH_CRASH_HANDLER "Build with Crash Handler Support." ON)
endif()
endif()
+12 -44
View File
@@ -15,6 +15,13 @@ set(SM_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Build")
set(SM_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(SM_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
# TODO: Reconsile the OS dependent naming scheme.
if (WIN32 OR APPLE)
set(SM_EXE_NAME "StepMania")
else()
set(SM_EXE_NAME "stepmania")
endif()
# Some OS specific helpers.
if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(LINUX TRUE)
@@ -34,48 +41,10 @@ else()
set(BSD FALSE)
endif()
# Some eventual distribution stuff.
set(CPACK_PACKAGE_NAME "StepMania")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Rhythm Game Simulator")
# Allow for finding our libraries in a standard location.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Modules/")
# Prep options that are needed for each platform.
option(WITH_NETWORKING "Build with networking support." ON)
# This option quiets warnings that are a part of external projects.
option(WITH_EXTERNAL_WARNINGS "Build with warnings for all components, not just StepMania." OFF)
# This option is not yet working, but will likely default to ON in the future.
option(WITH_LTO "Build with Link Time Optimization (LTO)/Whole Program Optimization." OFF)
# This option handles if we use SSE2 processing.
option(WITH_SSE2 "Build with SSE2 Optimizations." ON)
# This option may go away in the future: if it does, JPEG will always be required.
option(WITH_JPEG "Build with JPEG Image Support." ON)
# Turn this on to set this to a specific release mode.
option(WITH_FULL_RELEASE "Build as a proper, full release." OFF)
# Turn this option off to not use the GPL exclusive components.
option(WITH_GPL_LIBS "Build with GPL libraries." ON)
if(WIN32)
option(WITH_MINIMAID "Build with Mimimaid Lights Support." OFF)
else()
if(LINUX)
option(WITH_FFMPEG "Build with FFMPEG." ON)
# Builder beware: later versions of ffmpeg may break!
option(WITH_SYSTEM_FFMPEG "Build with the system's FFMPEG." OFF)
option(WITH_TTY "Build with Linux TTY Input Support." OFF)
option(WITH_PROFILING "Build with Profiling Support." OFF)
option(WITH_GLES2 "Build with OpenGL ES 2.0 Support." ON)
option(WITH_GTK2 "Build with GTK2 Support." ON)
option(WITH_OGG "Build with OGG/Vorbis Support." ON)
option(WITH_MP3 "Build with MP3 Support." ON)
option(WITH_PARALLEL_PORT "Build with Parallel Lights I/O Support." OFF)
option(WITH_CRASH_HANDLER "Build with Crash Handler Support." ON)
endif()
endif()
include("CMake/DefineOptions.cmake")
# Set up version numbers according to the new scheme.
set(SM_VERSION_MAJOR 5)
@@ -97,9 +66,6 @@ else()
set(SM_VERSION_FULL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}-git-${SM_VERSION_GIT_HASH}")
endif()
# Allow for finding our libraries in a standard location.
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/CMake/Modules/")
# Put the predefined targets in separate groups.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -377,3 +343,5 @@ add_subdirectory(extern)
# The internal libraries and eventual executable to be used.
add_subdirectory(src)
# Define installer based items for cpack.
include("CMake/CPackSetup.cmake")
+39 -15
View File
@@ -151,13 +151,6 @@ if(NOT APPLE)
source_group("" FILES "Main.cpp")
endif()
# TODO: Reconsile the OS dependent naming scheme.
if (WIN32 OR APPLE)
set(SM_EXE_NAME "StepMania")
else()
set(SM_EXE_NAME "stepmania")
endif()
# Configure generated files here.
configure_file("${SM_XCODE_DIR}/Info.plist.in.xml" "${SM_XCODE_DIR}/Info.StepMania.plist")
@@ -215,6 +208,21 @@ set_target_properties("${SM_EXE_NAME}" PROPERTIES
OUTPUT_NAME_RELWITHDEBINFO "${SM_RELWITHDEBINFO}"
)
list(APPEND SM_WINDOWS_PROGRAM_DLLS
"${SM_PROGRAM_DIR}/avcodec-53.dll"
"${SM_PROGRAM_DIR}/avformat-53.dll"
"${SM_PROGRAM_DIR}/avutil-51.dll"
"${SM_PROGRAM_DIR}/jpeg.dll"
"${SM_PROGRAM_DIR}/msvcp100.dll"
"${SM_PROGRAM_DIR}/msvcp110.dll"
"${SM_PROGRAM_DIR}/msvcr100.dll"
"${SM_PROGRAM_DIR}/msvcr110.dll"
"${SM_PROGRAM_DIR}/parallel_lights_io.dll"
"${SM_PROGRAM_DIR}/swscale-2.dll"
"${SM_PROGRAM_DIR}/vccorlib110.dll"
"${SM_PROGRAM_DIR}/zlib1.dll"
)
if(WIN32)
sm_add_compile_definition("${SM_EXE_NAME}" WINDOWS)
sm_add_compile_definition("${SM_EXE_NAME}" _WINDOWS) # TODO: Remove this potential duplicate.
@@ -579,18 +587,34 @@ endif()
target_include_directories("${SM_EXE_NAME}" PUBLIC ${SM_INCLUDE_DIRS})
if(WIN32)
# TODO: Look forward to 64-bit builds. Also, Find a way to not need to hardcode this.
set(SM_INSTALL_DESTINATION "C:/Program Files (x86)/StepMania 5")
elseif(APPLE)
# TODO: Confirm if anything special is needed. Most Mac apps are just portable .app folders.
set(SM_INSTALL_DESTINATION "")
set(SM_INSTALL_DESTINATION ".")
else()
# TODO: Allow for a more flexible system. Good luck convincing old users of that.
set(SM_INSTALL_DESTINATION "/opt/stepmania-5.0")
set(SM_INSTALL_DESTINATION "stepmania-5.0")
endif()
if(NOT APPLE)
install(TARGETS "${SM_EXE_NAME}" DESTINATION "${SM_INSTALL_DESTINATION}")
if(WIN32)
# Hardcoding the values for now since the foreach loop is not working as intended.
install(TARGETS "${SM_EXE_NAME}" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/avcodec-53.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/avformat-53.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/avutil-51.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/jpeg.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/msvcp100.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/msvcp110.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/msvcr100.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/msvcr110.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/parallel_lights_io.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/swscale-2.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/vccorlib110.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
install(FILES "${SM_PROGRAM_DIR}/zlib1.dll" DESTINATION "${SM_INSTALL_DESTINATION}/bin")
# foreach(SM_WINDOW_DLL "${SM_WINDOWS_PROGRAM_DLLS}")
# install(FILES "${SM_WINDOW_DLL}" DESTINATION "${SM_INSTALL_DESTINATION}")
# endforeach()
else()
install(TARGETS "${SM_EXE_NAME}" DESTINATION "${SM_INSTALL_DESTINATION}")
endif()
if (UNIX OR LINUX)
install(FILES "${SM_ROOT_DIR}/GtkModule.so" LIBRARY DESTINATION "${SM_INSTALL_DESTINATION}" OPTIONAL)
endif()