diff --git a/.gitignore b/.gitignore index 8dd550c2a1..00d5b18d6e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,20 @@ *.o *.obj +# CMake Files/Directories +CMakeFiles/ +CMakeCache.txt +CMakeScripts/ +cmake_install.cmake +# The following are generated from CMake, and thus should be stopped. +Build/* +Build/*/* +Debug/ +Release/ +Contents/ +verdata.* +StepMania-debug + # Text Editor Based Items ___* *~ @@ -49,6 +63,7 @@ lib*_link.a *.suo *.exp *.ilk +*.map # Windows General Files Thumbs.db @@ -73,6 +88,13 @@ src/config.h src/config.h.in src/stamp-h1 GtkModule.so +StepMania + +# Version control specific. +*.BACKUP.* +*.BASE.* +*.LOCAL.* +*.REMOTE.* # StepMania Specific *.smzip @@ -147,3 +169,4 @@ BuildLog.htm *.swp *.pc *.d + diff --git a/Build/INSTALL.md b/Build/INSTALL.md new file mode 100644 index 0000000000..2de35271eb --- /dev/null +++ b/Build/INSTALL.md @@ -0,0 +1,20 @@ +Warning +== +Make sure you read README.md first if you have not. + +Installing 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. + +Windows +=== +Using Visual Studio, simply build and it will place the .exe file in the correct directory. + +Mac OS X +=== +Using Xcode, simply build in Xcode and it will place the .app file in the correct directory. + +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. + diff --git a/Build/README.md b/Build/README.md new file mode 100644 index 0000000000..28a4ff376c --- /dev/null +++ b/Build/README.md @@ -0,0 +1,40 @@ +Warning +== +This is considered unstable. This may work on Windows and Mac. This is not guaranteed to work on Linux right now. + +Use this at your own risk. + +CMake Installation +== +There are two ways of working with cmake: the command line and the GUI. + +CMake Command Line +=== + +If you are unfamiliar with cmake, first run `cmake --help`. This will present a list of options and generators. The generators are used for setting up your project. + +The following steps will assume you operate from the StepMania project's Build directory. + +For the first setup, you will want to run this command: + +`cmake -G {YourGeneratorHere} .. && cmake ..` + +Replace {YourGeneratorHere} with one of the generator choices from `cmake --help`. + +If any cmake project file changes, you can just run `cmake .. && cmake ..` to get up to date. If this by itself doesn't work, you may have to clean the cmake cache. Use `rm -rf CMakeCache.txt CMakeScripts/ CMakeFiles/ cmake_install.txt` to do that, and then run the generator command again. + +The reason for running cmake at least twice is to make sure that all of the variables get set up appropriately. + +Environment variables can be modified at this stage. If you want to pass `-ggdb` or any other flag that is not set up by default, utilize `CXXFLAGS` or any appropriate variable. + +CMake GUI +=== + +For those that use the GUI to work with cmake, you need to specify where the source code is and where the binaries will be built. The first one, counter-intuitively, is actually the parent directory of this one: the main StepMania directory. The second one for building can be this directory. + +Upon setting the source and build directories, you should `Configure` the build. If no errors show up, you can hit `Generate` until none of the rows on the GUI are red. + +If the cmake project file changes, you can just generate the build to get up to date. If this by itself doesn't work, you may have to clean the cmake cache. Go to File -> Delete Cache, and then run the `Configure` and `Generate` steps again. + +With that, you should be good to go. + diff --git a/CMake/CMakeMacros.cmake b/CMake/CMakeMacros.cmake new file mode 100644 index 0000000000..fac2f74a76 --- /dev/null +++ b/CMake/CMakeMacros.cmake @@ -0,0 +1,41 @@ +function(sm_append_simple_target_property target property str) + get_target_property(current_property ${target} ${property}) + if (current_property) + list(APPEND current_property ${str}) + set_target_properties(${target} PROPERTIES ${property} "${current_property}") + else() + set_target_properties(${target} PROPERTIES ${property} ${str}) + endif() +endfunction() + +function(sm_add_compile_definition target def) + sm_append_simple_target_property(${target} COMPILE_DEFINITIONS ${def}) +endfunction() + +function(sm_add_compile_flag target flag) + sm_append_simple_target_property(${target} COMPILE_FLAGS ${flag}) +endfunction() + +function(sm_add_link_flag target flag) + if (MSVC) + # Use a modified form of sm_append_simple_target_property. + get_target_property(current_property ${target} LINK_FLAGS) + if (current_property) + set_target_properties(${target} PROPERTIES LINK_FLAGS "${current_property} ${flag}") + else() + set_target_properties(${target} PROPERTIES LINK_FLAGS ${flag}) + endif() + else() + sm_append_simple_target_property(${target} LINK_FLAGS ${flag}) + endif() +endfunction() + +function(disable_project_warnings projectName) + if (MSVC) + sm_add_compile_flag(${projectName} "/W0") + elseif(APPLE) + set_target_properties(${projectName} PROPERTIES XCODE_ATTRIBUTE_GCC_WARN_INHIBIT_ALL_WARNINGS "YES") + else() + set_target_properties(${projectName} PROPERTIES COMPILE_FLAGS "-w") + endif() +endfunction() diff --git a/CMake/Modules/FindDirectX.cmake b/CMake/Modules/FindDirectX.cmake new file mode 100644 index 0000000000..8b8c1c8cbb --- /dev/null +++ b/CMake/Modules/FindDirectX.cmake @@ -0,0 +1,42 @@ +# From the CMake wiki, get the DirectX version needed. +# This assumes default directories. + +# Once loaded, the following are defined: +# DIRECTX_FOUND +# DIRECTX_INCLUDE_DIR +# DIRECTX_LIBRARIES + +if(NOT WIN32) + return() +endif() + +set(DIRECTX_INCLUDE_SEARCH_PATHS + # TODO: Do not be limited to x86 in the future. + "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Include" + "C:/DXSDK/Include" +) + +set(DIRECTX_LIBRARY_SEARCH_PATHS + # TODO: Do not be limited to x86 in the future. + "C:/Program Files (x86)/Microsoft DirectX SDK (June 2010)/Lib/x86" + "C:/DXSDK/Include/Lib/x86" +) + +find_path(DIRECTX_INCLUDE_DIR + NAMES "DxErr.h" + PATHS ${DIRECTX_INCLUDE_SEARCH_PATHS} + DOC "Where can DxErr.h be found?" +) + +find_library(DIRECTX_LIBRARIES + NAMES "DxErr.lib" "d3dx9.lib" + PATHS ${DIRECTX_LIBRARY_SEARCH_PATHS} + DOC "Where can the DX libraries be found?" +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(DIRECTX DEFAULT_MSG DIRECTX_INCLUDE_DIR DIRECTX_LIBRARIES) + +if(DIRECTX_FOUND) + mark_as_advanced(DIRECTX_INCLUDE_DIR DIRECTX_LIBRARIES) +endif() diff --git a/CMake/Modules/FindJACK.cmake b/CMake/Modules/FindJACK.cmake new file mode 100644 index 0000000000..64df2fadc5 --- /dev/null +++ b/CMake/Modules/FindJACK.cmake @@ -0,0 +1,61 @@ +# This was borrowed from the gnuradio repository. + +# - Try to find jack-2.6 +# Once done this will define +# +# JACK_FOUND - system has jack +# JACK_INCLUDE_DIRS - the jack include directory +# JACK_LIBRARIES - Link these to use jack +# JACK_DEFINITIONS - Compiler switches required for using jack +# +# Copyright (c) 2008 Andreas Schneider +# Modified for other libraries by Lasse Kärkkäinen +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +if (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) + # in cache already + set(JACK_FOUND TRUE) +else (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) + # use pkg-config to get the directories and then use these values + # in the FIND_PATH() and FIND_LIBRARY() calls + if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + include(UsePkgConfig) + pkgconfig(jack _JACK_INCLUDEDIR _JACK_LIBDIR _JACK_LDFLAGS _JACK_CFLAGS) + else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_package(PkgConfig) + if (PKG_CONFIG_FOUND) + pkg_check_modules(_JACK jack) + endif (PKG_CONFIG_FOUND) + endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) + find_path(JACK_INCLUDE_DIR + NAMES + jack/jack.h + PATHS + ${_JACK_INCLUDEDIR} + /usr/include + /usr/local/include + /opt/local/include + /sw/include + ) + + find_library(JACK_LIBRARY + NAMES + jack + PATHS + ${_JACK_LIBDIR} + /usr/lib + /usr/local/lib + /opt/local/lib + /sw/lib + ) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(JACK DEFAULT_MSG + JACK_INCLUDE_DIRS JACK_LIBRARIES) + + # show the JACK_INCLUDE_DIRS and JACK_LIBRARIES variables only in the advanced view + mark_as_advanced(JACK_INCLUDE_DIRS JACK_LIBRARIES) +endif (JACK_LIBRARIES AND JACK_INCLUDE_DIRS) diff --git a/CMake/Modules/FindMad.cmake b/CMake/Modules/FindMad.cmake new file mode 100644 index 0000000000..e22995142c --- /dev/null +++ b/CMake/Modules/FindMad.cmake @@ -0,0 +1,9 @@ +find_path(LIBMAD_INCLUDE_DIR mad.h) + +find_library(LIBMAD_LIBRARY mad) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LIBMAD DEFAULT_MSG LIBMAD_LIBRARY LIBMAD_INCLUDE_DIR) + +mark_as_advanced(LIBMAD_LIBRARY LIBMAD_INCLUDE_DIR) + diff --git a/CMake/Modules/FindOSS.cmake b/CMake/Modules/FindOSS.cmake new file mode 100644 index 0000000000..681cfbcc1a --- /dev/null +++ b/CMake/Modules/FindOSS.cmake @@ -0,0 +1,24 @@ +# Copied from marsyas, which is also copied from fqterm. +# Further modifications are done. + +IF(UNIX) + IF(CMAKE_SYSTEM_NAME MATCHES "Linux") + SET(OSS_HDR_NAME "linux/soundcard.h") + ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux") + IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + SET(OSS_HDR_NAME "sys/soundcard.h") + ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") +ENDIF(UNIX) + +FIND_PATH(OSS_INCLUDE_DIR "${OSS_HDR_NAME}" + "/usr/include" "/usr/local/include" +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OSS DEFAULT_MSG OSS_INCLUDE_DIR) + +MARK_AS_ADVANCED ( + OSS_FOUND + OSS_INCLUDE_DIR +) diff --git a/CMake/Modules/FindOgg.cmake b/CMake/Modules/FindOgg.cmake new file mode 100644 index 0000000000..3ad80f5e85 --- /dev/null +++ b/CMake/Modules/FindOgg.cmake @@ -0,0 +1,17 @@ +# Borrowed from code.openhub.net + +# Base Io build system +# Written by Jeremy Tregunna +# +# Find libogg. + +FIND_PATH(OGG_INCLUDE_DIR ogg/ogg.h) + +SET(OGG_NAMES ${OGG_NAMES} ogg libogg) +FIND_LIBRARY(OGG_LIBRARY NAMES ${OGG_NAMES} PATH) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OGG DEFAULT_MSG OGG_LIBRARY OGG_INCLUDE_DIR) + +mark_as_advanced(OGG_LIBRARY OGG_INCLUDE_DIR) + diff --git a/CMake/Modules/FindPulseAudio.cmake b/CMake/Modules/FindPulseAudio.cmake new file mode 100644 index 0000000000..6128664c14 --- /dev/null +++ b/CMake/Modules/FindPulseAudio.cmake @@ -0,0 +1,47 @@ +# This comes from the PulseAudio QT project. + +# Try to find the PulseAudio library +# +# Once done this will define: +# +# PULSEAUDIO_FOUND - system has the PulseAudio library +# PULSEAUDIO_INCLUDE_DIR - the PulseAudio include directory +# PULSEAUDIO_LIBRARY - the libraries needed to use PulseAudio +# +# Copyright (c) 2008, Matthias Kretz, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# +# There was no COPYING-CMAKE-SCRIPTS file in the repo in question. --wolfman + +if (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARY) + # Already in cache, be silent + set(PULSEAUDIO_FIND_QUIETLY TRUE) +endif (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARY) + +if (NOT WIN32) + include(FindPkgConfig) + pkg_check_modules(PULSEAUDIO libpulse) + if(PULSEAUDIO_FOUND) + set(PULSEAUDIO_LIBRARY ${PULSEAUDIO_LIBRARIES} CACHE FILEPATH "Path to the PulseAudio library") + set(PULSEAUDIO_INCLUDE_DIR ${PULSEAUDIO_INCLUDEDIR} CACHE PATH "Path to the PulseAudio includes") + # PULSEAUDIO_DEFINITIONS - Compiler switches required for using PulseAudio + # set(PULSEAUDIO_DEFINITIONS ${PULSEAUDIO_CFLAGS}) + endif(PULSEAUDIO_FOUND) +endif (NOT WIN32) + +if (NOT PULSEAUDIO_INCLUDE_DIR) + FIND_PATH(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h) +endif (NOT PULSEAUDIO_INCLUDE_DIR) + +if (NOT PULSEAUDIO_LIBRARY) + FIND_LIBRARY(PULSEAUDIO_LIBRARY NAMES pulse) +endif (NOT PULSEAUDIO_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PULSEAUDIO DEFAULT_MSG + PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY) + +mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY) + diff --git a/CMake/Modules/FindVorbis.cmake b/CMake/Modules/FindVorbis.cmake new file mode 100644 index 0000000000..558c9b2fc7 --- /dev/null +++ b/CMake/Modules/FindVorbis.cmake @@ -0,0 +1,17 @@ +# Borrowed from code.openhub.net + +# Base Io build system +# Written by Jeremy Tregunna +# +# Find libvorbis. + +FIND_PATH(VORBIS_INCLUDE_DIR vorbis/codec.h) + +SET(VORBIS_NAMES ${VORBIS_NAMES} vorbis libvorbis) +FIND_LIBRARY(VORBIS_LIBRARY NAMES ${VORBIS_NAMES} PATH) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBIS DEFAULT_MSG VORBIS_LIBRARY VORBIS_INCLUDE_DIR) + +mark_as_advanced(VORBIS_LIBRARY VORBIS_INCLUDE_DIR) + diff --git a/CMake/Modules/FindVorbisFile.cmake b/CMake/Modules/FindVorbisFile.cmake new file mode 100644 index 0000000000..9043a2203c --- /dev/null +++ b/CMake/Modules/FindVorbisFile.cmake @@ -0,0 +1,14 @@ +# Inspired by Jeremy Tregunna's cmake work +# +# Find libvorbisfile. + +FIND_PATH(VORBISFILE_INCLUDE_DIR vorbis/vorbisfile.h) + +SET(VORBISFILE_NAMES ${VORBISFILE_NAMES} vorbisfile libvorbisfile) +FIND_LIBRARY(VORBISFILE_LIBRARY NAMES ${VORBISFILE_NAMES} PATH) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(VORBISFILE DEFAULT_MSG VORBISFILE_LIBRARY VORBISFILE_INCLUDE_DIR) + +mark_as_advanced(VORBISFILE_LIBRARY VORBISFILE_INCLUDE_DIR) + diff --git a/CMake/Modules/FindXrandr.cmake b/CMake/Modules/FindXrandr.cmake new file mode 100644 index 0000000000..c2960911d5 --- /dev/null +++ b/CMake/Modules/FindXrandr.cmake @@ -0,0 +1,44 @@ +# This is borrowed from FreeRDP. +# - Find XRANDR +# Find the XRANDR libraries +# +# This module defines the following variables: +# XRANDR_FOUND - true if XRANDR_INCLUDE_DIR & XRANDR_LIBRARY are found +# XRANDR_LIBRARIES - Set when XRANDR_LIBRARY is found +# XRANDR_INCLUDE_DIRS - Set when XRANDR_INCLUDE_DIR is found +# +# XRANDR_INCLUDE_DIR - where to find Xrandr.h, etc. +# XRANDR_LIBRARY - the XRANDR library +# + +#============================================================================= +# Copyright 2012 Alam Arias +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#============================================================================= + +find_path(XRANDR_INCLUDE_DIRS NAMES X11/extensions/Xrandr.h + PATH_SUFFIXES X11/extensions + PATHS /opt/X11/include + DOC "The XRANDR include directory" +) + +find_library(XRANDR_LIBRARIES NAMES Xrandr + PATHS /opt/X11/lib + DOC "The XRANDR library" +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(XRANDR DEFAULT_MSG XRANDR_LIBRARIES XRANDR_INCLUDE_DIRS) + +mark_as_advanced(XRANDR_INCLUDE_DIRS XRANDR_LIBRARIES) diff --git a/CMake/Modules/Findyasm.cmake b/CMake/Modules/Findyasm.cmake new file mode 100644 index 0000000000..fb02c2c3fb --- /dev/null +++ b/CMake/Modules/Findyasm.cmake @@ -0,0 +1,13 @@ +# Try to find the yasm assembly program. + +include(FindPackageHandleStandardArgs) + +find_program(YASM_EXECUTABLE yasm + HINTS $ENV{YASM_ROOT} ${YASM_ROOT} + PATH_SUFFIXES bin +) + +find_package_handle_standard_args(yasm DEFAULT_MSG YASM_EXECUTABLE) + +mark_as_advanced(YASM_EXECUTABLE) + diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..d0d04bc31f --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,318 @@ +cmake_minimum_required(VERSION 2.8.12) + +project(StepMania) + +# Include the macros and functions. +include(CMake/CMakeMacros.cmake) + +# Set up helper variables for future configuring. +set(SM_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/CMake") +set(SM_EXTERN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern") +set(SM_BUNDLE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bundle") +set(SM_XCODE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Xcode") +set(SM_PROGRAM_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Program") +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}") + +# Some OS specific helpers. +if (CMAKE_SYSTEM_NAME MATCHES "Linux") + set(LINUX TRUE) +else() + set(LINUX FALSE) +endif() + +if (CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(MACOSX TRUE) +else() + set(MACOSX FALSE) +endif() + +if (CMAKE_SYSTEM_NAME MATCHES "BSD") + set(BSD TRUE) +else() + set(BSD FALSE) +endif() + +# Some eventual distribution stuff. +set(CPACK_PACKAGE_NAME "StepMania") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Rhythm Game Simulator") + +# Prep options that are needed for each platform. +option(WITH_NETWORKING "Build with networking support" ON) + +# 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) + +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) + +if(WIN32) + option(WITH_MINIMAID "Build with Mimimaid Lights Support" OFF) +else() + if(LINUX) + option(WITH_FFMPEG "Build with FFMPEG" ON) + 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() + +# Set up version numbers according to the new scheme. +set(SM_VERSION_MAJOR 5) +set(SM_VERSION_MINOR 0) +set(SM_VERSION_PATCH 6) +set(SM_VERSION_TRADITIONAL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}") + +if(WITH_FULL_RELEASE EQUAL ON) + set(SM_VERSION_FULL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}.${SM_VERSION_PATCH}") +else() + # Using the deprecated version for now to keep cmake 2.8 users happy. + exec_program(git "${SM_ROOT_DIR}" + ARGS "rev-parse" "--short" "HEAD" + OUTPUT_VARIABLE SM_VERSION_GIT_HASH + RETURN_VALUE ret + ) + + if(NOT (ret STREQUAL "0")) + set(SM_VERSION_GIT_HASH "UNKNOWN") + set(SM_VERSION_FULL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}-${SM_VERSION_GIT_HASH}") + else() + set(SM_VERSION_FULL "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}-git-${SM_VERSION_GIT_HASH}") + endif() +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) + +# Dependencies go here. +set(ENDIANNESS "ENDIAN_LITTLE") +if(WIN32) + set(HAS_OGG TRUE) + set(HAS_MP3 TRUE) + find_package(DirectX REQUIRED) + + # FFMPEG...it can be evil. + find_library(LIB_SWSCALE NAMES "swscale" + PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH + ) + get_filename_component(LIB_SWSCALE ${LIB_SWSCALE} NAME) + + find_library(LIB_AVCODEC NAMES "avcodec" + PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH + ) + get_filename_component(LIB_AVCODEC ${LIB_AVCODEC} NAME) + + find_library(LIB_AVFORMAT NAMES "avformat" + PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH + ) + get_filename_component(LIB_AVFORMAT ${LIB_AVFORMAT} NAME) + + find_library(LIB_AVUTIL NAMES "avutil" + PATHS "${SM_EXTERN_DIR}/ffmpeg/lib" NO_DEFAULT_PATH + ) + get_filename_component(LIB_AVUTIL ${LIB_AVUTIL} NAME) +elseif(MACOSX) + set(HAS_OGG TRUE) + set(HAS_MP3 TRUE) + set(WITH_CRASH_HANDLER TRUE) + # Apple Archs needs to be 32-bit for now. + # When SDL2 is introduced, this may change. + set(CMAKE_OSX_ARCHITECTURES "i386") + set(CMAKE_OSX_DEPLOYMENT_TARGET "10.6") + + find_library(MAC_FRAME_ACCELERATE Accelerate ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_APPKIT AppKit ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_AUDIOTOOLBOX AudioToolbox ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_AUDIOUNIT AudioUnit ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_CARBON Carbon ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_COCOA Cocoa ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_COREAUDIO CoreAudio ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_COREFOUNDATION CoreFoundation ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_CORESERVICES CoreServices ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_FOUNDATION Foundation ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_IOKIT IOKit ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_OPENGL OpenGL ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + find_library(MAC_FRAME_QUICKTIME QuickTime ${CMAKE_SYSTEM_FRAMEWORK_PATH}) + + mark_as_advanced( + MAC_FRAME_ACCELERATE + MAC_FRAME_APPKIT + MAC_FRAME_AUDIOTOOLBOX + MAC_FRAME_AUDIOUNIT + MAC_FRAME_CARBON + MAC_FRAME_COCOA + MAC_FRAME_COREAUDIO + MAC_FRAME_COREFOUNDATION + MAC_FRAME_CORESERVICES + MAC_FRAME_FOUNDATION + MAC_FRAME_IOKIT + MAC_FRAME_OPENGL + MAC_FRAME_QUICKTIME + ) +elseif(LINUX) + include(TestBigEndian) + include(ExternalProject) + + if(WITH_GTK2) + find_package("GTK2" 2.0) + if (${GTK2_FOUND}) + set(HAS_GTK2 TRUE) + else() + set(HAS_GTK2 FALSE) + message("GTK2 was not found on your system. There will be no loading window.") + endif() + else() + set(HAS_GTK2 FALSE) + endif() + + find_package(X11) + + find_package("BZip2") + if (NOT(${BZIP2_FOUND})) + message(FATAL_ERROR "Bzip2 support required.") + endif() + + find_package("ZLIB") + if (NOT(${ZLIB_FOUND})) + message(FATAL_ERROR "zlib support required.") + endif() + + find_library(DL_LIBRARY dl) + if(${LIBDL_FOUND}) + set(HAS_LIBDL TRUE) + else() + set(HAS_LIBDL FALSE) + endif() + + find_package(Xrandr) + if (${XRANDR_FOUND}) + set(HAS_XRANDR TRUE) + else() + set(HAX_XRANDR FALSE) + endif() + + if (WITH_OGG) + find_package(Ogg) + find_package(Vorbis) + find_package(VorbisFile) + + if(NOT (OGG_FOUND AND VORBIS_FOUND AND VORBISFILE_FOUND) ) + message(FATAL_ERROR "Not all vorbis libraries were found. If you wish to skip vorbis support, set WITH_OGG to OFF when configuring.") + else() + set(HAS_OGG TRUE) + endif() + endif() + + if (WITH_MP3) + find_package(Mad) + if(NOT LIBMAD_FOUND) + message(FATAL_ERROR "Libmad library not found. If you wish to skip mp3 support, set WITH_MP3 to OFF when configuring.") + else() + set(HAS_MP3 TRUE) + endif() + endif() + + find_package(PulseAudio) + if (PULSEAUDIO_FOUND) + set(HAS_PULSE TRUE) + else() + set(HAS_PULSE FALSE) + endif() + + find_package(ALSA) + if (ALSA_FOUND) + set(HAS_ALSA TRUE) + else() + set(HAS_ALSA FALSE) + endif() + + find_package(JACK) + if (JACK_FOUND) + set(HAS_JACK TRUE) + else() + set(HAS_JACK FALSE) + endif() + + find_package(OSS) + if (OSS_FOUND) + set(HAS_OSS TRUE) + else() + set(HAS_OSS FALSE) + endif() + + if(NOT OSS_FOUND AND NOT JACK_FOUND AND NOT ALSA_FOUND AND NOT PULSE_FOUND) + message(FATAL_ERROR "No sound libraries found. You will require at least one.") + else() + message(STATUS "-- At least one sound library was found. Do not worry if any were not found at this stage.") + endif() + + find_package(Threads) + if (${Threads_FOUND}) + set(HAS_PTHREAD TRUE) + else() + set(HAS_PTHREAD FALSE) + endif() + + find_package(yasm) + if (NOT YASM_FOUND) + message("YASM was not found. Please install if you wish for ffmpeg support.") + set(WITH_FFMPEG OFF) + endif() + + if(WITH_FFMPEG) + # NEVER use the system ffmpeg. Not worth the hassle. + # --shlibdir=$our_installdir/stepmania-$VERSION + externalproject_add("ffmpeg" + DOWNLOAD_DIR "${SM_EXTERN_DIR}/ffmpeg-linux" + PREFIX "${SM_EXTERN_DIR}/ffmpeg-linux" + GIT_REPOSITORY "git://source.ffmpeg.org/ffmpeg.git" + GIT_TAG "n2.1.3" + CONFIGURE_COMMAND "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg/configure" "--enable-gpl" "--disable-programs" "--disable-doc" "--disable-avdevice" "--disable-swresample" "--disable-postproc" "--disable-avfilter" "--disable-shared" "--enable-static" + BUILD_COMMAND "make" + UPDATE_COMMAND "" + INSTALL_COMMAND "" + TEST_COMMAND "" + ) + set(HAS_FFMPEG TRUE) + else() + set(HAS_FFMPEG FALSE) + endif() + + find_package(OpenGL REQUIRED) + if (NOT ${OPENGL_FOUND}) + message(FATAL_ERROR "OpenGL required to compile StepMania.") + endif() + + find_package(GLEW REQUIRED) + if (NOT ${GLEW_FOUND}) + message(FATAL_ERROR "GLEW required to compile StepMania.") + endif() + + test_big_endian(BIGENDIAN) + if (${BIGENDIAN}) + set(ENDIANNESS "ENDIAN_BIG") + endif() + +endif() + + +# The external libraries need to be included. +add_subdirectory(extern) + +# The internal libraries and eventual executable to be used. +add_subdirectory(src) + diff --git a/README.md b/README.md index 9b8fc26214..4fe0923a8e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,29 @@ StepMania ========= +StepMania is an advanced cross-platform rhythm game for home and arcade use. + Advanced cross-platform rhythm game for home and arcade use. +##Installing from Source## + +StepMania can be compiled using [CMake](http://http://www.cmake.org/). More information about using CMake can be found in both the `Build` directory and CMake's documentation. + +##Build Status## + +We use Travis as our continuous integration server. The status can be found below. + [![Build Status](https://travis-ci.org/stepmania/stepmania.svg?branch=master)](https://travis-ci.org/stepmania/stepmania) -Source is all MIT Licensed, songs are CC-NC, builds with MAD or GPL-licensed FFMPEG codecs are GPL. +##Resources## * Website: http://www.stepmania.com/ * IRC: irc.freenode.net/#stepmania-devs +* Theming Wiki: http://goo.gl/SO7W5 +* Lua Documentation for Themes: http://goo.gl/XNiov + +##Licensing Terms## + +* All of the our source code is under the [MIT license](http://opensource.org/licenses/MIT). +* Any songs that are included within this repository are under the [CC-NC license](https://creativecommons.org/). +* The [MAD library](http://www.underbit.com/products/mad/) and [FFmpeg codecs](https://www.ffmpeg.org/) when built with our code use the [GPL license](http://www.gnu.org). \ No newline at end of file diff --git a/Xcode/stepmania.xcodeproj/project.pbxproj b/Xcode/stepmania.xcodeproj/project.pbxproj index afa80d112a..89aa66c2ab 100644 --- a/Xcode/stepmania.xcodeproj/project.pbxproj +++ b/Xcode/stepmania.xcodeproj/project.pbxproj @@ -7965,6 +7965,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8003,6 +8004,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8041,6 +8043,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8079,6 +8082,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8116,6 +8120,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8153,6 +8158,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8188,6 +8194,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8234,6 +8241,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8280,6 +8288,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -8604,6 +8613,7 @@ GCC_MODEL_TUNING = G5; GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = "tommath-sm5"; SYMROOT = "$(SRCROOT)/build"; @@ -8620,6 +8630,7 @@ GCC_MODEL_TUNING = G5; GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = "tommath-sm5"; SYMROOT = "$(SRCROOT)/build"; @@ -8636,6 +8647,7 @@ GCC_ENABLE_CPP_RTTI = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INSTALL_PATH = /usr/local/lib; KEEP_PRIVATE_EXTERNS = YES; PRODUCT_NAME = "tomcrypt-sm5"; @@ -8657,6 +8669,7 @@ "DEBUG=1", ); GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INSTALL_PATH = /usr/local/lib; KEEP_PRIVATE_EXTERNS = YES; PRODUCT_NAME = "tomcrypt-sm5"; @@ -8686,6 +8699,7 @@ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO; GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_SHADOW = NO; GCC_WARN_SIGN_COMPARE = NO; HEADER_SEARCH_PATHS = "$(SRCROOT)/../src/mad-0.15.1b"; @@ -8716,6 +8730,7 @@ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO; GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_SHADOW = NO; GCC_WARN_SIGN_COMPARE = NO; HEADER_SEARCH_PATHS = "$(SRCROOT)/../src/mad-0.15.1b"; @@ -8747,6 +8762,7 @@ GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = NO; GCC_WARN_ABOUT_POINTER_SIGNEDNESS = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_SHADOW = NO; GCC_WARN_SIGN_COMPARE = NO; HEADER_SEARCH_PATHS = "$(SRCROOT)/../src/mad-0.15.1b"; @@ -8928,6 +8944,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_SHADOW = NO; INSTALL_PATH = /usr/local/lib; OBJROOT = "$(SRCROOT)/build"; @@ -8985,6 +9002,7 @@ GCC_MODEL_TUNING = G5; GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INSTALL_PATH = /usr/local/lib; PRODUCT_NAME = "tommath-sm5"; SYMROOT = "$(SRCROOT)/build"; @@ -9001,6 +9019,7 @@ GCC_ENABLE_CPP_RTTI = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INSTALL_PATH = /usr/local/lib; KEEP_PRIVATE_EXTERNS = YES; PRODUCT_NAME = "tomcrypt-sm5"; @@ -9124,6 +9143,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_SHADOW = NO; INSTALL_PATH = /usr/local/lib; OBJROOT = "$(SRCROOT)/build"; @@ -9148,6 +9168,7 @@ GCC_WARN_64_TO_32_BIT_CONVERSION = NO; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO; GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_SHADOW = NO; INSTALL_PATH = /usr/local/lib; OBJROOT = "$(SRCROOT)/build"; @@ -9176,6 +9197,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -9213,6 +9235,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; @@ -9250,6 +9273,7 @@ GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO; GCC_WARN_CHECK_SWITCH_STATEMENTS = NO; GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = NO; + GCC_WARN_INHIBIT_ALL_WARNINGS = YES; GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = NO; GCC_WARN_MISSING_PARENTHESES = NO; GCC_WARN_NON_VIRTUAL_DESTRUCTOR = NO; diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt new file mode 100644 index 0000000000..0620eb04d2 --- /dev/null +++ b/extern/CMakeLists.txt @@ -0,0 +1,17 @@ +include(CMakeProject-lua.cmake) +include(CMakeProject-glew.cmake) +include(CMakeProject-json.cmake) +include(CMakeProject-pcre.cmake) +include(CMakeProject-tomcrypt.cmake) +include(CMakeProject-tommath.cmake) +if (APPLE OR MSVC) + include(CMakeProject-zlib.cmake) +endif() +include(CMakeProject-png.cmake) + +if (NOT MSVC) + include(CMakeProject-jpeg.cmake) + if (APPLE) + include(CMakeProject-mad.cmake) + endif() +endif() diff --git a/extern/CMakeProject-glew.cmake b/extern/CMakeProject-glew.cmake new file mode 100644 index 0000000000..1608bb5770 --- /dev/null +++ b/extern/CMakeProject-glew.cmake @@ -0,0 +1,16 @@ +set(GLEW_SRC "glew-1.5.8/src/glew.c") + +source_group("" FILES ${GLEW_SRC}) + +add_library("glew" ${GLEW_SRC}) + +set_property(TARGET "glew" PROPERTY FOLDER "External Libraries") + +target_include_directories("glew" PUBLIC "glew-1.5.8/include") + +sm_add_compile_definition("glew" GLEW_STATIC) + +if(MSVC) + sm_add_compile_definition("glew" _MBCS) +endif(MSVC) + diff --git a/extern/CMakeProject-jpeg.cmake b/extern/CMakeProject-jpeg.cmake new file mode 100644 index 0000000000..b315c9c8fb --- /dev/null +++ b/extern/CMakeProject-jpeg.cmake @@ -0,0 +1,66 @@ +list(APPEND JPEG_SRC + "libjpeg/ansi2knr.c" + "libjpeg/cdjpeg.c" + "libjpeg/cjpeg.c" + "libjpeg/ckconfig.c" + "libjpeg/djpeg.c" + "libjpeg/jaricom.c" + "libjpeg/jcapimin.c" + "libjpeg/jcapistd.c" + "libjpeg/jcarith.c" + "libjpeg/jccoefct.c" + "libjpeg/jccolor.c" + "libjpeg/jcdctmgr.c" + "libjpeg/jchuff.c" + "libjpeg/jcinit.c" + "libjpeg/jcmainct.c" + "libjpeg/jcmarker.c" + "libjpeg/jcmaster.c" + "libjpeg/jcomapi.c" + "libjpeg/jcparam.c" + "libjpeg/jcprepct.c" + "libjpeg/jcsample.c" + "libjpeg/jctrans.c" + "libjpeg/jdapimin.c" + "libjpeg/jdapistd.c" + "libjpeg/jdarith.c" + "libjpeg/jdatadst.c" + "libjpeg/jdcoefct.c" + "libjpeg/jdcolor.c" + "libjpeg/jddctmgr.c" + "libjpeg/jdhuff.c" + "libjpeg/jdinput.c" + "libjpeg/jdmainct.c" + "libjpeg/jdmarker.c" + "libjpeg/jdmaster.c" + "libjpeg/jdmerge.c" + "libjpeg/jdpostct.c" + "libjpeg/jdsample.c" + "libjpeg/jdtrans.c" + "libjpeg/jerror.c" + "libjpeg/jfdctflt.c" + "libjpeg/jfdctfst.c" + "libjpeg/jfdctint.c" + "libjpeg/jutils.c" + "libjpeg/jidctflt.c" + "libjpeg/jidctfst.c" + "libjpeg/jidctint.c" + "libjpeg/jmemansi.c" + "libjpeg/jmemmgr.c" + "libjpeg/jmemname.c" + "libjpeg/jmemnobs.c" + "libjpeg/jquant1.c" + "libjpeg/jquant2.c" +) + +source_group("" FILES ${JPEG_SRC}) + +add_library("jpeg" ${JPEG_SRC}) + +disable_project_warnings("jpeg") + +set_property(TARGET "jpeg" PROPERTY FOLDER "External Libraries") + +if(MSVC) + sm_add_compile_definition("jpeg" _CRT_SECURE_NO_WARNINGS) +endif(MSVC) \ No newline at end of file diff --git a/extern/CMakeProject-json.cmake b/extern/CMakeProject-json.cmake new file mode 100644 index 0000000000..d0ca5cadac --- /dev/null +++ b/extern/CMakeProject-json.cmake @@ -0,0 +1,30 @@ +list(APPEND JSON_SRC + "jsoncpp/src/lib_json/json_reader.cpp" + "jsoncpp/src/lib_json/json_value.cpp" + "jsoncpp/src/lib_json/json_writer.cpp" +) + +list(APPEND JSON_HPP + "jsoncpp/include/json/config.h" + "jsoncpp/include/json/features.h" + "jsoncpp/include/json/forwards.h" + "jsoncpp/include/json/json.h" + "jsoncpp/include/json/reader.h" + "jsoncpp/include/json/value.h" + "jsoncpp/include/json/writer.h" +) + +source_group("" FILES ${JSON_SRC} ${JSON_HPP}) + +add_library("jsoncpp" ${JSON_SRC} ${JSON_HPP}) + +set_property(TARGET "jsoncpp" PROPERTY FOLDER "External Libraries") + +if(MSVC) + sm_add_compile_definition("jsoncpp" _CRT_SECURE_NO_WARNINGS) +endif() + +disable_project_warnings("jsoncpp") + +target_include_directories("jsoncpp" PUBLIC "jsoncpp/include") + diff --git a/extern/CMakeProject-lua.cmake b/extern/CMakeProject-lua.cmake new file mode 100644 index 0000000000..9c0b462200 --- /dev/null +++ b/extern/CMakeProject-lua.cmake @@ -0,0 +1,73 @@ +set(LUA_SRC + "lua-5.1/src/lapi.c" + "lua-5.1/src/lauxlib.c" + "lua-5.1/src/lbaselib.c" + "lua-5.1/src/lcode.c" + "lua-5.1/src/ldblib.c" + "lua-5.1/src/ldebug.c" + "lua-5.1/src/ldo.c" + "lua-5.1/src/ldump.c" + "lua-5.1/src/lfunc.c" + "lua-5.1/src/lgc.c" + "lua-5.1/src/linit.c" + "lua-5.1/src/liolib.c" + "lua-5.1/src/llex.c" + "lua-5.1/src/lmathlib.c" + "lua-5.1/src/lmem.c" + "lua-5.1/src/loadlib.c" + "lua-5.1/src/lobject.c" + "lua-5.1/src/lopcodes.c" + "lua-5.1/src/loslib.c" + "lua-5.1/src/lparser.c" + "lua-5.1/src/lstate.c" + "lua-5.1/src/lstring.c" + "lua-5.1/src/lstrlib.c" + "lua-5.1/src/ltable.c" + "lua-5.1/src/ltablib.c" + "lua-5.1/src/ltm.c" + "lua-5.1/src/lua.c" + "lua-5.1/src/lundump.c" + "lua-5.1/src/lvm.c" + "lua-5.1/src/lzio.c" +) + +set(LUA_HPP + "lua-5.1/src/lapi.h" + "lua-5.1/src/lauxlib.h" + "lua-5.1/src/lcode.h" + "lua-5.1/src/ldebug.h" + "lua-5.1/src/lfunc.h" + "lua-5.1/src/lgc.h" + "lua-5.1/src/llex.h" + "lua-5.1/src/llimits.h" + "lua-5.1/src/lmem.h" + "lua-5.1/src/lobject.h" + "lua-5.1/src/lopcodes.h" + "lua-5.1/src/lparser.h" + "lua-5.1/src/lstate.h" + "lua-5.1/src/lstring.h" + "lua-5.1/src/ltable.h" + "lua-5.1/src/ltm.h" + "lua-5.1/src/lua.h" + "lua-5.1/src/luaconf.h" + "lua-5.1/src/lualib.h" + "lua-5.1/src/lundump.h" + "lua-5.1/src/lvm.h" + "lua-5.1/src/lzio.h" +) + +source_group("" FILES ${LUA_SRC}) +source_group("" FILES ${LUA_HPP}) + +add_library("lua-5.1" ${LUA_SRC} ${LUA_HPP}) + +set_property(TARGET "lua-5.1" PROPERTY FOLDER "External Libraries") + +# include_directories(src) + +if(MSVC) + sm_add_compile_definition("lua-5.1" _CRT_SECURE_NO_WARNINGS) +endif(MSVC) + +disable_project_warnings("lua-5.1") + diff --git a/extern/CMakeProject-mad.cmake b/extern/CMakeProject-mad.cmake new file mode 100644 index 0000000000..4ed0dd47f9 --- /dev/null +++ b/extern/CMakeProject-mad.cmake @@ -0,0 +1,52 @@ +list(APPEND MAD_SRC + "mad-0.15.1b/bit.c" + "mad-0.15.1b/decoder.c" + "mad-0.15.1b/fixed.c" + "mad-0.15.1b/frame.c" + "mad-0.15.1b/huffman.c" + "mad-0.15.1b/layer12.c" + "mad-0.15.1b/layer3.c" + "mad-0.15.1b/stream.c" + "mad-0.15.1b/synth.c" + "mad-0.15.1b/timer.c" + "mad-0.15.1b/version.c" +) + +list(APPEND MAD_HPP + "mad-0.15.1b/bit.h" + "mad-0.15.1b/decoder.h" + "mad-0.15.1b/fixed.h" + "mad-0.15.1b/frame.h" + "mad-0.15.1b/global.h" + "mad-0.15.1b/huffman.h" + "mad-0.15.1b/layer12.h" + "mad-0.15.1b/layer3.h" + "mad-0.15.1b/mad.h" + "mad-0.15.1b/stream.h" + "mad-0.15.1b/synth.h" + "mad-0.15.1b/timer.h" + "mad-0.15.1b/version.h" +) + +source_group("" FILES ${MAD_SRC} ${MAD_HPP}) + +add_library("mad" ${MAD_SRC} ${MAD_HPP}) + +set_property(TARGET "mad" PROPERTY FOLDER "External Libraries") + +disable_project_warnings("mad") + +if(MSVC) + sm_add_compile_definition("mad" _CRT_SECURE_NO_WARNINGS) +elseif(APPLE) + sm_add_compile_definition("mad" HAVE_ASSERT_H=1) + sm_add_compile_definition("mad" HAVE_DLFCN_H=1) + sm_add_compile_definition("mad" HAVE_ERRNO_H=1) + sm_add_compile_definition("mad" HAVE_FORK=1) + sm_add_compile_definition("mad" HAVE_INTTYPES_H=1) + sm_add_compile_definition("mad" HAVE_LIMITS_H=1) + sm_add_compile_definition("mad" HAVE_MEMORY_H=1) + sm_add_compile_definition("mad" HAVE_WAITPID=1) + sm_add_compile_definition("mad" SIZEOF_LONG=4) + sm_add_compile_definition("mad" FPM_64BIT=1) +endif(MSVC) \ No newline at end of file diff --git a/extern/CMakeProject-pcre.cmake b/extern/CMakeProject-pcre.cmake new file mode 100644 index 0000000000..69ceefb406 --- /dev/null +++ b/extern/CMakeProject-pcre.cmake @@ -0,0 +1,21 @@ +set(PCRE_SRC + "pcre/get.c" + "pcre/maketables.c" + "pcre/pcre.c" + "pcre/study.c" +) + +set(PCRE_HPP + "pcre/internal.h" + "pcre/pcre.h" +) + +source_group("" FILES ${PCRE_SRC}) +source_group("" FILES ${PCRE_HPP}) + +add_library("pcre" ${PCRE_SRC} ${PCRE_HPP}) + +set_property(TARGET "pcre" PROPERTY FOLDER "External Libraries") + +disable_project_warnings("pcre") + diff --git a/extern/CMakeProject-png.cmake b/extern/CMakeProject-png.cmake new file mode 100644 index 0000000000..9c9633458b --- /dev/null +++ b/extern/CMakeProject-png.cmake @@ -0,0 +1,44 @@ +set(PNG_SRC + "libpng/include/png.c" + "libpng/include/pngerror.c" + "libpng/include/pngget.c" + "libpng/include/pngmem.c" + "libpng/include/pngpread.c" + "libpng/include/pngread.c" + "libpng/include/pngrio.c" + "libpng/include/pngrtran.c" + "libpng/include/pngrutil.c" + "libpng/include/pngset.c" + "libpng/include/pngtest.c" + "libpng/include/pngtrans.c" + "libpng/include/pngwio.c" + "libpng/include/pngwrite.c" + "libpng/include/pngwtran.c" + "libpng/include/pngwutil.c" +) + +set(PNG_HPP + "libpng/include/png.h" + "libpng/include/pngconf.h" + "libpng/include/pngdebug.h" + "libpng/include/pnginfo.h" + "libpng/include/pnglibconf.h" + "libpng/include/pngpriv.h" + "libpng/include/pngstruct.h" +) + +source_group("" FILES ${PNG_SRC}) +source_group("" FILES ${PNG_HPP}) + +add_library("png" ${PNG_SRC} ${PNG_HPP}) + +set_property(TARGET "png" PROPERTY FOLDER "External Libraries") + +disable_project_warnings("png") + +if(MSVC) + sm_add_compile_definition("png" _CRT_SECURE_NO_WARNINGS) +endif() + +target_include_directories("png" PUBLIC "zlib") + diff --git a/extern/CMakeProject-tomcrypt.cmake b/extern/CMakeProject-tomcrypt.cmake new file mode 100644 index 0000000000..5e6d70b26c --- /dev/null +++ b/extern/CMakeProject-tomcrypt.cmake @@ -0,0 +1,283 @@ +set(TOMDIR "${SM_SRC_DIR}/libtomcrypt") + +list(APPEND TOMCRYPT_MISC_CRYPT + "${TOMDIR}/src/misc/crypt/crypt.c" + "${TOMDIR}/src/misc/crypt/crypt_argchk.c" + "${TOMDIR}/src/misc/crypt/crypt_cipher_descriptor.c" + "${TOMDIR}/src/misc/crypt/crypt_cipher_is_valid.c" + "${TOMDIR}/src/misc/crypt/crypt_find_cipher.c" + "${TOMDIR}/src/misc/crypt/crypt_find_cipher_any.c" + "${TOMDIR}/src/misc/crypt/crypt_find_cipher_id.c" + "${TOMDIR}/src/misc/crypt/crypt_find_hash.c" + "${TOMDIR}/src/misc/crypt/crypt_find_hash_any.c" + "${TOMDIR}/src/misc/crypt/crypt_find_hash_id.c" + "${TOMDIR}/src/misc/crypt/crypt_find_hash_oid.c" + "${TOMDIR}/src/misc/crypt/crypt_find_prng.c" + "${TOMDIR}/src/misc/crypt/crypt_fsa.c" + "${TOMDIR}/src/misc/crypt/crypt_hash_descriptor.c" + "${TOMDIR}/src/misc/crypt/crypt_hash_is_valid.c" + "${TOMDIR}/src/misc/crypt/crypt_ltc_mp_descriptor.c" + "${TOMDIR}/src/misc/crypt/crypt_prng_descriptor.c" + "${TOMDIR}/src/misc/crypt/crypt_prng_is_valid.c" + "${TOMDIR}/src/misc/crypt/crypt_register_cipher.c" + "${TOMDIR}/src/misc/crypt/crypt_register_hash.c" + "${TOMDIR}/src/misc/crypt/crypt_register_prng.c" + "${TOMDIR}/src/misc/crypt/crypt_unregister_cipher.c" + "${TOMDIR}/src/misc/crypt/crypt_unregister_hash.c" + "${TOMDIR}/src/misc/crypt/crypt_unregister_prng.c" +) + +source_group("src\\\\misc\\\\crypt" FILES ${TOMCRYPT_MISC_CRYPT}) + +set(TOMCRYPT_CIPHERS_AES + "${TOMDIR}/src/ciphers/aes/aes.c" +) + +source_group("src\\\\ciphers\\\\aes" FILES ${TOMCRYPT_CIPHERS_AES}) + +set(TOMCRYPT_HASHES + "${TOMDIR}/src/hashes/md5.c" + "${TOMDIR}/src/hashes/sha1.c" + "${TOMDIR}/src/hashes/helper/hash_memory.c" +) + +source_group("src\\\\hashes" FILES ${TOMCRYPT_HASHES}) + +list(APPEND TOMCRYPT_MISC + "${TOMDIR}/src/misc/burn_stack.c" + "${TOMDIR}/src/misc/error_to_string.c" + "${TOMDIR}/src/misc/zeromem.c" +) + +source_group("src\\\\misc" FILES ${TOMCRYPT_MISC}) + +set(TOMCRYPT_MISC_BASE64 + "${TOMDIR}/src/misc/base64/base64_decode.c" + "${TOMDIR}/src/misc/base64/base64_encode.c" +) + +source_group("src\\\\misc\\\\base64" FILES ${TOMCRYPT_MISC_BASE64}) + +set(TOMCRYPT_MISC_PKCS5 + "${TOMDIR}/src/misc/pkcs5/pkcs_5_1.c" + "${TOMDIR}/src/misc/pkcs5/pkcs_5_2.c" +) + +source_group("src\\\\misc\\\\pkcs5" FILES ${TOMCRYPT_MISC_PKCS5}) + +set(TOMCRYPT_MATH + "${TOMDIR}/src/math/ltm_desc.c" + "${TOMDIR}/src/math/fp/ltc_ecc_fp_mulmod.c" + "${TOMDIR}/src/math/multi.c" + "${TOMDIR}/src/math/rand_prime.c" +) + +source_group("src\\\\math" FILES ${TOMCRYPT_MATH}) + +list(APPEND TOMCRYPT_PRNGS + "${TOMDIR}/src/prngs/fortuna.c" + "${TOMDIR}/src/prngs/rc4.c" + "${TOMDIR}/src/prngs/rng_get_bytes.c" + "${TOMDIR}/src/prngs/rng_make_prng.c" + "${TOMDIR}/src/prngs/sprng.c" + "${TOMDIR}/src/prngs/yarrow.c" +) + +source_group("src\\\\prngs" FILES ${TOMCRYPT_PRNGS}) + +list(APPEND TOMCRYPT_MODES_CBC + "${TOMDIR}/src/modes/cbc/cbc_decrypt.c" + "${TOMDIR}/src/modes/cbc/cbc_done.c" + "${TOMDIR}/src/modes/cbc/cbc_encrypt.c" + "${TOMDIR}/src/modes/cbc/cbc_getiv.c" + "${TOMDIR}/src/modes/cbc/cbc_setiv.c" + "${TOMDIR}/src/modes/cbc/cbc_start.c" +) + +source_group("src\\\\modes\\\\cbc" FILES ${TOMCRYPT_MODES_CBC}) + +list(APPEND TOMCRYPT_MODES_CFB + "${TOMDIR}/src/modes/cfb/cfb_decrypt.c" + "${TOMDIR}/src/modes/cfb/cfb_done.c" + "${TOMDIR}/src/modes/cfb/cfb_encrypt.c" + "${TOMDIR}/src/modes/cfb/cfb_getiv.c" + "${TOMDIR}/src/modes/cfb/cfb_setiv.c" + "${TOMDIR}/src/modes/cfb/cfb_start.c" +) + +source_group("src\\\\modes\\\\cfb" FILES ${TOMCRYPT_MODES_CFB}) + +list(APPEND TOMCRYPT_MODES_CTR + "${TOMDIR}/src/modes/ctr/ctr_decrypt.c" + "${TOMDIR}/src/modes/ctr/ctr_done.c" + "${TOMDIR}/src/modes/ctr/ctr_encrypt.c" + "${TOMDIR}/src/modes/ctr/ctr_getiv.c" + "${TOMDIR}/src/modes/ctr/ctr_setiv.c" + "${TOMDIR}/src/modes/ctr/ctr_start.c" + "${TOMDIR}/src/modes/ctr/ctr_test.c" +) + +source_group("src\\\\modes\\\\ctr" FILES ${TOMCRYPT_MODES_CTR}) + +list(APPEND TOMCRYPT_MODES_ECB + "${TOMDIR}/src/modes/ecb/ecb_decrypt.c" + "${TOMDIR}/src/modes/ecb/ecb_done.c" + "${TOMDIR}/src/modes/ecb/ecb_encrypt.c" + "${TOMDIR}/src/modes/ecb/ecb_start.c" +) + +source_group("src\\\\modes\\\\ecb" FILES ${TOMCRYPT_MODES_ECB}) + +list(APPEND TOMCRYPT_MODES_OFB + "${TOMDIR}/src/modes/ofb/ofb_decrypt.c" + "${TOMDIR}/src/modes/ofb/ofb_done.c" + "${TOMDIR}/src/modes/ofb/ofb_encrypt.c" + "${TOMDIR}/src/modes/ofb/ofb_getiv.c" + "${TOMDIR}/src/modes/ofb/ofb_setiv.c" + "${TOMDIR}/src/modes/ofb/ofb_start.c" +) + +source_group("src\\\\modes\\\\ofb" FILES ${TOMCRYPT_MODES_OFB}) + +list(APPEND TOMCRYPT_PK_RSA + "${TOMDIR}/src/pk/rsa/rsa_decrypt_key.c" + "${TOMDIR}/src/pk/rsa/rsa_encrypt_key.c" + "${TOMDIR}/src/pk/rsa/rsa_export.c" + "${TOMDIR}/src/pk/rsa/rsa_exptmod.c" + "${TOMDIR}/src/pk/rsa/rsa_free.c" + "${TOMDIR}/src/pk/rsa/rsa_import.c" + "${TOMDIR}/src/pk/rsa/rsa_make_key.c" + "${TOMDIR}/src/pk/rsa/rsa_sign_hash.c" + "${TOMDIR}/src/pk/rsa/rsa_verify_hash.c" +) + +source_group("src\\\\pk\\\\rsa" FILES ${TOMCRYPT_PK_RSA}) + +list(APPEND TOMCRYPT_PK_PKCS1 + "${TOMDIR}/src/pk/pkcs1/pkcs_1_i2osp.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_mgf1.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_oaep_decode.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_oaep_encode.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_os2ip.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_pss_decode.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_pss_encode.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_v1_5_decode.c" + "${TOMDIR}/src/pk/pkcs1/pkcs_1_v1_5_encode.c" +) + +source_group("src\\\\pk\\\\pkcs1" FILES ${TOMCRYPT_PK_PKCS1}) + +list(APPEND TOMCRYPT_PK_DSA + "${TOMDIR}/src/pk/dsa/dsa_decrypt_key.c" + "${TOMDIR}/src/pk/dsa/dsa_encrypt_key.c" + "${TOMDIR}/src/pk/dsa/dsa_export.c" + "${TOMDIR}/src/pk/dsa/dsa_free.c" + "${TOMDIR}/src/pk/dsa/dsa_import.c" + "${TOMDIR}/src/pk/dsa/dsa_make_key.c" + "${TOMDIR}/src/pk/dsa/dsa_shared_secret.c" + "${TOMDIR}/src/pk/dsa/dsa_sign_hash.c" + "${TOMDIR}/src/pk/dsa/dsa_verify_hash.c" + "${TOMDIR}/src/pk/dsa/dsa_verify_key.c" +) + +source_group("src\\\\pk\\\\dsa" FILES ${TOMCRYPT_PK_DSA}) + +list(APPEND TOMCRYPT_PK_DER + "${TOMDIR}/src/pk/asn1/der/bit/der_decode_bit_string.c" + "${TOMDIR}/src/pk/asn1/der/bit/der_encode_bit_string.c" + "${TOMDIR}/src/pk/asn1/der/bit/der_length_bit_string.c" + "${TOMDIR}/src/pk/asn1/der/boolean/der_decode_boolean.c" + "${TOMDIR}/src/pk/asn1/der/boolean/der_encode_boolean.c" + "${TOMDIR}/src/pk/asn1/der/boolean/der_length_boolean.c" + "${TOMDIR}/src/pk/asn1/der/choice/der_decode_choice.c" + "${TOMDIR}/src/pk/asn1/der/ia5/der_decode_ia5_string.c" + "${TOMDIR}/src/pk/asn1/der/ia5/der_encode_ia5_string.c" + "${TOMDIR}/src/pk/asn1/der/ia5/der_length_ia5_string.c" + "${TOMDIR}/src/pk/asn1/der/integer/der_decode_integer.c" + "${TOMDIR}/src/pk/asn1/der/integer/der_encode_integer.c" + "${TOMDIR}/src/pk/asn1/der/integer/der_length_integer.c" + "${TOMDIR}/src/pk/asn1/der/object_identifier/der_decode_object_identifier.c" + "${TOMDIR}/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c" + "${TOMDIR}/src/pk/asn1/der/object_identifier/der_length_object_identifier.c" + "${TOMDIR}/src/pk/asn1/der/octet/der_decode_octet_string.c" + "${TOMDIR}/src/pk/asn1/der/octet/der_encode_octet_string.c" + "${TOMDIR}/src/pk/asn1/der/octet/der_length_octet_string.c" + "${TOMDIR}/src/pk/asn1/der/printable_string/der_decode_printable_string.c" + "${TOMDIR}/src/pk/asn1/der/printable_string/der_encode_printable_string.c" + "${TOMDIR}/src/pk/asn1/der/printable_string/der_length_printable_string.c" + "${TOMDIR}/src/pk/asn1/der/sequence/der_decode_sequence_ex.c" + "${TOMDIR}/src/pk/asn1/der/sequence/der_decode_sequence_flexi.c" + "${TOMDIR}/src/pk/asn1/der/sequence/der_decode_sequence_multi.c" + "${TOMDIR}/src/pk/asn1/der/sequence/der_encode_sequence_ex.c" + "${TOMDIR}/src/pk/asn1/der/sequence/der_encode_sequence_multi.c" + "${TOMDIR}/src/pk/asn1/der/sequence/der_length_sequence.c" + "${TOMDIR}/src/pk/asn1/der/sequence/der_sequence_free.c" + "${TOMDIR}/src/pk/asn1/der/set/der_encode_set.c" + "${TOMDIR}/src/pk/asn1/der/set/der_encode_setof.c" + "${TOMDIR}/src/pk/asn1/der/short_integer/der_decode_short_integer.c" + "${TOMDIR}/src/pk/asn1/der/short_integer/der_encode_short_integer.c" + "${TOMDIR}/src/pk/asn1/der/short_integer/der_length_short_integer.c" + "${TOMDIR}/src/pk/asn1/der/utctime/der_decode_utctime.c" + "${TOMDIR}/src/pk/asn1/der/utctime/der_encode_utctime.c" + "${TOMDIR}/src/pk/asn1/der/utctime/der_length_utctime.c" + "${TOMDIR}/src/pk/asn1/der/utf8/der_decode_utf8_string.c" + "${TOMDIR}/src/pk/asn1/der/utf8/der_encode_utf8_string.c" + "${TOMDIR}/src/pk/asn1/der/utf8/der_length_utf8_string.c" +) + +source_group("src\\\\pk\\\\ans1" FILES ${TOMCRYPT_PK_DER}) + +list(APPEND TOMCRYPT_SRC + ${TOMCRYPT_CIPHERS_AES} + ${TOMCRYPT_HASHES} + ${TOMCRYPT_MISC} + ${TOMCRYPT_MISC_BASE64} + ${TOMCRYPT_MISC_CRYPT} + ${TOMCRYPT_MISC_PKCS5} + ${TOMCRYPT_MATH} + ${TOMCRYPT_MODES_CBC} + ${TOMCRYPT_MODES_CFB} + ${TOMCRYPT_MODES_CTR} + ${TOMCRYPT_MODES_ECB} + ${TOMCRYPT_MODES_OFB} + ${TOMCRYPT_PRNGS} + ${TOMCRYPT_PK_RSA} + ${TOMCRYPT_PK_PKCS1} + ${TOMCRYPT_PK_DSA} + ${TOMCRYPT_PK_DER} +) + +list(APPEND TOMCRYPT_HPP + "${TOMDIR}/src/headers/tomcrypt.h" + "${TOMDIR}/src/headers/tomcrypt_argchk.h" + "${TOMDIR}/src/headers/tomcrypt_cfg.h" + "${TOMDIR}/src/headers/tomcrypt_cipher.h" + "${TOMDIR}/src/headers/tomcrypt_custom.h" + "${TOMDIR}/src/headers/tomcrypt_hash.h" + "${TOMDIR}/src/headers/tomcrypt_mac.h" + "${TOMDIR}/src/headers/tomcrypt_macros.h" + "${TOMDIR}/src/headers/tomcrypt_math.h" + "${TOMDIR}/src/headers/tomcrypt_misc.h" + "${TOMDIR}/src/headers/tomcrypt_pk.h" + "${TOMDIR}/src/headers/tomcrypt_pkcs.h" + "${TOMDIR}/src/headers/tomcrypt_prng.h" +) + +source_group("headers" FILES ${TOMCRYPT_HPP}) + +add_library("tomcrypt" ${TOMCRYPT_SRC} ${TOMCRYPT_HPP}) + +set_property(TARGET "tomcrypt" PROPERTY FOLDER "External Libraries") + +if (APPLE) + sm_add_compile_definition("tomcrypt" LTC_NO_ROLC) + sm_append_simple_target_property("tomcrypt" XCODE_ATTRIBUTE_GCC_NO_COMMON_BLOCKS "YES") + sm_append_simple_target_property("tomcrypt" XCODE_ATTRIBUTE_GCC_PREPROCESSOR_DEFINITIONS[variant=Debug] + "'CMAKE_INTDIR=\"Debug\"' LTC_NO_ROLC DEBUG=1") +elseif (MSVC) + sm_add_compile_definition("tomcrypt" _CRT_SECURE_NO_WARNINGS) +endif() + +disable_project_warnings("tomcrypt") + +target_include_directories("tomcrypt" PUBLIC "${TOMDIR}/src/headers") diff --git a/extern/CMakeProject-tommath.cmake b/extern/CMakeProject-tommath.cmake new file mode 100644 index 0000000000..5d32d47808 --- /dev/null +++ b/extern/CMakeProject-tommath.cmake @@ -0,0 +1,141 @@ +set(TOMDIR "${SM_SRC_DIR}/libtommath") + +list(APPEND TOMMATH_SRC + "${TOMDIR}/bn_error.c" + "${TOMDIR}/bn_fast_mp_invmod.c" + "${TOMDIR}/bn_fast_mp_montgomery_reduce.c" + "${TOMDIR}/bn_fast_s_mp_mul_digs.c" + "${TOMDIR}/bn_fast_s_mp_mul_high_digs.c" + "${TOMDIR}/bn_fast_s_mp_sqr.c" + "${TOMDIR}/bn_mp_2expt.c" + "${TOMDIR}/bn_mp_abs.c" + "${TOMDIR}/bn_mp_add.c" + "${TOMDIR}/bn_mp_addmod.c" + "${TOMDIR}/bn_mp_add_d.c" + "${TOMDIR}/bn_mp_and.c" + "${TOMDIR}/bn_mp_clamp.c" + "${TOMDIR}/bn_mp_clear.c" + "${TOMDIR}/bn_mp_clear_multi.c" + "${TOMDIR}/bn_mp_cmp.c" + "${TOMDIR}/bn_mp_cmp_d.c" + "${TOMDIR}/bn_mp_cmp_mag.c" + "${TOMDIR}/bn_mp_cnt_lsb.c" + "${TOMDIR}/bn_mp_copy.c" + "${TOMDIR}/bn_mp_count_bits.c" + "${TOMDIR}/bn_mp_div.c" + "${TOMDIR}/bn_mp_div_2.c" + "${TOMDIR}/bn_mp_div_2d.c" + "${TOMDIR}/bn_mp_div_3.c" + "${TOMDIR}/bn_mp_div_d.c" + "${TOMDIR}/bn_mp_dr_is_modulus.c" + "${TOMDIR}/bn_mp_dr_reduce.c" + "${TOMDIR}/bn_mp_dr_setup.c" + "${TOMDIR}/bn_mp_exch.c" + "${TOMDIR}/bn_mp_expt_d.c" + "${TOMDIR}/bn_mp_exptmod.c" + "${TOMDIR}/bn_mp_exptmod_fast.c" + "${TOMDIR}/bn_mp_exteuclid.c" + "${TOMDIR}/bn_mp_fread.c" + "${TOMDIR}/bn_mp_fwrite.c" + "${TOMDIR}/bn_mp_gcd.c" + "${TOMDIR}/bn_mp_get_int.c" + "${TOMDIR}/bn_mp_grow.c" + "${TOMDIR}/bn_mp_init.c" + "${TOMDIR}/bn_mp_init_copy.c" + "${TOMDIR}/bn_mp_init_multi.c" + "${TOMDIR}/bn_mp_init_set.c" + "${TOMDIR}/bn_mp_init_set_int.c" + "${TOMDIR}/bn_mp_init_size.c" + "${TOMDIR}/bn_mp_invmod.c" + "${TOMDIR}/bn_mp_invmod_slow.c" + "${TOMDIR}/bn_mp_is_square.c" + "${TOMDIR}/bn_mp_jacobi.c" + "${TOMDIR}/bn_mp_karatsuba_mul.c" + "${TOMDIR}/bn_mp_karatsuba_sqr.c" + "${TOMDIR}/bn_mp_lcm.c" + "${TOMDIR}/bn_mp_lshd.c" + "${TOMDIR}/bn_mp_mod.c" + "${TOMDIR}/bn_mp_mod_2d.c" + "${TOMDIR}/bn_mp_mod_d.c" + "${TOMDIR}/bn_mp_montgomery_calc_normalization.c" + "${TOMDIR}/bn_mp_montgomery_reduce.c" + "${TOMDIR}/bn_mp_montgomery_setup.c" + "${TOMDIR}/bn_mp_mul.c" + "${TOMDIR}/bn_mp_mul_2.c" + "${TOMDIR}/bn_mp_mul_2d.c" + "${TOMDIR}/bn_mp_mul_d.c" + "${TOMDIR}/bn_mp_mulmod.c" + "${TOMDIR}/bn_mp_n_root.c" + "${TOMDIR}/bn_mp_neg.c" + "${TOMDIR}/bn_mp_or.c" + "${TOMDIR}/bn_mp_prime_fermat.c" + "${TOMDIR}/bn_mp_prime_is_divisible.c" + "${TOMDIR}/bn_mp_prime_is_prime.c" + "${TOMDIR}/bn_mp_prime_miller_rabin.c" + "${TOMDIR}/bn_mp_prime_next_prime.c" + "${TOMDIR}/bn_mp_prime_rabin_miller_trials.c" + "${TOMDIR}/bn_mp_prime_random_ex.c" + "${TOMDIR}/bn_mp_radix_size.c" + "${TOMDIR}/bn_mp_radix_smap.c" + "${TOMDIR}/bn_mp_rand.c" + "${TOMDIR}/bn_mp_read_radix.c" + "${TOMDIR}/bn_mp_read_signed_bin.c" + "${TOMDIR}/bn_mp_read_unsigned_bin.c" + "${TOMDIR}/bn_mp_reduce.c" + "${TOMDIR}/bn_mp_reduce_2k.c" + "${TOMDIR}/bn_mp_reduce_2k_setup.c" + "${TOMDIR}/bn_mp_reduce_2k_setup_l.c" + "${TOMDIR}/bn_mp_reduce_2k_l.c" + "${TOMDIR}/bn_mp_reduce_is_2k.c" + "${TOMDIR}/bn_mp_reduce_is_2k_l.c" + "${TOMDIR}/bn_mp_reduce_setup.c" + "${TOMDIR}/bn_mp_rshd.c" + "${TOMDIR}/bn_mp_set.c" + "${TOMDIR}/bn_mp_set_int.c" + "${TOMDIR}/bn_mp_shrink.c" + "${TOMDIR}/bn_mp_signed_bin_size.c" + "${TOMDIR}/bn_mp_sqr.c" + "${TOMDIR}/bn_mp_sqrmod.c" + "${TOMDIR}/bn_mp_sqrt.c" + "${TOMDIR}/bn_mp_sub.c" + "${TOMDIR}/bn_mp_sub_d.c" + "${TOMDIR}/bn_mp_submod.c" + "${TOMDIR}/bn_mp_to_signed_bin.c" + "${TOMDIR}/bn_mp_to_signed_bin_n.c" + "${TOMDIR}/bn_mp_to_unsigned_bin.c" + "${TOMDIR}/bn_mp_to_unsigned_bin_n.c" + "${TOMDIR}/bn_mp_toom_mul.c" + "${TOMDIR}/bn_mp_toom_sqr.c" + "${TOMDIR}/bn_mp_toradix.c" + "${TOMDIR}/bn_mp_toradix_n.c" + "${TOMDIR}/bn_mp_unsigned_bin_size.c" + "${TOMDIR}/bn_mp_xor.c" + "${TOMDIR}/bn_mp_zero.c" + "${TOMDIR}/bn_prime_tab.c" + "${TOMDIR}/bn_reverse.c" + "${TOMDIR}/bn_s_mp_add.c" + "${TOMDIR}/bn_s_mp_exptmod.c" + "${TOMDIR}/bn_s_mp_mul_digs.c" + "${TOMDIR}/bn_s_mp_mul_high_digs.c" + "${TOMDIR}/bn_s_mp_sqr.c" + "${TOMDIR}/bn_s_mp_sub.c" + "${TOMDIR}/bncore.c" +) + +list(APPEND TOMMATH_HPP + "${TOMDIR}/tommath.h" + "${TOMDIR}/tommath_class.h" + "${TOMDIR}/tommath_superclass.h" +) + +source_group("" FILES ${TOMMATH_SRC}) +source_group("" FILES ${TOMMATH_HPP}) + +add_library("tommath" ${TOMMATH_SRC} ${TOMMATH_HPP}) + +set_property(TARGET "tommath" PROPERTY FOLDER "External Libraries") + +disable_project_warnings("tommath") + +target_include_directories("tommath" PUBLIC ${TOMDIR}) + diff --git a/extern/CMakeProject-zlib.cmake b/extern/CMakeProject-zlib.cmake new file mode 100644 index 0000000000..0ed4184c47 --- /dev/null +++ b/extern/CMakeProject-zlib.cmake @@ -0,0 +1,44 @@ +list(APPEND ZLIB_SRC + "zlib/adler32.c" + "zlib/compress.c" + "zlib/crc32.c" + "zlib/deflate.c" + "zlib/gzclose.c" + "zlib/gzlib.c" + "zlib/gzread.c" + "zlib/gzwrite.c" + "zlib/infback.c" + "zlib/inffast.c" + "zlib/inflate.c" + "zlib/inftrees.c" + "zlib/minigzip.c" + "zlib/trees.c" + "zlib/uncompr.c" + "zlib/zutil.c" +) + +list(APPEND ZLIB_HPP + "zlib/crc32.h" + "zlib/deflate.h" + "zlib/gzguts.h" + "zlib/inffast.h" + "zlib/inffixed.h" + "zlib/inflate.h" + "zlib/inftrees.h" + "zlib/trees.h" + "zlib/zconf.h" + "zlib/zlib.h" + "zlib/zutil.h" +) + +source_group("" FILES ${ZLIB_SRC} ${ZLIB_HPP}) + +add_library("zlib" ${ZLIB_SRC} ${ZLIB_HPP}) + +set_property(TARGET "zlib" PROPERTY FOLDER "External Libraries") + +disable_project_warnings("zlib") + +if(MSVC) + sm_add_compile_definition("zlib" _MBCS) +endif(MSVC) \ No newline at end of file diff --git a/src/CMakeData-actor.cmake b/src/CMakeData-actor.cmake new file mode 100644 index 0000000000..6d39f09d92 --- /dev/null +++ b/src/CMakeData-actor.cmake @@ -0,0 +1,225 @@ +list(APPEND SMDATA_ACTOR_BASE_SRC + "Actor.cpp" + "ActorFrame.cpp" + "ActorFrameTexture.cpp" + "ActorMultiTexture.cpp" + "ActorMultiVertex.cpp" + "ActorProxy.cpp" + "ActorScroller.cpp" + "ActorSound.cpp" + "ActorUtil.cpp" + "AutoActor.cpp" + "BitmapText.cpp" + "DynamicActorScroller.cpp" + "Model.cpp" + "ModelManager.cpp" + "ModelTypes.cpp" + "Quad.cpp" + "RollingNumbers.cpp" + "Sprite.cpp" + "Tween.cpp" +) +list(APPEND SMDATA_ACTOR_BASE_HPP + "Actor.h" + "ActorFrame.h" + "ActorFrameTexture.h" + "ActorMultiTexture.h" + "ActorMultiVertex.h" + "ActorProxy.h" + "ActorScroller.h" + "ActorSound.h" + "ActorUtil.h" + "AutoActor.h" + "BitmapText.h" + "DynamicActorScroller.h" + "Model.h" + "ModelManager.h" + "ModelTypes.h" + "Quad.h" + "RollingNumbers.h" + "Sprite.h" + "Tween.h" +) + +source_group("Actors\\\\Base" FILES ${SMDATA_ACTOR_BASE_SRC} ${SMDATA_ACTOR_BASE_HPP}) + +list(APPEND SMDATA_ACTOR_GAMEPLAY_SRC + "ActiveAttackList.cpp" + "ArrowEffects.cpp" + "AttackDisplay.cpp" + "Background.cpp" + "BeginnerHelper.cpp" + "CombinedLifeMeterTug.cpp" + "DancingCharacters.cpp" + "Foreground.cpp" + "GhostArrowRow.cpp" + "HoldJudgment.cpp" + "Inventory.cpp" + "LifeMeter.cpp" + "LifeMeterBar.cpp" + "LifeMeterBattery.cpp" + "LifeMeterTime.cpp" + "LyricDisplay.cpp" + "NoteDisplay.cpp" + "NoteField.cpp" + "PercentageDisplay.cpp" + "Player.cpp" + "ReceptorArrow.cpp" + "ReceptorArrowRow.cpp" + "ScoreDisplay.cpp" + "ScoreDisplayAliveTime.cpp" + "ScoreDisplayBattle.cpp" + "ScoreDisplayCalories.cpp" + "ScoreDisplayLifeTime.cpp" + "ScoreDisplayNormal.cpp" + "ScoreDisplayOni.cpp" + "ScoreDisplayPercentage.cpp" + "ScoreDisplayRave.cpp" +) + +list(APPEND SMDATA_ACTOR_GAMEPLAY_HPP + "ActiveAttackList.h" + "ArrowEffects.h" + "AttackDisplay.h" + "Background.h" + "BeginnerHelper.h" + "CombinedLifeMeter.h" + "CombinedLifeMeterTug.h" + "DancingCharacters.h" + "Foreground.h" + "GhostArrowRow.h" + "HoldJudgment.h" + "Inventory.h" + "LifeMeter.h" + "LifeMeterBar.h" + "LifeMeterBattery.h" + "LifeMeterTime.h" + "LyricDisplay.h" + "NoteDisplay.h" + "NoteField.h" + "PercentageDisplay.h" + "Player.h" + "ReceptorArrow.h" + "ReceptorArrowRow.h" + "ScoreDisplay.h" + "ScoreDisplayAliveTime.h" + "ScoreDisplayBattle.h" + "ScoreDisplayCalories.h" + "ScoreDisplayLifeTime.h" + "ScoreDisplayNormal.h" + "ScoreDisplayOni.h" + "ScoreDisplayPercentage.h" + "ScoreDisplayRave.h" +) +source_group("Actors\\\\Gameplay" FILES ${SMDATA_ACTOR_GAMEPLAY_SRC} ${SMDATA_ACTOR_GAMEPLAY_HPP}) + +list(APPEND SMDATA_ACTOR_MENU_SRC + "BPMDisplay.cpp" + "ComboGraph.cpp" + "ControllerStateDisplay.cpp" + "CourseContentsList.cpp" + "DifficultyList.cpp" + "DualScrollBar.cpp" + "EditMenu.cpp" + "FadingBanner.cpp" + "GradeDisplay.cpp" + "GraphDisplay.cpp" + "GrooveRadar.cpp" + "HelpDisplay.cpp" + "MemoryCardDisplay.cpp" + "MenuTimer.cpp" + "ModIcon.cpp" + "ModIconRow.cpp" + "MusicWheel.cpp" + "MusicWheelItem.cpp" + "OptionRow.cpp" + "OptionsCursor.cpp" + "OptionsList.cpp" + "PaneDisplay.cpp" + "ScrollBar.cpp" + "SnapDisplay.cpp" + "TextBanner.cpp" + "WheelBase.cpp" + "WheelItemBase.cpp" + "WheelNotifyIcon.cpp" + "WorkoutGraph.cpp" +) +list(APPEND SMDATA_ACTOR_MENU_HPP + "BPMDisplay.h" + "ComboGraph.h" + "ControllerStateDisplay.h" + "CourseContentsList.h" + "DifficultyList.h" + "DualScrollBar.h" + "EditMenu.h" + "FadingBanner.h" + "GradeDisplay.h" + "GraphDisplay.h" + "GrooveRadar.h" + "HelpDisplay.h" + "MemoryCardDisplay.h" + "MenuTimer.h" + "ModIcon.h" + "ModIconRow.h" + "MusicWheel.h" + "MusicWheelItem.h" + "OptionRow.h" + "OptionsCursor.h" + "OptionsList.h" + "PaneDisplay.h" + "ScrollBar.h" + "SnapDisplay.h" + "TextBanner.h" + "WheelBase.h" + "WheelItemBase.h" + "WheelNotifyIcon.h" + "WorkoutGraph.h" +) + +if(WITH_NETWORKING) + list(APPEND SMDATA_ACTOR_MENU_SRC + "RoomInfoDisplay.cpp" + ) + list(APPEND SMDATA_ACTOR_MENU_HPP + "RoomInfoDisplay.h" + ) +endif() + +source_group("Actors\\\\Menus" FILES ${SMDATA_ACTOR_MENU_SRC} ${SMDATA_ACTOR_MENU_HPP}) + +list(APPEND SMDATA_ACTOR_GAMEPLAY_MENU_SRC + "Banner.cpp" + "BGAnimation.cpp" + "BGAnimationLayer.cpp" + "DifficultyIcon.cpp" + "MeterDisplay.cpp" + "StepsDisplay.cpp" + "StreamDisplay.cpp" + "Transition.cpp" +) + +list(APPEND SMDATA_ACTOR_GAMEPLAY_MENU_HPP + "Banner.h" + "BGAnimation.h" + "BGAnimationLayer.h" + "DifficultyIcon.h" + "MeterDisplay.h" + "StepsDisplay.h" + "StreamDisplay.h" + "Transition.h" +) + +source_group("Actors\\\\Gameplay and Menus" FILES ${SMDATA_ACTOR_GAMEPLAY_MENU_SRC} ${SMDATA_ACTOR_GAMEPLAY_MENU_HPP}) + +list(APPEND SMDATA_ALL_ACTORS_SRC + ${SMDATA_ACTOR_BASE_SRC} + ${SMDATA_ACTOR_GAMEPLAY_SRC} + ${SMDATA_ACTOR_MENU_SRC} + ${SMDATA_ACTOR_GAMEPLAY_MENU_SRC} +) +list(APPEND SMDATA_ALL_ACTORS_HPP + ${SMDATA_ACTOR_BASE_HPP} + ${SMDATA_ACTOR_GAMEPLAY_HPP} + ${SMDATA_ACTOR_MENU_HPP} + ${SMDATA_ACTOR_GAMEPLAY_MENU_HPP} +) diff --git a/src/CMakeData-arch.cmake b/src/CMakeData-arch.cmake new file mode 100644 index 0000000000..45d5c384c8 --- /dev/null +++ b/src/CMakeData-arch.cmake @@ -0,0 +1,478 @@ +list(APPEND SMDATA_ARCH_SRC + "arch/RageDriver.cpp" +) + +list(APPEND SMDATA_ARCH_HPP + "arch/arch_default.h" + "arch/RageDriver.h" +) + +source_group("Arch Specific" FILES ${SMDATA_ARCH_SRC} ${SMDATA_ARCH_HPP}) + +list(APPEND SMDATA_ARCH_THREADS_HPP + "arch/Threads/Threads.h" +) + +if(WIN32) + list(APPEND SMDATA_ARCH_THREADS_HPP + "arch/Threads/Threads_Win32.h" + ) + list(APPEND SMDATA_ARCH_THREADS_SRC + "arch/Threads/Threads_Win32.cpp" + ) +elseif(APPLE) + list(APPEND SMDATA_ARCH_THREADS_HPP + "arch/Threads/Threads_Pthreads.h" + ) + list(APPEND SMDATA_ARCH_THREADS_SRC + "arch/Threads/Threads_Pthreads.cpp" + ) +else() + if(HAS_PTHREAD) + list(APPEND SMDATA_ARCH_THREADS_HPP + "arch/Threads/Threads_Pthreads.h" + ) + list(APPEND SMDATA_ARCH_THREADS_SRC + "arch/Threads/Threads_Pthreads.cpp" + ) + endif() +endif() + +source_group("Arch Specific\\\\Threads" FILES ${SMDATA_ARCH_THREADS_SRC} ${SMDATA_ARCH_THREADS_HPP}) + +list(APPEND SMDATA_ARCH_SOUND_SRC + "arch/Sound/RageSoundDriver.cpp" + "arch/Sound/RageSoundDriver_Generic_Software.cpp" + "arch/Sound/RageSoundDriver_Null.cpp" +) + +list(APPEND SMDATA_ARCH_SOUND_HPP + "arch/Sound/RageSoundDriver.h" + "arch/Sound/RageSoundDriver_Null.h" +) + +if(WIN32) + list(APPEND SMDATA_ARCH_SOUND_SRC + "arch/Sound/DSoundHelpers.cpp" + "arch/Sound/RageSoundDriver_DSound_Software.cpp" + "arch/Sound/RageSoundDriver_WaveOut.cpp" + "arch/Sound/RageSoundDriver_WDMKS.cpp" + ) + list(APPEND SMDATA_ARCH_SOUND_HPP + "arch/Sound/DSoundHelpers.h" + "arch/Sound/RageSoundDriver_DSound_Software.h" + "arch/Sound/RageSoundDriver_WaveOut.h" + "arch/Sound/RageSoundDriver_WDMKS.h" + ) +elseif(APPLE) + list(APPEND SMDATA_ARCH_SOUND_SRC + "arch/Sound/RageSoundDriver_AU.cpp" + ) + list(APPEND SMDATA_ARCH_SOUND_HPP + "arch/Sound/RageSoundDriver_AU.h" + ) +else() # Unix + if (HAS_PULSE) + list(APPEND SMDATA_ARCH_SOUND_SRC + "arch/Sound/RageSoundDriver_PulseAudio.cpp" + ) + list(APPEND SMDATA_ARCH_SOUND_HPP + "arch/Sound/RageSoundDriver_PulseAudio.h" + ) + endif() + if (HAS_ALSA) + list(APPEND SMDATA_ARCH_SOUND_SRC + "arch/Sound/ALSA9Dynamic.cpp" + "arch/Sound/ALSA9Helpers.cpp" + "arch/Sound/RageSoundDriver_ALSA9_Software.cpp" + ) + list(APPEND SMDATA_ARCH_SOUND_HPP + "arch/Sound/ALSA9Dynamic.h" + "arch/Sound/ALSA9Functions.h" + "arch/Sound/ALSA9Helpers.h" + "arch/Sound/RageSoundDriver_ALSA9_Software.h" + ) + endif() + if (HAS_JACK) + list(APPEND SMDATA_ARCH_SOUND_SRC + "arch/Sound/RageSoundDriver_JACK.cpp" + ) + list(APPEND SMDATA_ARCH_SOUND_HPP + "arch/Sound/RageSoundDriver_JACK.h" + ) + endif() + if (HAS_OSS) + list(APPEND SMDATA_ARCH_SOUND_SRC + "arch/Sound/RageSoundDriver_OSS.cpp" + ) + list(APPEND SMDATA_ARCH_SOUND_HPP + "arch/Sound/RageSoundDriver_OSS.h" + ) + endif() +endif() + +source_group("Arch Specific\\\\Sound" FILES ${SMDATA_ARCH_SOUND_SRC} ${SMDATA_ARCH_SOUND_HPP}) + +list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_SRC + "arch/MovieTexture/MovieTexture.cpp" + "arch/MovieTexture/MovieTexture_Generic.cpp" + "arch/MovieTexture/MovieTexture_Null.cpp" +) +list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_HPP + "arch/MovieTexture/MovieTexture.h" + "arch/MovieTexture/MovieTexture_Generic.h" + "arch/MovieTexture/MovieTexture_Null.h" +) + +if(APPLE) + list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_SRC + "arch/MovieTexture/MovieTexture_FFMpeg.cpp" + ) + list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_HPP + "arch/MovieTexture/MovieTexture_FFMpeg.h" + ) +elseif(MSVC) + list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_SRC + "arch/MovieTexture/MovieTexture_FFMpeg.cpp" + ) + list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_HPP + "arch/MovieTexture/MovieTexture_FFMpeg.h" + ) +else() # Unix + if (${HAS_FFMPEG}) + list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_SRC + "arch/MovieTexture/MovieTexture_FFMpeg.cpp" + ) + list(APPEND SMDATA_ARCH_MOVIE_TEXTURE_HPP + "arch/MovieTexture/MovieTexture_FFMpeg.h" + ) + endif() +endif() + +source_group("Arch Specific\\\\Movie Texture" FILES ${SMDATA_ARCH_MOVIE_TEXTURE_SRC} ${SMDATA_ARCH_MOVIE_TEXTURE_HPP}) + +list(APPEND SMDATA_ARCH_MEMORY_SRC + "arch/MemoryCard/MemoryCardDriver.cpp" +) +list(APPEND SMDATA_ARCH_MEMORY_HPP + "arch/MemoryCard/MemoryCardDriver.h" + "arch/MemoryCard/MemoryCardDriver_Null.h" +) + +if(WIN32) + list(APPEND SMDATA_ARCH_MEMORY_SRC + "arch/MemoryCard/MemoryCardDriverThreaded_Windows.cpp" + ) + list(APPEND SMDATA_ARCH_MEMORY_HPP + "arch/MemoryCard/MemoryCardDriverThreaded_Windows.h" + ) +elseif(APPLE) + list(APPEND SMDATA_ARCH_MEMORY_SRC + "arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.cpp" + ) + list(APPEND SMDATA_ARCH_MEMORY_HPP + "arch/MemoryCard/MemoryCardDriverThreaded_MacOSX.h" + ) +elseif(LINUX) + list(APPEND SMDATA_ARCH_MEMORY_SRC + "arch/MemoryCard/MemoryCardDriverThreaded_Linux.cpp" + ) + list(APPEND SMDATA_ARCH_MEMORY_HPP + "arch/MemoryCard/MemoryCardDriverThreaded_Linux.h" + ) +endif() + +source_group("Arch Specific\\\\Memory Card" FILES ${SMDATA_ARCH_MEMORY_SRC} ${SMDATA_ARCH_MEMORY_HPP}) + +list(APPEND SMDATA_ARCH_LOWLEVEL_SRC + "arch/LowLevelWindow/LowLevelWindow.cpp" +) +list(APPEND SMDATA_ARCH_LOWLEVEL_HPP + "arch/LowLevelWindow/LowLevelWindow.h" +) + +if(WIN32) + list(APPEND SMDATA_ARCH_LOWLEVEL_SRC + "arch/LowLevelWindow/LowLevelWindow_Win32.cpp" + ) + list(APPEND SMDATA_ARCH_LOWLEVEL_HPP + "arch/LowLevelWindow/LowLevelWindow_Win32.h" + ) +elseif(APPLE) + list(APPEND SMDATA_ARCH_LOWLEVEL_SRC + "arch/LowLevelWindow/LowLevelWindow_MacOSX.mm" + ) + list(APPEND SMDATA_ARCH_LOWLEVEL_HPP + "arch/LowLevelWindow/LowLevelWindow_MacOSX.h" + ) +else(UNIX) + if (X11_FOUND) + list(APPEND SMDATA_ARCH_LOWLEVEL_SRC + "arch/LowLevelWindow/LowLevelWindow_X11.cpp" + ) + list(APPEND SMDATA_ARCH_LOWLEVEL_HPP + "arch/LowLevelWindow/LowLevelWindow_X11.h" + ) + endif() +endif(WIN32) + +source_group("Arch Specific\\\\Low Level Window" FILES ${SMDATA_ARCH_LOWLEVEL_SRC} ${SMDATA_ARCH_LOWLEVEL_HPP}) + +list(APPEND SMDATA_ARCH_LOADING_SRC + "arch/LoadingWindow/LoadingWindow.cpp" +) +list(APPEND SMDATA_ARCH_LOADING_HPP + "arch/LoadingWindow/LoadingWindow.h" +) + +if(WIN32) + list(APPEND SMDATA_ARCH_LOADING_SRC + "arch/LoadingWindow/LoadingWindow_Win32.cpp" + ) + list(APPEND SMDATA_ARCH_LOADING_HPP + "arch/LoadingWindow/LoadingWindow_Win32.h" + ) +else() + list(APPEND SMDATA_ARCH_LOADING_HPP + "arch/LoadingWindow/LoadingWindow_Null.h" + ) + if(APPLE) + list(APPEND SMDATA_ARCH_LOADING_SRC + "arch/LoadingWindow/LoadingWindow_MacOSX.mm" + ) + list(APPEND SMDATA_ARCH_LOADING_HPP + "arch/LoadingWindow/LoadingWindow_MacOSX.h" + ) + elseif(LINUX) + if (GTK2_FOUND) + list(APPEND SMDATA_ARCH_LOADING_SRC + "arch/LoadingWindow/LoadingWindow_Gtk.cpp" + ) + list(APPEND SMDATA_ARCH_LOADING_HPP + "arch/LoadingWindow/LoadingWindow_Gtk.h" + ) + endif() + endif() +endif() + +source_group("Arch Specific\\\\Loading Window" FILES ${SMDATA_ARCH_LOADING_SRC} ${SMDATA_ARCH_LOADING_HPP}) + +list(APPEND SMDATA_ARCH_LIGHTS_SRC + "arch/Lights/LightsDriver.cpp" + "arch/Lights/LightsDriver_SystemMessage.cpp" +) +list(APPEND SMDATA_ARCH_LIGHTS_HPP + "arch/Lights/LightsDriver.h" + "arch/Lights/LightsDriver_SystemMessage.h" +) + +# TODO: Confirm if Apple can use the export. +if(NOT APPLE) + list(APPEND SMDATA_ARCH_LIGHTS_SRC + "arch/Lights/LightsDriver_Export.cpp" + ) + list(APPEND SMDATA_ARCH_LIGHTS_HPP + "arch/Lights/LightsDriver_Export.h" + ) + if(WIN32) + list(APPEND SMDATA_ARCH_LIGHTS_SRC + "arch/Lights/LightsDriver_Win32Parallel.cpp" + ) + list(APPEND SMDATA_ARCH_LIGHTS_HPP + "arch/Lights/LightsDriver_Win32Parallel.h" + ) + if (WITH_MINIMAID) + list(APPEND SMDATA_ARCH_LIGHTS_SRC + "arch/Lights/LightsDriver_Win32Minimaid.cpp" + ) + list(APPEND SMDATA_ARCH_LIGHTS_HPP + "arch/Lights/LightsDriver_Win32Minimaid.h" + ) + endif() + else() # Unix/Linux TODO: Linux HAVE_PARALLEL_PORT + if(LINUX) + list(APPEND SMDATA_ARCH_LIGHTS_SRC + "arch/Lights/LightsDriver_Linux_PIUIO.cpp" + "arch/Lights/LightsDriver_Linux_PIUIO_Leds.cpp" + "arch/Lights/LightsDriver_LinuxWeedTech.cpp" + "arch/Lights/LightsDriver_LinuxParallel.cpp" + ) + list(APPEND SMDATA_ARCH_LIGHTS_HPP + "arch/Lights/LightsDriver_Linux_PIUIO.h" + "arch/Lights/LightsDriver_Linux_PIUIO_Leds.h" + "arch/Lights/LightsDriver_LinuxWeedTech.h" + "arch/Lights/LightsDriver_LinuxParallel.h" + ) + if (WITH_PARALLEL_PORT) + list(APPEND SMDATA_ARCH_LIGHTS_SRC + "arch/Lights/LightsDriver_LinuxParallel.cpp" + ) + list(APPEND SMDATA_ARCH_LIGHTS_HPP + "arch/Lights/LightsDriver_LinuxParallel.h" + ) + endif() + endif() + endif(WIN32) +endif(NOT APPLE) + +source_group("Arch Specific\\\\Lights" FILES ${SMDATA_ARCH_LIGHTS_SRC} ${SMDATA_ARCH_LIGHTS_HPP}) + +list(APPEND SMDATA_ARCH_INPUT_SRC + "arch/InputHandler/InputHandler.cpp" + "arch/InputHandler/InputHandler_MonkeyKeyboard.cpp" +) +list(APPEND SMDATA_ARCH_INPUT_HPP + "arch/InputHandler/InputHandler.h" + "arch/InputHandler/InputHandler_MonkeyKeyboard.h" +) + +if(WIN32) + list(APPEND SMDATA_ARCH_INPUT_SRC + "arch/InputHandler/InputHandler_DirectInput.cpp" + "arch/InputHandler/InputHandler_DirectInputHelper.cpp" + "arch/InputHandler/InputHandler_Win32_MIDI.cpp" + "arch/InputHandler/InputHandler_Win32_Para.cpp" + "arch/InputHandler/InputHandler_Win32_Pump.cpp" + ) + list(APPEND SMDATA_ARCH_INPUT_HPP + "arch/InputHandler/InputHandler_DirectInput.h" + "arch/InputHandler/InputHandler_DirectInputHelper.h" + "arch/InputHandler/InputHandler_Win32_MIDI.h" + "arch/InputHandler/InputHandler_Win32_Para.h" + "arch/InputHandler/InputHandler_Win32_Pump.h" + ) +elseif(APPLE) + list(APPEND SMDATA_ARCH_INPUT_SRC + "arch/InputHandler/InputHandler_MacOSX_HID.cpp" + ) + list(APPEND SMDATA_ARCH_INPUT_HPP + "arch/InputHandler/InputHandler_MacOSX_HID.h" + ) +else() # Unix/Linux + if (LINUX) + list(APPEND SMDATA_ARCH_INPUT_SRC + "arch/InputHandler/LinuxInputManager.cpp" + "arch/InputHandler/InputHandler_Linux_Joystick.cpp" + "arch/InputHandler/InputHandler_Linux_Event.cpp" + "arch/InputHandler/InputHandler_Linux_PIUIO.cpp" + ) + list(APPEND SMDATA_ARCH_INPUT_SRC + "arch/InputHandler/LinuxInputManager.h" + "arch/InputHandler/InputHandler_Linux_Joystick.h" + "arch/InputHandler/InputHandler_Linux_Event.h" + "arch/InputHandler/InputHandler_Linux_PIUIO.h" + ) + if(WITH_TTY) + list(APPEND SMDATA_ARCH_INPUT_SRC + "arch/InputHandler/InputHandler_Linux_tty.cpp" + ) + list(APPEND SMDATA_ARCH_INPUT_HPP + "arch/InputHandler/InputHandler_Linux_tty.h" + "arch/InputHandler/InputHandler_Linux_tty_keys.h" + ) + endif() + endif() + if(X11_FOUND) + list(APPEND SMDATA_ARCH_INPUT_SRC + "arch/InputHandler/InputHandler_X11.cpp" + ) + list(APPEND SMDATA_ARCH_INPUT_HPP + "arch/InputHandler/InputHandler_X11.h" + ) + endif() +endif() + +source_group("Arch Specific\\\\Input Handler" FILES ${SMDATA_ARCH_INPUT_SRC} ${SMDATA_ARCH_INPUT_HPP}) + +list(APPEND SMDATA_ARCH_DIALOG_SRC + "arch/Dialog/Dialog.cpp" + "arch/Dialog/DialogDriver.cpp" +) +list(APPEND SMDATA_ARCH_DIALOG_HPP + "arch/Dialog/Dialog.h" + "arch/Dialog/DialogDriver.h" +) + +if(WIN32) + list(APPEND SMDATA_ARCH_DIALOG_SRC + "arch/Dialog/DialogDriver_Win32.cpp" + ) + list(APPEND SMDATA_ARCH_DIALOG_HPP + "arch/Dialog/DialogDriver_Win32.h" + ) +elseif(APPLE) + list(APPEND SMDATA_ARCH_DIALOG_SRC + "arch/Dialog/DialogDriver_MacOSX.cpp" + ) + list(APPEND SMDATA_ARCH_DIALOG_HPP + "arch/Dialog/DialogDriver_MacOSX.h" + ) +endif(WIN32) + +source_group("Arch Specific\\\\Dialog" FILES ${SMDATA_ARCH_DIALOG_SRC} ${SMDATA_ARCH_DIALOG_HPP}) + +list(APPEND SMDATA_ARCH_HOOKS_SRC + "arch/ArchHooks/ArchHooks.cpp" +) +list(APPEND SMDATA_ARCH_HOOKS_HPP + "arch/ArchHooks/ArchHooks.h" +) + +if(NOT APPLE) + list(APPEND SMDATA_ARCH_HOOKS_SRC + "arch/ArchHooks/ArchHooksUtil.cpp" + ) + if(WIN32) + list(APPEND SMDATA_ARCH_HOOKS_SRC + "arch/ArchHooks/ArchHooks_Win32.cpp" + "arch/ArchHooks/ArchHooks_Win32Static.cpp" + ) + list(APPEND SMDATA_ARCH_HOOKS_HPP + "arch/ArchHooks/ArchHooks_Win32.h" + ) + else(WIN32) + list(APPEND SMDATA_ARCH_HOOKS_SRC + "arch/ArchHooks/ArchHooks_Unix.cpp" + ) + list(APPEND SMDATA_ARCH_HOOKS_HPP + "arch/ArchHooks/ArchHooks_Unix.h" + ) + endif(WIN32) +else(NOT APPLE) + list(APPEND SMDATA_ARCH_HOOKS_SRC + "arch/ArchHooks/ArchHooks_MacOSX.cpp" + ) + list(APPEND SMDATA_ARCH_HOOKS_HPP + "arch/ArchHooks/ArchHooks_MacOSX.h" + ) +endif(NOT APPLE) + +source_group("Arch Specific\\\\Arch Hooks" FILES ${SMDATA_ARCH_HOOKS_SRC} ${SMDATA_ARCH_HOOKS_HPP}) + +list(APPEND SMDATA_ALL_ARCH_SRC + ${SMDATA_ARCH_SRC} + ${SMDATA_ARCH_DIALOG_SRC} + ${SMDATA_ARCH_HOOKS_SRC} + ${SMDATA_ARCH_INPUT_SRC} + ${SMDATA_ARCH_LIGHTS_SRC} + ${SMDATA_ARCH_LOADING_SRC} + ${SMDATA_ARCH_LOWLEVEL_SRC} + ${SMDATA_ARCH_MEMORY_SRC} + ${SMDATA_ARCH_MOVIE_TEXTURE_SRC} + ${SMDATA_ARCH_SOUND_SRC} + ${SMDATA_ARCH_THREADS_SRC} +) +list(APPEND SMDATA_ALL_ARCH_HPP + ${SMDATA_ARCH_HPP} + ${SMDATA_ARCH_DIALOG_HPP} + ${SMDATA_ARCH_HOOKS_HPP} + ${SMDATA_ARCH_INPUT_HPP} + ${SMDATA_ARCH_LIGHTS_HPP} + ${SMDATA_ARCH_LOADING_HPP} + ${SMDATA_ARCH_LOWLEVEL_HPP} + ${SMDATA_ARCH_MEMORY_HPP} + ${SMDATA_ARCH_MOVIE_TEXTURE_HPP} + ${SMDATA_ARCH_SOUND_HPP} + ${SMDATA_ARCH_THREADS_HPP} +) + diff --git a/src/CMakeData-data.cmake b/src/CMakeData-data.cmake new file mode 100644 index 0000000000..eddde6b2d4 --- /dev/null +++ b/src/CMakeData-data.cmake @@ -0,0 +1,297 @@ +list(APPEND SM_DATA_LUA_SRC + "LuaBinding.cpp" + "LuaExpressionTransform.cpp" + "LuaReference.cpp" +) + +list(APPEND SM_DATA_LUA_HPP + "LuaBinding.h" + "LuaExpressionTransform.h" + "LuaReference.h" +) + +source_group("Data Structures\\\\Lua" FILES ${SM_DATA_LUA_SRC} ${SM_DATA_LUA_HPP}) + +list(APPEND SM_DATA_FONT_SRC + "Font.cpp" + "FontCharAliases.cpp" + "FontCharmaps.cpp" +) + +list(APPEND SM_DATA_FONT_HPP + "Font.h" + "FontCharAliases.h" + "FontCharmaps.h" +) + +source_group("Data Structures\\\\Fonts" FILES ${SM_DATA_FONT_SRC} ${SM_DATA_FONT_HPP}) + +list(APPEND SM_DATA_COURSE_SRC + "Course.cpp" + "CourseLoaderCRS.cpp" + "CourseUtil.cpp" + "CourseWriterCRS.cpp" + "Trail.cpp" + "TrailUtil.cpp" +) + +list(APPEND SM_DATA_COURSE_HPP + "Course.h" + "CourseLoaderCRS.h" + "CourseUtil.h" + "CourseWriterCRS.h" + "Trail.h" + "TrailUtil.h" +) + +source_group("Data Structures\\\\Courses and Trails" FILES ${SM_DATA_COURSE_SRC} ${SM_DATA_COURSE_HPP}) + +list(APPEND SM_DATA_NOTEDATA_SRC + "NoteData.cpp" + "NoteDataUtil.cpp" + "NoteDataWithScoring.cpp" +) + +list(APPEND SM_DATA_NOTEDATA_HPP + "NoteData.h" + "NoteDataUtil.h" + "NoteDataWithScoring.h" +) + +source_group("Data Structures\\\\Note Data" FILES ${SM_DATA_NOTEDATA_SRC} ${SM_DATA_NOTEDATA_HPP}) + +list(APPEND SM_DATA_NOTELOAD_SRC + "NotesLoader.cpp" + "NotesLoaderBMS.cpp" + "NotesLoaderDWI.cpp" + "NotesLoaderJson.cpp" + "NotesLoaderKSF.cpp" + "NotesLoaderSM.cpp" + "NotesLoaderSMA.cpp" + "NotesLoaderSSC.cpp" +) + +list(APPEND SM_DATA_NOTELOAD_HPP + "NotesLoader.h" + "NotesLoaderBMS.h" + "NotesLoaderDWI.h" + "NotesLoaderJson.h" + "NotesLoaderKSF.h" + "NotesLoaderSM.h" + "NotesLoaderSMA.h" + "NotesLoaderSSC.h" +) + +source_group("Data Structures\\\\Notes Loaders" FILES ${SM_DATA_NOTELOAD_SRC} ${SM_DATA_NOTELOAD_HPP}) + +list(APPEND SM_DATA_NOTEWRITE_SRC + "NotesWriterDWI.cpp" + "NotesWriterJson.cpp" + "NotesWriterSM.cpp" + "NotesWriterSSC.cpp" +) + +list(APPEND SM_DATA_NOTEWRITE_HPP + "NotesWriterDWI.h" + "NotesWriterJson.h" + "NotesWriterSM.h" + "NotesWriterSSC.h" +) + +source_group("Data Structures\\\\Notes Writers" FILES ${SM_DATA_NOTEWRITE_SRC} ${SM_DATA_NOTEWRITE_HPP}) + +list(APPEND SM_DATA_SCORE_SRC + "ScoreKeeper.cpp" + "ScoreKeeperNormal.cpp" + "ScoreKeeperRave.cpp" + "ScoreKeeperShared.cpp" +) + +list(APPEND SM_DATA_SCORE_HPP + "ScoreKeeper.h" + "ScoreKeeperNormal.h" + "ScoreKeeperRave.h" + "ScoreKeeperShared.h" +) + +source_group("Data Structures\\\\Score Keepers" FILES ${SM_DATA_SCORE_SRC} ${SM_DATA_SCORE_HPP}) + +list(APPEND SM_DATA_SONG_SRC + "Song.cpp" + "SongCacheIndex.cpp" + "SongOptions.cpp" + "SongPosition.cpp" + "SongUtil.cpp" +) + +list(APPEND SM_DATA_SONG_HPP + "Song.h" + "SongCacheIndex.h" + "SongOptions.h" + "SongPosition.h" + "SongUtil.h" +) + +source_group("Data Structures\\\\Songs" FILES ${SM_DATA_SONG_SRC} ${SM_DATA_SONG_HPP}) + +list(APPEND SM_DATA_STEPS_SRC + "Steps.cpp" + "StepsUtil.cpp" + "Style.cpp" + "StyleUtil.cpp" +) + +list(APPEND SM_DATA_STEPS_HPP + "Steps.h" + "StepsUtil.h" + "Style.h" + "StyleUtil.h" +) + +source_group("Data Structures\\\\Steps and Styles" FILES ${SM_DATA_STEPS_SRC} ${SM_DATA_STEPS_HPP}) + +list(APPEND SM_DATA_REST_SRC + "AdjustSync.cpp" + "Attack.cpp" + "AutoKeysounds.cpp" + "BackgroundUtil.cpp" + "BannerCache.cpp" + "Character.cpp" + "CodeDetector.cpp" + "CodeSet.cpp" + "CubicSpline.cpp" + "Command.cpp" + "CommonMetrics.cpp" + "ControllerStateDisplay.cpp" + "CreateZip.cpp" + "CryptHelpers.cpp" + "DateTime.cpp" + "Difficulty.cpp" + "EnumHelper.cpp" + "FileDownload.cpp" + "Game.cpp" + "GameCommand.cpp" + "GameConstantsAndTypes.cpp" + "GameInput.cpp" + "GameplayAssist.cpp" + "GamePreferences.cpp" + "Grade.cpp" + "HighScore.cpp" + "Inventory.cpp" + "JsonUtil.cpp" + "LocalizedString.cpp" + "LyricsLoader.cpp" + "ModsGroup.cpp" + "NoteTypes.cpp" + "OptionRowHandler.cpp" + "PlayerAI.cpp" + "PlayerNumber.cpp" + "PlayerOptions.cpp" + "PlayerStageStats.cpp" + "PlayerState.cpp" + "Preference.cpp" + "Profile.cpp" + "RadarValues.cpp" + "RandomSample.cpp" + "SampleHistory.cpp" + "ScreenDimensions.cpp" + "SoundEffectControl.cpp" + "StageStats.cpp" + "TimingData.cpp" + "TimingSegments.cpp" + "TitleSubstitution.cpp" +) + +list(APPEND SM_DATA_REST_HPP + "AdjustSync.h" + "Attack.h" + "AutoKeysounds.h" + "BackgroundUtil.h" + "BannerCache.h" + "Character.h" + "CodeDetector.h" + "CodeSet.h" + "Command.h" + "CommonMetrics.h" + "ControllerStateDisplay.h" + "CreateZip.h" + "CryptHelpers.h" + "CubicSpline.h" + "DateTime.h" + "DisplayResolutions.h" + "Difficulty.h" + "EnumHelper.h" + "FileDownload.h" + "Foreach.h" + "Game.h" + "GameCommand.h" + "GameConstantsAndTypes.h" + "GameInput.h" + "GameplayAssist.h" + "GamePreferences.h" + "Grade.h" + "HighScore.h" + "InputEventPlus.h" + "Inventory.h" + "JsonUtil.h" + "LocalizedString.h" + "LyricsLoader.h" + "ModsGroup.h" + "NoteTypes.h" + "OptionRowHandler.h" + "PlayerAI.h" + "PlayerNumber.h" + "PlayerOptions.h" + "PlayerStageStats.h" + "PlayerState.h" + "Preference.h" + "Profile.h" + "RadarValues.h" + "RandomSample.h" + "SampleHistory.h" + "ScreenDimensions.h" + "SoundEffectControl.h" + "SubscriptionManager.h" + "StageStats.h" + "ThemeMetric.h" + "TimingData.h" + "TimingSegments.h" + "TitleSubstitution.h" +) + +if(WITH_NETWORKING) + list(APPEND SM_DATA_REST_SRC + "RoomWheel.cpp" + ) + list(APPEND SM_DATA_REST_HPP + "RoomWheel.h" + ) +endif() + +source_group("Data Structures\\\\Misc Objects" FILES ${SM_DATA_REST_SRC} ${SM_DATA_REST_HPP}) + +list(APPEND SMDATA_ALL_DATA_SRC + ${SM_DATA_COURSE_SRC} + ${SM_DATA_FONT_SRC} + ${SM_DATA_LUA_SRC} + ${SM_DATA_NOTEDATA_SRC} + ${SM_DATA_NOTELOAD_SRC} + ${SM_DATA_NOTEWRITE_SRC} + ${SM_DATA_SCORE_SRC} + ${SM_DATA_SONG_SRC} + ${SM_DATA_STEPS_SRC} + ${SM_DATA_REST_SRC} +) + +list(APPEND SMDATA_ALL_DATA_HPP + ${SM_DATA_COURSE_HPP} + ${SM_DATA_FONT_HPP} + ${SM_DATA_LUA_HPP} + ${SM_DATA_NOTEDATA_HPP} + ${SM_DATA_NOTELOAD_HPP} + ${SM_DATA_NOTEWRITE_HPP} + ${SM_DATA_SCORE_HPP} + ${SM_DATA_SONG_HPP} + ${SM_DATA_STEPS_HPP} + ${SM_DATA_REST_HPP} +) diff --git a/src/CMakeData-gtk.cmake b/src/CMakeData-gtk.cmake new file mode 100644 index 0000000000..63b6d358aa --- /dev/null +++ b/src/CMakeData-gtk.cmake @@ -0,0 +1,29 @@ +if(NOT GTK2_FOUND) + return() +endif() + +add_library("GtkModule" + SHARED + "arch/LoadingWindow/LoadingWindow_GtkModule.cpp" + "arch/LoadingWindow/LoadingWindow_GtkModule.h" +) +sm_add_compile_definition("GtkModule" "${ENDIANNESS}") + +# It is normally not appropriate to set the prefix to the empty string. +# This is to maintain compatibility with the current source. +# At some point, it may be worth being more flexible. +set_target_properties("GtkModule" PROPERTIES PREFIX "") +set_target_properties("GtkModule" PROPERTIES OUTPUT_NAME "GtkModule") +set_target_properties("GtkModule" PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${SM_ROOT_DIR}") +set_target_properties("GtkModule" PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELEASE "${SM_ROOT_DIR}") +set_target_properties("GtkModule" PROPERTIES LIBRARY_OUTPUT_DIRECTORY_DEBUG "${SM_ROOT_DIR}") +set_target_properties("GtkModule" PROPERTIES LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${SM_ROOT_DIR}") +set_target_properties("GtkModule" PROPERTIES LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO "${SM_ROOT_DIR}") +target_link_libraries("GtkModule" ${GTK2_LIBRARIES}) +set_property(TARGET "GtkModule" PROPERTY FOLDER "Internal Libraries") +list(APPEND SM_GTK_INCLUDE_DIRS + "${SM_SRC_DIR}" + "${SM_SRC_DIR}/arch/LoadingWindow" + "${GTK2_INCLUDE_DIRS}" +) +target_include_directories("GtkModule" PUBLIC ${SM_GTK_INCLUDE_DIRS}) diff --git a/src/CMakeData-os.cmake b/src/CMakeData-os.cmake new file mode 100644 index 0000000000..8c53ac5d61 --- /dev/null +++ b/src/CMakeData-os.cmake @@ -0,0 +1,149 @@ +if(APPLE) + list(APPEND SMDATA_OS_DARWIN_SRC + "archutils/Darwin/Crash.cpp" + "archutils/Darwin/DarwinThreadHelpers.cpp" + "archutils/Darwin/HIDDevice.cpp" + "archutils/Darwin/JoystickDevice.cpp" + "archutils/Darwin/KeyboardDevice.cpp" + "archutils/Darwin/MouseDevice.cpp" + "archutils/Darwin/PumpDevice.cpp" + "archutils/Darwin/SMMain.mm" + "archutils/Darwin/SpecialDirs.cpp" + "archutils/Darwin/VectorHelper.cpp" + ) + list(APPEND SMDATA_OS_DARWIN_HPP + "archutils/Darwin/arch_setup.h" + "archutils/Darwin/Crash.h" + "archutils/Darwin/DarwinThreadHelpers.h" + "archutils/Darwin/HIDDevice.h" + "archutils/Darwin/JoystickDevice.h" + "archutils/Darwin/KeyboardDevice.h" + "archutils/Darwin/MouseDevice.h" + "archutils/Darwin/PumpDevice.h" + "archutils/Darwin/SpecialDirs.h" + "archutils/Darwin/StepMania.pch" # precompiled header. + "archutils/Darwin/VectorHelper.h" + ) + + source_group("OS Specific\\\\Darwin" FILES ${SMDATA_OS_DARWIN_SRC} ${SMDATA_OS_DARWIN_HPP}) + + if (WITH_CRASH_HANDLER) + list(APPEND SMDATA_OS_UNIX_SRC + "archutils/Unix/Backtrace.cpp" + "archutils/Unix/BacktraceNames.cpp" + "archutils/Unix/CrashHandler.cpp" + "archutils/Unix/CrashHandlerChild.cpp" + "archutils/Unix/CrashHandlerInternal.cpp" + "archutils/Unix/SignalHandler.cpp" + ) + list(APPEND SMDATA_OS_UNIX_HPP + "archutils/Unix/Backtrace.h" + "archutils/Unix/BacktraceNames.h" + "archutils/Unix/CrashHandler.h" + "archutils/Unix/CrashHandlerInternal.h" + "archutils/Unix/SignalHandler.h" + ) + endif() + + source_group("OS Specific\\\\Unix" FILES ${SMDATA_OS_UNIX_SRC} ${SMDATA_OS_UNIX_HPP}) + + list(APPEND SMDATA_OS_SRC + ${SMDATA_OS_DARWIN_SRC} + ${SMDATA_OS_UNIX_SRC} + ) + list(APPEND SMDATA_OS_HPP + ${SMDATA_OS_DARWIN_HPP} + ${SMDATA_OS_UNIX_HPP} + ) +else() + if(WIN32) + list(APPEND SMDATA_OS_SRC + "archutils/Win32/AppInstance.cpp" + "archutils/Win32/arch_setup.cpp" + "archutils/Win32/arch_time.cpp" + "archutils/Win32/CommandLine.cpp" + "archutils/Win32/Crash.cpp" + "archutils/Win32/CrashHandlerChild.cpp" + "archutils/Win32/CrashHandlerNetworking.cpp" + "archutils/Win32/DebugInfoHunt.cpp" + "archutils/Win32/DialogUtil.cpp" + "archutils/Win32/DirectXHelpers.cpp" + "archutils/Win32/ErrorStrings.cpp" + "archutils/Win32/GetFileInformation.cpp" + "archutils/Win32/GotoURL.cpp" + "archutils/Win32/GraphicsWindow.cpp" + "archutils/Win32/MessageWindow.cpp" + "archutils/Win32/RegistryAccess.cpp" + "archutils/Win32/RestartProgram.cpp" + "archutils/Win32/SpecialDirs.cpp" + "archutils/Win32/USB.cpp" + "archutils/Win32/VideoDriverInfo.cpp" + "archutils/Win32/WindowIcon.cpp" + "archutils/Win32/WindowsDialogBox.cpp" + "archutils/Win32/WindowsResources.rc" + ) + + list(APPEND SMDATA_OS_HPP + "archutils/Win32/AppInstance.h" + "archutils/Win32/arch_setup.h" + "archutils/Win32/CommandLine.h" + "archutils/Win32/Crash.h" + "archutils/Win32/CrashHandlerInternal.h" + "archutils/Win32/CrashHandlerNetworking.h" + "archutils/Win32/DebugInfoHunt.h" + "archutils/Win32/DialogUtil.h" + "archutils/Win32/DirectXHelpers.h" + "archutils/Win32/ErrorStrings.h" + "archutils/Win32/GetFileInformation.h" + "archutils/Win32/GotoURL.h" + "archutils/Win32/GraphicsWindow.h" + "archutils/Win32/MessageWindow.h" + "archutils/Win32/RegistryAccess.h" + "archutils/Win32/RestartProgram.h" + "archutils/Win32/SpecialDirs.h" + "archutils/Win32/USB.h" + "archutils/Win32/VideoDriverInfo.h" + "archutils/Win32/WindowIcon.h" + "archutils/Win32/WindowsDialogBox.h" + "archutils/Win32/WindowsResources.h" + ) + else() # Unix + list(APPEND SMDATA_OS_SRC # TODO: X11 check, crash handler check + "archutils/Unix/AssertionHandler.cpp" + "archutils/Unix/EmergencyShutdown.cpp" + "archutils/Unix/GetSysInfo.cpp" + "archutils/Unix/RunningUnderValgrind.cpp" + "archutils/Unix/SignalHandler.cpp" + "archutils/Unix/SpecialDirs.cpp" + "archutils/Unix/StackCheck.cpp" + ) + list(APPEND SMDATA_OS_HPP + "archutils/Unix/arch_setup.h" + "archutils/Unix/AssertionHandler.h" + "archutils/Unix/EmergencyShutdown.h" + "archutils/Unix/GetSysInfo.h" + "archutils/Unix/RunningUnderValgrind.h" + "archutils/Unix/SignalHandler.h" + "archutils/Unix/SpecialDirs.h" + "archutils/Common/gcc_byte_swaps.h" + ) + if(X11_FOUND) + list(APPEND SMDATA_OS_SRC + "archutils/Unix/X11Helper.cpp" + ) + list(APPEND SMDATA_OS_HPP + "archutils/Unix/X11Helper.h" + ) + endif() + if(HAS_PTHREAD) + list(APPEND SMDATA_OS_SRC + "archutils/Common/PthreadHelpers.cpp" + ) + list(APPEND SMDATA_OS_HPP + "archutils/Common/PthreadHelpers.h" + ) + endif() + endif() + source_group("OS Specific" FILES ${SMDATA_OS_SRC} ${SMDATA_OS_HPP}) +endif() + diff --git a/src/CMakeData-rage.cmake b/src/CMakeData-rage.cmake new file mode 100644 index 0000000000..0eee407bbb --- /dev/null +++ b/src/CMakeData-rage.cmake @@ -0,0 +1,220 @@ +# TODO: Turn Rage into a libary. + +list(APPEND SMDATA_RAGE_UTILS_SRC + "RageUtil.cpp" + "RageUtil_BackgroundLoader.cpp" + "RageUtil_CachedObject.cpp" + "RageUtil_CharConversions.cpp" + "RageUtil_FileDB.cpp" + "RageUtil_WorkerThread.cpp" +) + +list(APPEND SMDATA_RAGE_UTILS_HPP + "RageUtil.h" + "RageUtil_AutoPtr.h" # TODO: Remove the need for this and replace with c++11 smart pointers + "RageUtil_BackgroundLoader.h" + "RageUtil_CachedObject.h" + "RageUtil_CharConversions.h" + "RageUtil_CircularBuffer.h" + "RageUtil_FileDB.h" + "RageUtil_WorkerThread.h" +) + +source_group("Rage\\\\Utils" FILES ${SMDATA_RAGE_UTILS_SRC} ${SMDATA_RAGE_UTILS_HPP}) + +list(APPEND SMDATA_RAGE_MISC_SRC + "RageException.cpp" + "RageInput.cpp" + "RageInputDevice.cpp" + "RageLog.cpp" + "RageMath.cpp" + "RageTypes.cpp" + "RageThreads.cpp" + "RageTimer.cpp" +) + +list(APPEND SMDATA_RAGE_MISC_HPP + "RageException.h" + "RageInput.h" + "RageInputDevice.h" + "RageLog.h" + "RageMath.h" + "RageTypes.h" + "RageThreads.h" + "RageTimer.h" +) + +source_group("Rage\\\\Misc" FILES ${SMDATA_RAGE_MISC_SRC} ${SMDATA_RAGE_MISC_HPP}) + +list(APPEND SMDATA_RAGE_GRAPHICS_SRC + "RageBitmapTexture.cpp" + "RageDisplay.cpp" + "RageDisplay_Null.cpp" + "RageDisplay_OGL.cpp" + "RageDisplay_OGL_Helpers.cpp" + "RageModelGeometry.cpp" + "RageSurface.cpp" + "RageSurface_Load.cpp" + "RageSurface_Load_BMP.cpp" + "RageSurface_Load_GIF.cpp" + "RageSurface_Load_JPEG.cpp" + "RageSurface_Load_PNG.cpp" + "RageSurface_Load_XPM.cpp" + "RageSurface_Save_BMP.cpp" + "RageSurface_Save_JPEG.cpp" + "RageSurface_Save_PNG.cpp" + "RageSurfaceUtils.cpp" + "RageSurfaceUtils_Dither.cpp" + "RageSurfaceUtils_Palettize.cpp" + "RageSurfaceUtils_Zoom.cpp" + "RageTexture.cpp" + "RageTextureID.cpp" + "RageTextureManager.cpp" + "RageTexturePreloader.cpp" + "RageTextureRenderTarget.cpp" +) +list(APPEND SMDATA_RAGE_GRAPHICS_HPP + "RageBitmapTexture.h" + "RageDisplay.h" + "RageDisplay_Null.h" + "RageDisplay_OGL.h" + "RageDisplay_OGL_Helpers.h" + "RageModelGeometry.h" + "RageSurface.h" + "RageSurface_Load.h" + "RageSurface_Load_BMP.h" + "RageSurface_Load_GIF.h" + "RageSurface_Load_JPEG.h" + "RageSurface_Load_PNG.h" + "RageSurface_Load_XPM.h" + "RageSurface_Save_BMP.h" + "RageSurface_Save_JPEG.h" + "RageSurface_Save_PNG.h" + "RageSurfaceUtils.h" + "RageSurfaceUtils_Dither.h" + "RageSurfaceUtils_Palettize.h" + "RageSurfaceUtils_Zoom.h" + "RageTexture.h" + "RageTextureID.h" + "RageTextureManager.h" + "RageTexturePreloader.h" + "RageTextureRenderTarget.h" +) + +if(WIN32) + list(APPEND SMDATA_RAGE_GRAPHICS_SRC "RageDisplay_D3D.cpp") + list(APPEND SMDATA_RAGE_GRAPHICS_HPP "RageDisplay_D3D.h") +elseif(LINUX) + if (WITH_GLES2) + list(APPEND SMDATA_RAGE_GRAPHICS_SRC "RageDisplay_GLES2.cpp") + list(APPEND SMDATA_RAGE_GRAPHICS_HPP "RageDisplay_GLES2.h") + endif() +endif() + +source_group("Rage\\\\Graphics" FILES ${SMDATA_RAGE_GRAPHICS_SRC} ${SMDATA_RAGE_GRAPHICS_HPP}) + +list(APPEND SMDATA_RAGE_FILE_SRC + "RageFile.cpp" + "RageFileBasic.cpp" + "RageFileDriver.cpp" + "RageFileDriverDeflate.cpp" + "RageFileDriverDirect.cpp" + "RageFileDriverDirectHelpers.cpp" + "RageFileDriverMemory.cpp" + "RageFileDriverReadAhead.cpp" + "RageFileDriverSlice.cpp" + "RageFileDriverTimeout.cpp" + "RageFileDriverZip.cpp" + "RageFileManager.cpp" + "RageFileManager_ReadAhead.cpp" +) + +list(APPEND SMDATA_RAGE_FILE_HPP + "RageFile.h" + "RageFileBasic.h" + "RageFileDriver.h" + "RageFileDriverDeflate.h" + "RageFileDriverDirect.h" + "RageFileDriverDirectHelpers.h" + "RageFileDriverMemory.h" + "RageFileDriverReadAhead.h" + "RageFileDriverSlice.h" + "RageFileDriverTimeout.h" + "RageFileDriverZip.h" + "RageFileManager.h" + "RageFileManager_ReadAhead.h" +) + +source_group("Rage\\\\File" FILES ${SMDATA_RAGE_FILE_SRC} ${SMDATA_RAGE_FILE_HPP}) + +list(APPEND SMDATA_RAGE_SOUND_SRC + "RageSound.cpp" + "RageSoundManager.cpp" + "RageSoundMixBuffer.cpp" + "RageSoundPosMap.cpp" + "RageSoundReader.cpp" + "RageSoundReader_Chain.cpp" + "RageSoundReader_ChannelSplit.cpp" + "RageSoundReader_Extend.cpp" + "RageSoundReader_FileReader.cpp" + "RageSoundReader_Merge.cpp" + "RageSoundReader_Pan.cpp" + "RageSoundReader_PitchChange.cpp" + "RageSoundReader_PostBuffering.cpp" + "RageSoundReader_Preload.cpp" + "RageSoundReader_Resample_Good.cpp" + "RageSoundReader_SpeedChange.cpp" + "RageSoundReader_ThreadedBuffer.cpp" + "RageSoundReader_WAV.cpp" + "RageSoundUtil.cpp" +) +list(APPEND SMDATA_RAGE_SOUND_HPP + "RageSound.h" + "RageSoundManager.h" + "RageSoundMixBuffer.h" + "RageSoundPosMap.h" + "RageSoundReader.h" + "RageSoundReader_Chain.h" + "RageSoundReader_ChannelSplit.h" + "RageSoundReader_Extend.h" + "RageSoundReader_FileReader.h" + "RageSoundReader_Filter.h" + "RageSoundReader_Merge.h" + "RageSoundReader_Pan.h" + "RageSoundReader_PitchChange.h" + "RageSoundReader_PostBuffering.h" + "RageSoundReader_Preload.h" + "RageSoundReader_Resample_Good.h" + "RageSoundReader_SpeedChange.h" + "RageSoundReader_ThreadedBuffer.h" + "RageSoundReader_WAV.h" + "RageSoundUtil.h" +) + +if (HAS_OGG) + list(APPEND SMDATA_RAGE_SOUND_SRC "RageSoundReader_Vorbisfile.cpp") + list(APPEND SMDATA_RAGE_SOUND_HPP "RageSoundReader_Vorbisfile.h") +endif() + +if (HAS_MP3) + list(APPEND SMDATA_RAGE_SOUND_SRC "RageSoundReader_MP3.cpp") + list(APPEND SMDATA_RAGE_SOUND_HPP "RageSoundReader_MP3.h") +endif() + +source_group("Rage\\\\Sound" FILES ${SMDATA_RAGE_SOUND_SRC} ${SMDATA_RAGE_SOUND_HPP}) + +list(APPEND SMDATA_ALL_RAGE_SRC + ${SMDATA_RAGE_FILE_SRC} + ${SMDATA_RAGE_GRAPHICS_SRC} + ${SMDATA_RAGE_MISC_SRC} + ${SMDATA_RAGE_SOUND_SRC} + ${SMDATA_RAGE_UTILS_SRC} +) + +list(APPEND SMDATA_ALL_RAGE_HPP + ${SMDATA_RAGE_FILE_HPP} + ${SMDATA_RAGE_GRAPHICS_HPP} + ${SMDATA_RAGE_MISC_HPP} + ${SMDATA_RAGE_SOUND_HPP} + ${SMDATA_RAGE_UTILS_HPP} +) diff --git a/src/CMakeData-screen.cmake b/src/CMakeData-screen.cmake new file mode 100644 index 0000000000..ed6d4daa59 --- /dev/null +++ b/src/CMakeData-screen.cmake @@ -0,0 +1,199 @@ +list(APPEND SMDATA_SCREEN_GAMEPLAY_SRC + "ScreenGameplay.cpp" + "ScreenGameplayLesson.cpp" + "ScreenGameplayNormal.cpp" + "ScreenGameplayShared.cpp" + "ScreenGameplaySyncMachine.cpp" +) + +list(APPEND SMDATA_SCREEN_GAMEPLAY_HPP + "ScreenGameplay.h" + "ScreenGameplayNormal.h" + "ScreenGameplayShared.h" + "ScreenGameplaySyncMachine.h" +) + +source_group("Screens\\\\Gameplay" FILES ${SMDATA_SCREEN_GAMEPLAY_SRC} ${SMDATA_SCREEN_GAMEPLAY_HPP}) + +list(APPEND SMDATA_SCREEN_OPTION_SRC + "ScreenOptions.cpp" + "ScreenOptionsCourseOverview.cpp" + "ScreenOptionsEditCourse.cpp" + "ScreenOptionsEditProfile.cpp" + "ScreenOptionsExportPackage.cpp" + "ScreenOptionsManageCourses.cpp" + "ScreenOptionsManageEditSteps.cpp" + "ScreenOptionsManageProfiles.cpp" + "ScreenOptionsMaster.cpp" + "ScreenOptionsMasterPrefs.cpp" + "ScreenOptionsMemoryCard.cpp" + "ScreenOptionsToggleSongs.cpp" +) +list(APPEND SMDATA_SCREEN_OPTION_HPP + "ScreenOptions.h" + "ScreenOptionsCourseOverview.h" + "ScreenOptionsEditCourse.h" + "ScreenOptionsEditProfile.h" + "ScreenOptionsExportPackage.h" + "ScreenOptionsManageCourses.h" + "ScreenOptionsManageEditSteps.h" + "ScreenOptionsManageProfiles.h" + "ScreenOptionsMaster.h" + "ScreenOptionsMasterPrefs.h" + "ScreenOptionsMemoryCard.h" + "ScreenOptionsToggleSongs.h" +) + +source_group("Screens\\\\Options" FILES ${SMDATA_SCREEN_OPTION_SRC} ${SMDATA_SCREEN_OPTION_HPP}) + +list(APPEND SMDATA_SCREEN_REST_SRC + "Screen.cpp" + "ScreenAttract.cpp" + "ScreenBookkeeping.cpp" + "ScreenContinue.cpp" + "ScreenDebugOverlay.cpp" + "ScreenDemonstration.cpp" + "ScreenEdit.cpp" + "ScreenEditMenu.cpp" + "ScreenEnding.cpp" + "ScreenEvaluation.cpp" + "ScreenExit.cpp" + "ScreenHighScores.cpp" + "ScreenHowToPlay.cpp" + "ScreenInstallOverlay.cpp" + "ScreenInstructions.cpp" + "ScreenJukebox.cpp" + "ScreenMapControllers.cpp" + "ScreenMessage.cpp" + "ScreenMiniMenu.cpp" + "ScreenNameEntry.cpp" + "ScreenNameEntryTraditional.cpp" + "ScreenPackages.cpp" + "ScreenPlayerOptions.cpp" + "ScreenProfileLoad.cpp" + "ScreenProfileSave.cpp" + "ScreenPrompt.cpp" + "ScreenRanking.cpp" + "ScreenReloadSongs.cpp" + "ScreenSandbox.cpp" + "ScreenSaveSync.cpp" + "ScreenSelect.cpp" + "ScreenSelectCharacter.cpp" + "ScreenSelectLanguage.cpp" + "ScreenSelectMaster.cpp" + "ScreenSelectMusic.cpp" + "ScreenSelectProfile.cpp" + "ScreenServiceAction.cpp" + "ScreenSetTime.cpp" + "ScreenSongOptions.cpp" + "ScreenSplash.cpp" + "ScreenStatsOverlay.cpp" + "ScreenSyncOverlay.cpp" + "ScreenSystemLayer.cpp" + "ScreenTestInput.cpp" + "ScreenTestLights.cpp" + "ScreenTestSound.cpp" + "ScreenTextEntry.cpp" + "ScreenTitleMenu.cpp" + "ScreenUnlockBrowse.cpp" + "ScreenUnlockCelebrate.cpp" + "ScreenUnlockStatus.cpp" + "ScreenWithMenuElements.cpp" +) +list(APPEND SMDATA_SCREEN_REST_HPP + "Screen.h" + "ScreenAttract.h" + "ScreenBookkeeping.h" + "ScreenContinue.h" + "ScreenDebugOverlay.h" + "ScreenDemonstration.h" + "ScreenEdit.h" + "ScreenEditMenu.h" + "ScreenEnding.h" + "ScreenEvaluation.h" + "ScreenExit.h" + "ScreenHighScores.h" + "ScreenHowToPlay.h" + "ScreenInstallOverlay.h" + "ScreenInstructions.h" + "ScreenJukebox.h" + "ScreenMapControllers.h" + "ScreenMessage.h" + "ScreenMiniMenu.h" + "ScreenNameEntry.h" + "ScreenNameEntryTraditional.h" + "ScreenPackages.h" + "ScreenPlayerOptions.h" + "ScreenProfileLoad.h" + "ScreenProfileSave.h" + "ScreenPrompt.h" + "ScreenRanking.h" + "ScreenReloadSongs.h" + "ScreenSandbox.h" + "ScreenSaveSync.h" + "ScreenSelect.h" + "ScreenSelectCharacter.h" + "ScreenSelectLanguage.h" + "ScreenSelectMaster.h" + "ScreenSelectMusic.h" + "ScreenSelectProfile.h" + "ScreenServiceAction.h" + "ScreenSetTime.h" + "ScreenSongOptions.h" + "ScreenSplash.h" + "ScreenStatsOverlay.h" + "ScreenSyncOverlay.h" + "ScreenSystemLayer.h" + "ScreenTestInput.h" + "ScreenTestLights.h" + "ScreenTestSound.h" + "ScreenTextEntry.h" + "ScreenTitleMenu.h" + "ScreenUnlockBrowse.h" + "ScreenUnlockCelebrate.h" + "ScreenUnlockStatus.h" + "ScreenWithMenuElements.h" +) + +source_group("Screens\\\\Others" FILES ${SMDATA_SCREEN_REST_SRC} ${SMDATA_SCREEN_REST_HPP}) + +list(APPEND SMDATA_SCREEN_NET_SRC + "ScreenNetEvaluation.cpp" + "ScreenNetRoom.cpp" + "ScreenNetSelectBase.cpp" + "ScreenNetSelectMusic.cpp" + "ScreenNetworkOptions.cpp" +) + +list(APPEND SMDATA_SCREEN_NET_HPP + "ScreenNetEvaluation.h" + "ScreenNetRoom.h" + "ScreenNetSelectBase.h" + "ScreenNetSelectMusic.h" + "ScreenNetworkOptions.h" +) + +if (WITH_NETWORKING) + list(APPEND SMDATA_SCREEN_NET_SRC + "ScreenSMOnlineLogin.cpp" + ) + list(APPEND SMDATA_SCREEN_NET_HPP + "ScreenSMOnlineLogin.h" + ) +endif() + +source_group("Screens\\\\Network" FILES ${SMDATA_SCREEN_NET_SRC} ${SMDATA_SCREEN_NET_HPP}) + +list(APPEND SMDATA_ALL_SCREENS_SRC + ${SMDATA_SCREEN_GAMEPLAY_SRC} + ${SMDATA_SCREEN_OPTION_SRC} + ${SMDATA_SCREEN_NET_SRC} + ${SMDATA_SCREEN_REST_SRC} +) + +list(APPEND SMDATA_ALL_SCREENS_HPP + ${SMDATA_SCREEN_GAMEPLAY_HPP} + ${SMDATA_SCREEN_OPTION_HPP} + ${SMDATA_SCREEN_NET_HPP} + ${SMDATA_SCREEN_REST_HPP} +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..38f4b43543 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,539 @@ +# Version Updater library. +add_subdirectory(version_updater) + +# This part may move to a different file: it's the SM Data project. +add_custom_command( + OUTPUT ${SM_SRC_DIR}/verstub.cpp + COMMAND VersionUpdater ${SM_SRC_DIR}/verstub.cpp + DEPENDS VersionUpdater +) + +source_group("Generated Files" FILES ${SM_SRC_DIR}/verstub.cpp) + +# Main project is below. + +list(APPEND SMDATA_GLOBAL_FILES_SRC + "GameLoop.cpp" + "global.cpp" + "SpecialFiles.cpp" + "StepMania.cpp" # TODO: Refactor into separate main project. +) + +list(APPEND SMDATA_GLOBAL_FILES_HPP + "GameLoop.h" + "global.h" + "ProductInfo.h" # TODO: Have this be auto-generated. + "SpecialFiles.h" + "StdString.h" # TODO: Remove the need for this file, transition to std::string. + "StepMania.h" # TODO: Refactor into separate main project. +) + +source_group("Global Files" FILES ${SMDATA_GLOBAL_FILES_SRC} ${SMDATA_GLOBAL_FILES_HPP}) + +# Keep the module path local for easier grabbing. +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +include(CMakeData-arch.cmake) +include(CMakeData-rage.cmake) +include(CMakeData-os.cmake) +include(CMakeData-actor.cmake) +include(CMakeData-screen.cmake) +include(CMakeData-data.cmake) +include(CMakeData-gtk.cmake) + +list(APPEND SMDATA_GLOBAL_SINGLETON_SRC + "AnnouncerManager.cpp" + "Bookkeeper.cpp" + "CharacterManager.cpp" + "CommandLineActions.cpp" + "CryptManager.cpp" + "FontManager.cpp" + "GameManager.cpp" + "GameSoundManager.cpp" + "GameState.cpp" + "InputFilter.cpp" + "InputMapper.cpp" + "InputQueue.cpp" + "LightsManager.cpp" + "LuaManager.cpp" + "MemoryCardManager.cpp" + "MessageManager.cpp" + "NetworkSyncManager.cpp" + "NoteSkinManager.cpp" + "PrefsManager.cpp" + "ProfileManager.cpp" + "ScreenManager.cpp" + "SongManager.cpp" + "StatsManager.cpp" + "ThemeManager.cpp" + "UnlockManager.cpp" +) +list(APPEND SMDATA_GLOBAL_SINGLETON_HPP + "AnnouncerManager.h" + "Bookkeeper.h" + "CharacterManager.h" + "CommandLineActions.h" + "CryptManager.h" + "FontManager.h" + "GameManager.h" + "GameSoundManager.h" + "GameState.h" + "InputFilter.h" + "InputMapper.h" + "InputQueue.h" + "LightsManager.h" + "LuaManager.h" + "MemoryCardManager.h" + "MessageManager.h" + "NetworkSyncManager.h" + "NoteSkinManager.h" + "PrefsManager.h" + "ProfileManager.h" + "ScreenManager.h" + "SongManager.h" + "StatsManager.h" + "ThemeManager.h" + "UnlockManager.h" +) + +if(WITH_NETWORKING) + list(APPEND SMDATA_GLOBAL_SINGLETON_SRC + "ezsockets.cpp" + ) + list(APPEND SMDATA_GLOBAL_SINGLETON_HPP + "ezsockets.h" + ) +endif() + +source_group("Global Singletons" FILES ${SMDATA_GLOBAL_SINGLETON_SRC} ${SMDATA_GLOBAL_SINGLETON_HPP}) + +list(APPEND SMDATA_FILE_TYPES_SRC + "IniFile.cpp" + "MsdFile.cpp" + "XmlFile.cpp" + "XmlFileUtil.cpp" +) +list(APPEND SMDATA_FILE_TYPES_HPP + "IniFile.h" + "MsdFile.h" + "XmlFile.h" + "XmlFileUtil.h" +) + +source_group("File Types" FILES ${SMDATA_FILE_TYPES_SRC} ${SMDATA_FILE_TYPES_HPP}) + +list(APPEND SMDATA_ALL_FILES_SRC + ${SM_SRC_DIR}/verstub.cpp + ${SMDATA_GLOBAL_FILES_SRC} + ${SMDATA_GLOBAL_SINGLETON_SRC} + ${SMDATA_ALL_ACTORS_SRC} + ${SMDATA_ALL_ARCH_SRC} + ${SMDATA_ALL_DATA_SRC} + ${SMDATA_ALL_RAGE_SRC} + ${SMDATA_ALL_SCREENS_SRC} + ${SMDATA_OS_SRC} + ${SMDATA_FILE_TYPES_SRC} +) +list(APPEND SMDATA_ALL_FILES_HPP + ${SMDATA_GLOBAL_FILES_HPP} + ${SMDATA_GLOBAL_SINGLETON_HPP} + ${SMDATA_ALL_ACTORS_HPP} + ${SMDATA_ALL_ARCH_HPP} + ${SMDATA_ALL_DATA_HPP} + ${SMDATA_ALL_RAGE_HPP} + ${SMDATA_ALL_SCREENS_HPP} + ${SMDATA_OS_HPP} + ${SMDATA_FILE_TYPES_HPP} +) + +if(NOT APPLE) + list(APPEND SMDATA_ALL_FILES_SRC "Main.cpp") + 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() + +# TODO: Make this actually be data and not an executable. +if(APPLE) + set(MACOSX_BUNDLE_BUNDLE_NAME ${SM_EXE_NAME}) + add_executable("${SM_EXE_NAME}" MACOSX_BUNDLE ${SMDATA_ALL_FILES_SRC} ${SMDATA_ALL_FILES_HPP}) + set_target_properties("${SM_EXE_NAME}" PROPERTIES MACOSX_BUNDLE TRUE) +else() + add_executable("${SM_EXE_NAME}" ${SMDATA_ALL_FILES_SRC} ${SMDATA_ALL_FILES_HPP}) +endif() + +sm_add_compile_definition("${SM_EXE_NAME}" CMAKE_POWERED) + +if (NOT WITH_NETWORKING) + sm_add_compile_definition("${SM_EXE_NAME}" WITHOUT_NETWORKING) +endif() + +set(SM_COMPILE_FLAGS "") +# Compilation flags per project here. +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + sm_add_compile_definition("${SM_EXE_NAME}" "DEBUG=1") +endif() + +if(WITH_SSE2) + if(MSVC) + set(SM_COMPILE_FLAGS "${SM_COMPILE_FLAGS} /arch:SSE2") + else() + set(SM_COMPILE_FLAGS "${SM_COMPILE_FLAGS} -msse2") + endif() +endif() + +if(WITH_LTO) + if(MSVC) + set(SM_COMPILE_FLAGS "${SM_COMPILE_FLAGS} /GL") + else() + set(SM_COMPILE_FLAGS "${SM_COMPILE_FLAGS} -flto") + endif() +endif() + +if(MSVC) + # TODO: Find a way to do this cleanly for non MSVC users. + set(SM_COMPILE_FLAGS "${SM_COMPILE_FLAGS} /MP2") +endif() + +set_target_properties("${SM_EXE_NAME}" PROPERTIES COMPILE_FLAGS ${SM_COMPILE_FLAGS}) + +set_target_properties("${SM_EXE_NAME}" PROPERTIES OUTPUT_NAME_DEBUG "StepMania-debug") +set_target_properties("${SM_EXE_NAME}" PROPERTIES OUTPUT_NAME_MINSIZEREL "StepMania-min-size") +set_target_properties("${SM_EXE_NAME}" PROPERTIES OUTPUT_NAME_RELWITHDEBINFO "StepMania-release-symbols") + +if(WIN32) + sm_add_compile_definition("${SM_EXE_NAME}" WINDOWS) + sm_add_compile_definition("${SM_EXE_NAME}" _WINDOWS) # TODO: Remove this potential duplicate. + sm_add_compile_definition("${SM_EXE_NAME}" _CRT_SECURE_NO_WARNINGS) + sm_add_compile_definition("${SM_EXE_NAME}" _WINSOCK_DEPRECATED_NO_WARNINGS) + sm_add_compile_definition("${SM_EXE_NAME}" GLEW_STATIC) + + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SM_PROGRAM_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${SM_PROGRAM_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${SM_PROGRAM_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${SM_PROGRAM_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${SM_PROGRAM_DIR}") +elseif(APPLE) + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${SM_ROOT_DIR}") + + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_INFOPLIST_FILE + "${SM_XCODE_DIR}/Info-StepMania.plist" + ) + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_INFOPLIST_PREFIX_HEADER "${SM_SRC_DIR}/ProductInfo.h") + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_INFOPLIST_PREPROCESS "YES") + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_INFOPLIST_PREPROCESSOR_DEFINITIONS + "EXECUTABLE_NAME=\$(PRODUCT_NAME)" + ) + + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER + "${CMAKE_CURRENT_SOURCE_DIR}/archutils/Darwin/StepMania.pch") + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS "NO") + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_LIBRARY_SEARCH_PATHS + "${SM_XCODE_DIR}/ffmpeg/lib ${SM_XCODE_DIR}/Libraries" + ) + set_target_properties("${SM_EXE_NAME}" PROPERTIES XCODE_ATTRIBUTE_OTHER_LDFLAGS "-lbz2") + sm_add_compile_definition("${SM_EXE_NAME}" _XOPEN_SOURCE) + + # Add the ability to copy the resource file. + add_custom_command(TARGET "${SM_EXE_NAME}" + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "$/../Resources" + ) + add_custom_command(TARGET "${SM_EXE_NAME}" + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${SM_XCODE_DIR}/smicon.icns" "$/../Resources/" + ) + add_custom_command(TARGET "${SM_EXE_NAME}" + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${SM_XCODE_DIR}/Hardware.plist" "$/../Resources/" + ) +else() # Linux + # TODO: Have this compile definition be used all over. Currently fixed for Windows and Mac, but in headers. + sm_add_compile_definition("${SM_EXE_NAME}" "${ENDIANNESS}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${SM_ROOT_DIR}") + set_target_properties("${SM_EXE_NAME}" PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${SM_ROOT_DIR}") + + if (${HAS_PTHREAD}) + sm_add_compile_definition("${SM_EXE_NAME}" HAVE_LIBPTHREAD) + endif() + if (${HAS_FFMPEG}) + sm_add_compile_definition("${SM_EXE_NAME}" HAVE_FFMPEG) + endif() + if (BSD) + sm_add_compile_definition("${SM_EXE_NAME}" BSD) + endif() + + if (GTK2_FOUND) + sm_add_compile_definition("${SM_EXE_NAME}" HAVE_GTK) + endif() + + sm_add_compile_definition("${SM_EXE_NAME}" UNIX) + if("${CMAKE_SYSTEM}" MATCHES "Linux") + sm_add_compile_definition("${SM_EXE_NAME}" LINUX) + endif() +endif() + +set_property(TARGET "${SM_EXE_NAME}" PROPERTY FOLDER "Internal Libraries") + +list(APPEND SMDATA_LINK_LIB + "lua-5.1" + "tomcrypt" + "tommath" + "zlib" + "jsoncpp" + "mad" + "png" + "glew" + "pcre" + "jpeg" +) + +if (WIN32) + list(APPEND SMDATA_LINK_LIB + # The misc libraries are here. + "${LIB_SWSCALE}" + "${LIB_AVCODEC}" + "${LIB_AVFORMAT}" + "${LIB_AVUTIL}" + "libmad.lib" + "ogg_static.lib" + "vorbis_static.lib" + "vorbisfile_static.lib" + "dbghelp.lib" + "setupapi.lib" + "hid.lib" + ) + # Mad is not built in Windows. + list(REMOVE_ITEM SMDATA_LINK_LIB "mad") + + get_filename_component(DIRECTX_LIBRARY_DIR "${DIRECTX_LIBRARIES}" DIRECTORY) + + sm_add_link_flag("${SM_EXE_NAME}" "/LIBPATH:\"${DIRECTX_LIBRARY_DIR}\"") + sm_add_link_flag("${SM_EXE_NAME}" "/LIBPATH:\"${SM_EXTERN_DIR}/ffmpeg/lib\"") + sm_add_link_flag("${SM_EXE_NAME}" "/LIBPATH:\"${SM_EXTERN_DIR}/libjpeg\"") + sm_add_link_flag("${SM_EXE_NAME}" "/LIBPATH:\"${SM_EXTERN_DIR}/mad-0.15.1b/msvc++/Release\"") + sm_add_link_flag("${SM_EXE_NAME}" "/LIBPATH:\"${SM_EXTERN_DIR}/vorbis/win32\"") + sm_add_link_flag("${SM_EXE_NAME}" "/LIBPATH:\"${SM_SRC_DIR}/archutils/Win32/ddk\"") + sm_add_link_flag("${SM_EXE_NAME}" "/ERRORREPORT:SEND") + sm_add_link_flag("${SM_EXE_NAME}" "/MAPINFO:EXPORTS") + sm_add_link_flag("${SM_EXE_NAME}" "/SAFESEH:NO") + sm_add_link_flag("${SM_EXE_NAME}" "/NOLOGO") + sm_add_link_flag("${SM_EXE_NAME}" "/MAP") + sm_add_link_flag("${SM_EXE_NAME}" "/NODEFAULTLIB:wininet.lib") + sm_add_link_flag("${SM_EXE_NAME}" "/NODEFAULTLIB:msimg32.lib") + sm_add_link_flag("${SM_EXE_NAME}" "/NODEFAULTLIB:libci.lib") + set_target_properties("${SM_EXE_NAME}" PROPERTIES LINK_FLAGS_DEBUG "/NODEFAULTLIB:msvcrt.lib") + set_target_properties("${SM_EXE_NAME}" PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") + set_target_properties("${SM_EXE_NAME}" PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") +elseif(APPLE) + # The following were removed from SMDATA_LINK_LIB to "match" StepMania's pbxproj. +# ${MAC_FRAME_APPKIT} +# ${MAC_FRAME_FOUNDATION} +# "ffmpeg" + + # TODO: Adjust the target when StepMania-Data returns. + # TODO: Find a cleaner way besides just setting to wipe the slate clean. + set(SMDATA_LINK_LIB + ${MAC_FRAME_ACCELERATE} + ${MAC_FRAME_CARBON} + ${MAC_FRAME_COCOA} + ${MAC_FRAME_IOKIT} + ${MAC_FRAME_QUICKTIME} + ${MAC_FRAME_OPENGL} + ${MAC_FRAME_COREFOUNDATION} + ${MAC_FRAME_AUDIOTOOLBOX} + ${MAC_FRAME_AUDIOUNIT} + ${MAC_FRAME_COREAUDIO} + ${MAC_FRAME_CORESERVICES} + "ogg" + "theora" + "vorbis" + "lua-5.1" + "tomcrypt" + "tommath" + "zlib" + "jsoncpp" + "mad" + "png" + "glew" + "pcre" + "jpeg" + "avcodec" + "avdevice" + "avfilter" + "avformat" + "avutil" + "swresample" + "swscale" + ) +else() # Unix / Linux + # TODO: Remember to find and locate the zip archive files. + list(APPEND SMDATA_LINK_LIB + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavformat/libavformat.a" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavcodec/libavcodec.a" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libswscale/libswscale.a" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build/libavutil/libavutil.a" + "${DL_LIBRARY}" + ) + + if(HAS_OGG) + list(APPEND SMDATA_LINK_LIB + "${VORBISFILE_LIBRARY}" + "${VORBIS_LIBRARY}" + "${OGG_LIBRARY}" + ) + endif() + + if(HAS_MP3) + list(APPEND SMDATA_LINK_LIB + "${LIBMAD_LIBRARY}" + ) + endif() + + list(APPEND SMDATA_LINK_LIB + "${OPENGL_LIBRARY}" + ) + + if(GTK2_FOUND) + list(APPEND SMDATA_LINK_LIB + "${GTK2_LIBRARIES}" + ) + endif() + + list(APPEND SMDATA_LINK_LIB + "${BZIP2_LIBRARIES}" + "${ZLIB_LIBRARIES}" + "${CMAKE_THREAD_LIBS_INIT}" + ) + + if (HAS_ALSA) + list(APPEND SMDATA_LINK_LIB ${ALSA_LIBRARIES}) + endif() + + if (HAS_JACK) + list(APPEND SMDATA_LINK_LIB ${JACK_LIBRARIES}) + endif() + + if (HAS_OSS) + # No mention of OSS libraries. + sm_add_compile_definition("${SM_EXE_NAME}" "HAVE_OSS_VERSION=1") + endif() + + if (HAS_PULSE) + list(APPEND SMDATA_LINK_LIB ${PULSEAUDIO_LIBRARY}) + # PACKAGE_NAME and PACKAGE_VERSION are only used in this scenario. Why is not clear. + # TODO: Remove this silliness. + sm_add_compile_definition("${SM_EXE_NAME}" PACKAGE_NAME="StepMania") + set(PACKAGE_VERSION "${SM_VERSION_MAJOR}.${SM_VERSION_MINOR}") + sm_add_compile_definition("${SM_EXE_NAME}" PACKAGE_VERSION="${PACKAGE_VERSION}") + endif() + + if(X11_FOUND) + list(APPEND SMDATA_LINK_LIB ${X11_LIBRARIES}) + endif() + + list(APPEND SMDATA_LINK_LIB + ${XRANDR_LIBRARIES} + ) + list(REMOVE_ITEM SMDATA_LINK_LIB "zlib") +endif() + +target_link_libraries("${SM_EXE_NAME}" ${SMDATA_LINK_LIB}) + +list(APPEND SM_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR} + "${SM_EXTERN_DIR}/vorbis" +) +if(NOT APPLE) + list(APPEND SM_INCLUDE_DIRS + "${SM_EXTERN_DIR}/glew-1.5.8/include" + "${SM_EXTERN_DIR}/jsoncpp/include" + "${SM_EXTERN_DIR}/libjpeg" + "${SM_EXTERN_DIR}/zlib" + ) + if(MSVC) + list(APPEND SM_INCLUDE_DIRS + "${SM_EXTERN_DIR}/ffmpeg/include" + ) + else() + if (HAS_FFMPEG) + add_dependencies("${SM_EXE_NAME}" "ffmpeg") + list(APPEND SM_INCLUDE_DIRS + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg" + "${SM_EXTERN_DIR}/ffmpeg-linux/src/ffmpeg-build" + ) + endif() + if (HAS_GTK2) + list(APPEND SM_INCLUDE_DIRS "${GTK2_INCLUDE_DIRS}") + endif() + if (X11_FOUND) + list(APPEND SM_INCLUDE_DIRS "${X11_INCLUDE_DIR}") + endif() + endif() +else() + list(APPEND SM_INCLUDE_DIRS + "${SM_XCODE_DIR}/ffmpeg/include" + "archutils/Unix" + ) +endif() + +if(WIN32) + list(APPEND SM_INCLUDE_DIRS + ${DIRECTX_INCLUDE_DIR} + ) +else() + list(APPEND SM_INCLUDE_DIRS + "${SM_EXTERN_DIR}/libpng/include" + ) +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)") +elseif(APPLE) + # TODO: Confirm if anything special is needed. Most Mac apps are just portable .app folders. + 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") +endif() + +if(NOT APPLE) + install(TARGETS "${SM_EXE_NAME}" DESTINATION "${SM_INSTALL_DESTINATION}") + if (UNIX OR LINUX) + install(FILES "${SM_ROOT_DIR}/GtkModule.so" LIBRARY DESTINATION "${SM_INSTALL_DESTINATION}" OPTIONAL) + endif() + install(DIRECTORY "${SM_ROOT_DIR}/Announcers" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/BGAnimations" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/Themes" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/Characters" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/Scripts" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/Courses" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/BackgroundEffects" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/Data" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/BackgroundTransitions" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/Docs" DESTINATION "${SM_INSTALL_DESTINATION}") + install(DIRECTORY "${SM_ROOT_DIR}/NoteSkins" DESTINATION "${SM_INSTALL_DESTINATION}") + if (NOT SM_INSTALL_DESTINATION) + install(DIRECTORY "${SM_ROOT_DIR}/Songs/StepMania 5" DESTINATION "Songs") + install(FILES "${SM_ROOT_DIR}/Songs/instructions.txt" DESTINATION "Songs") + else() + install(DIRECTORY "${SM_ROOT_DIR}/Songs/StepMania 5" DESTINATION "${SM_INSTALL_DESTINATION}/Songs") + install(FILES "${SM_ROOT_DIR}/Songs/instructions.txt" DESTINATION "${SM_INSTALL_DESTINATION}/Songs") + endif() +endif() + diff --git a/src/LuaManager.cpp b/src/LuaManager.cpp index 3d2f12e50b..c74b13bfe3 100644 --- a/src/LuaManager.cpp +++ b/src/LuaManager.cpp @@ -1044,8 +1044,8 @@ LuaFunction( ProductFamily, (RString) PRODUCT_FAMILY ); LuaFunction( ProductVersion, (RString) product_version ); LuaFunction( ProductID, (RString) PRODUCT_ID ); -extern const char *const version_date; -extern const char *const version_time; +extern char const * const version_date; +extern char const * const version_time; LuaFunction( VersionDate, (RString) version_date ); LuaFunction( VersionTime, (RString) version_time ); diff --git a/src/LuaManager.h b/src/LuaManager.h index 6c3a9c26c0..79b5f217ee 100644 --- a/src/LuaManager.h +++ b/src/LuaManager.h @@ -264,7 +264,7 @@ inline int SafeFArg(lua_State* L, int index, RString const& err, int def) { if(lua_isnumber(L, index)) { - return lua_tonumber(L, index); + return static_cast(lua_tonumber(L, index)); } LuaHelpers::ReportScriptError(err); return def; diff --git a/src/Main.cpp b/src/Main.cpp new file mode 100644 index 0000000000..fa05283ed7 --- /dev/null +++ b/src/Main.cpp @@ -0,0 +1,31 @@ +#include "global.h" +#include "StepMania.h" + +int main(int argc, char* argv[]) { + return sm_main(argc, argv); +} + +/* + * (c) 2014 Jason Felds + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Software, and to permit persons to + * whom the Software is furnished to do so, provided that the above + * copyright notice(s) and this permission notice appear in all copies of + * the Software and that both the above copyright notice(s) and this + * permission notice appear in supporting documentation. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF + * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS + * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT + * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ \ No newline at end of file diff --git a/src/Makefile.am b/src/Makefile.am index c56731c03d..db322c5528 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -743,6 +743,8 @@ if !WITHOUT_GLES2 main_SOURCES += RageDisplay_GLES2.cpp RageDisplay_GLES2.h endif +main_SOURCES += Main.cpp + main_LDADD = \ $(VIDEO_LIBS) \ $(AUDIO_LIBS) \ diff --git a/src/RageFileDriverDeflate.cpp b/src/RageFileDriverDeflate.cpp index 45f834e201..cad4d240ea 100644 --- a/src/RageFileDriverDeflate.cpp +++ b/src/RageFileDriverDeflate.cpp @@ -9,7 +9,11 @@ #if defined(_WINDOWS) #include "zlib.h" #if defined(_MSC_VER) +#if defined(BINARY_ZDL) #pragma comment(lib, "zdll.lib") +// #else +// #pragma comment(lib, "zlib.lib") +#endif #endif #elif defined(MACOSX) #include "zlib.h" diff --git a/src/RageSoundReader_Vorbisfile.cpp b/src/RageSoundReader_Vorbisfile.cpp index e5ed9f7330..2924b25998 100644 --- a/src/RageSoundReader_Vorbisfile.cpp +++ b/src/RageSoundReader_Vorbisfile.cpp @@ -11,9 +11,9 @@ #endif #if defined(_MSC_VER) -#pragma comment(lib, OGG_LIB_DIR "ogg_static.lib") -#pragma comment(lib, OGG_LIB_DIR "vorbis_static.lib") -#pragma comment(lib, OGG_LIB_DIR "vorbisfile_static.lib") +#pragma comment(lib, "ogg_static.lib") +#pragma comment(lib, "vorbis_static.lib") +#pragma comment(lib, "vorbisfile_static.lib") #endif // _MSC_VER #include diff --git a/src/RageSurface_Load_PNG.cpp b/src/RageSurface_Load_PNG.cpp index 32c7a6e83c..b09762c7bc 100644 --- a/src/RageSurface_Load_PNG.cpp +++ b/src/RageSurface_Load_PNG.cpp @@ -7,7 +7,9 @@ #if defined(_MSC_VER) #include "../extern/libpng/include/png.h" +#if defined(_BINARY_PNG) #pragma comment(lib, "libpng.lib") +#endif #pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ #else #include diff --git a/src/RageSurface_Save_PNG.cpp b/src/RageSurface_Save_PNG.cpp index da26205ec3..3504625577 100644 --- a/src/RageSurface_Save_PNG.cpp +++ b/src/RageSurface_Save_PNG.cpp @@ -8,7 +8,9 @@ #if defined(_MSC_VER) #include "../extern/libpng/include/png.h" +#if defined(_BINARY_PNG) #pragma comment(lib, "libpng.lib") +#endif #pragma warning(disable: 4611) /* interaction between '_setjmp' and C++ object destruction is non-portable */ #else #include diff --git a/src/StepMania-net2008.vcproj b/src/StepMania-net2008.vcproj index 3b2db7bb86..ceb26713ad 100644 --- a/src/StepMania-net2008.vcproj +++ b/src/StepMania-net2008.vcproj @@ -1928,6 +1928,10 @@ RelativePath="global.h" > + + diff --git a/src/StepMania-net2010.vcxproj b/src/StepMania-net2010.vcxproj index 069634fca2..4b7a2c45cf 100644 --- a/src/StepMania-net2010.vcxproj +++ b/src/StepMania-net2010.vcxproj @@ -531,6 +531,7 @@ cl /Zl /nologo /c verstub.cpp /Fo$(IntDir) Create Create + diff --git a/src/StepMania-net2010.vcxproj.filters b/src/StepMania-net2010.vcxproj.filters index 95f0ef1d3c..dc4a5a00b8 100644 --- a/src/StepMania-net2010.vcxproj.filters +++ b/src/StepMania-net2010.vcxproj.filters @@ -630,6 +630,9 @@ StepMania + + StepMania + StepMania diff --git a/src/StepMania-net2011.vcxproj b/src/StepMania-net2011.vcxproj index ede4f0a84f..7600cb6e00 100644 --- a/src/StepMania-net2011.vcxproj +++ b/src/StepMania-net2011.vcxproj @@ -557,6 +557,7 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)" Create Create + diff --git a/src/StepMania-net2011.vcxproj.filters b/src/StepMania-net2011.vcxproj.filters index ca8eddefb0..14a8223cb2 100644 --- a/src/StepMania-net2011.vcxproj.filters +++ b/src/StepMania-net2011.vcxproj.filters @@ -612,6 +612,9 @@ StepMania + + StepMania + StepMania diff --git a/src/StepMania-net2013.vcxproj b/src/StepMania-net2013.vcxproj index 97030ffe11..875090a6b3 100644 --- a/src/StepMania-net2013.vcxproj +++ b/src/StepMania-net2013.vcxproj @@ -556,6 +556,7 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)" Create Create + diff --git a/src/StepMania-net2013.vcxproj.filters b/src/StepMania-net2013.vcxproj.filters index de46cf7d7b..586e276f62 100644 --- a/src/StepMania-net2013.vcxproj.filters +++ b/src/StepMania-net2013.vcxproj.filters @@ -630,6 +630,9 @@ StepMania + + StepMania> + StepMania diff --git a/src/StepMania.cpp b/src/StepMania.cpp index 69059c5715..ee72d4aa8f 100644 --- a/src/StepMania.cpp +++ b/src/StepMania.cpp @@ -957,7 +957,7 @@ static void ApplyLogPreferences() static LocalizedString COULDNT_OPEN_LOADING_WINDOW( "LoadingWindow", "Couldn't open any loading windows." ); -int main(int argc, char* argv[]) +int sm_main(int argc, char* argv[]) { RageThreadRegister thread( "Main thread" ); RageException::SetCleanupHandler( HandleException ); diff --git a/src/StepMania.h b/src/StepMania.h index 3b0d284a6f..eed115ad2e 100644 --- a/src/StepMania.h +++ b/src/StepMania.h @@ -5,7 +5,7 @@ struct Game; class RageTimer; class VideoModeParams; -int main( int argc, char* argv[] ); +int sm_main( int argc, char* argv[] ); /** @brief Utility functions for controlling the whole game. */ namespace StepMania diff --git a/src/TimingSegments.h b/src/TimingSegments.h index 0fdf4a9db5..ad46bb31c1 100644 --- a/src/TimingSegments.h +++ b/src/TimingSegments.h @@ -266,7 +266,7 @@ struct TickcountSegment : public TimingSegment void SetTicks( int iTicks ) { m_iTicksPerBeat = iTicks; } RString ToString( int dec ) const; - vector GetValues() const { return vector(1, GetTicks()); } + vector GetValues() const { return vector(1, GetTicks() * 1.f); } bool operator==( const TickcountSegment &other ) const { diff --git a/src/archutils/Darwin/SMMain.mm b/src/archutils/Darwin/SMMain.mm index d45311d34e..92897173ba 100644 --- a/src/archutils/Darwin/SMMain.mm +++ b/src/archutils/Darwin/SMMain.mm @@ -68,7 +68,7 @@ - (void) startGame:(id)sender { // Hand off to main application code. - exit( SM_main(m_iArgc, m_pArgv) ); + exit( sm_main(m_iArgc, m_pArgv) ); } /* From here: diff --git a/src/archutils/Darwin/arch_setup.h b/src/archutils/Darwin/arch_setup.h index f28541ef4d..2c5f81e613 100644 --- a/src/archutils/Darwin/arch_setup.h +++ b/src/archutils/Darwin/arch_setup.h @@ -2,8 +2,7 @@ #define ARCH_SETUP_DARWIN_H // Replace the main function. -extern "C" int SM_main( int argc, char *argv[] ); -#define main(x,y) SM_main(x,y) +extern "C" int sm_main( int argc, char *argv[] ); #define HAVE_VERSION_INFO #define HAVE_CXA_DEMANGLE diff --git a/src/archutils/Win32/CrashHandlerChild.cpp b/src/archutils/Win32/CrashHandlerChild.cpp index 98c1c2f350..4914348541 100644 --- a/src/archutils/Win32/CrashHandlerChild.cpp +++ b/src/archutils/Win32/CrashHandlerChild.cpp @@ -28,7 +28,7 @@ #include "ver.h" #if defined(_MSC_VER) -#pragma comment(lib, "archutils/Win32/ddk/dbghelp.lib") +#pragma comment(lib, "dbghelp.lib") #endif // XXX: What happens when we *don't* have version info? Does that ever actually happen? diff --git a/src/archutils/Win32/USB.cpp b/src/archutils/Win32/USB.cpp index ab02bda84a..612b0aace0 100644 --- a/src/archutils/Win32/USB.cpp +++ b/src/archutils/Win32/USB.cpp @@ -5,8 +5,8 @@ #include "archutils/Win32/ErrorStrings.h" #if defined(_MSC_VER) -#pragma comment(lib, "archutils/Win32/ddk/setupapi.lib") -#pragma comment(lib, "archutils/Win32/ddk/hid.lib") +#pragma comment(lib, "setupapi.lib") +#pragma comment(lib, "hid.lib") #endif extern "C" { diff --git a/src/archutils/Win32/arch_setup.h b/src/archutils/Win32/arch_setup.h index dc87b4ad94..3329ddd994 100644 --- a/src/archutils/Win32/arch_setup.h +++ b/src/archutils/Win32/arch_setup.h @@ -172,8 +172,6 @@ inline long int lrintf( float f ) #define ENDIAN_LITTLE #endif -#define OGG_LIB_DIR "../extern/vorbis/win32/" - #if defined(__GNUC__) // It might be MinGW or Cygwin(?) #include "archutils/Common/gcc_byte_swaps.h" #else // XXX: Should we test for MSVC? diff --git a/src/global.cpp b/src/global.cpp index be38a84929..b1791c03e8 100644 --- a/src/global.cpp +++ b/src/global.cpp @@ -8,6 +8,8 @@ # endif #elif defined(MACOSX) # include "archutils/Darwin/Crash.h" +# include +# include using CrashHandler::IsDebuggerPresent; using CrashHandler::DebugBreak; #else diff --git a/src/ver.h b/src/ver.h index adb3b99e87..83ad8aac3e 100644 --- a/src/ver.h +++ b/src/ver.h @@ -1,14 +1,7 @@ #ifndef STEPMANIA_VER_H #define STEPMANIA_VER_H - - -// HACK: The MSVC project doesn't generate this yet -#if defined(_MSC_VER) || defined(__MACOSX__) -#define product_version "5.0-UNKNOWN" -#else extern const char *const product_version; -#endif // XXX: These names are misnomers. This is actually the BUILD number, time and date. // NOTE: In GNU toolchain these are defined in ver.cpp. In MSVC these are defined in archutils/Win32/verinc.c I think. Why? I don't know and I don't have MSVC. --root diff --git a/src/version_updater/CMakeLists.txt b/src/version_updater/CMakeLists.txt new file mode 100644 index 0000000000..54b9756ae1 --- /dev/null +++ b/src/version_updater/CMakeLists.txt @@ -0,0 +1,17 @@ +source_group("" FILES Main.cpp) + +configure_file( + "version.hpp.in" + "${PROJECT_BINARY_DIR}/version.hpp" +) + +include_directories(${PROJECT_BINARY_DIR}) + +add_executable("VersionUpdater" Main.cpp "${PROJECT_BINARY_DIR}/version.hpp") + +set_property(TARGET "VersionUpdater" PROPERTY FOLDER "Internal Libraries") + +if(MSVC) + sm_add_compile_definition("VersionUpdater" _CRT_SECURE_NO_WARNINGS) +endif() + diff --git a/src/version_updater/Main.cpp b/src/version_updater/Main.cpp new file mode 100644 index 0000000000..a0a586b04a --- /dev/null +++ b/src/version_updater/Main.cpp @@ -0,0 +1,73 @@ +/* + * This program was placed in the public domain by Avery, + * with some ideas implemented by AJ. Any C++ improvements + * are made by others. + */ + +#include +#include +#include +#include +#include +#include +#include "version.hpp" + +int main(int argc, char *argv[]) { + if (argc < 2) { + return 1; + } + + std::ifstream versionReadFile("version.bin", std::ios::in); + + unsigned long build = 0; + + // try to read the last version seen. + if (versionReadFile.is_open()) { + std::string line; + std::getline(versionReadFile, line); + if (!line.empty()) { + // TODO: Use stoul when C++11 is utilized. + build = std::atol(line.c_str()); + } + + versionReadFile.close(); + } + + // increment the build number and write it. + ++build; + + std::ofstream versionWriteFile("version.bin", std::ios::out); + + if (versionWriteFile.is_open()) { + versionWriteFile << build; + versionWriteFile.close(); + } + + char strdate[10]; + char strtime[64]; + time_t tm; + + std::time(&tm); + + std::strftime(strdate, 15, "%Y%m%d", std::localtime(&tm)); + std::strftime(strtime, 64, "%H:%M:%S %Z", std::localtime(&tm)); + + // zero out the newline. + strtime[sizeof(strtime) - 1] = 0; + + std::ofstream versionDataFile(argv[1], std::ios::out); + if (versionDataFile.is_open()) { + versionDataFile << "extern unsigned long const version_num = " << build << ";" << std::endl; + versionDataFile << "extern int const sm_version_major = " << smVersionMajor << ";" << std::endl; + versionDataFile << "extern int const sm_version_minor = " << smVersionMinor << ";" << std::endl; + versionDataFile << "extern int const sm_version_patch = " << smVersionPatch << ";" << std::endl; + versionDataFile << "extern char const * const sm_version_git_hash = \"" << smVersionGitHash << "\";" << std::endl; + versionDataFile << "extern char const * const sm_version_traditional = \"" << smVersionTraditional << "\";" << std::endl; + versionDataFile << "extern char const * const version_date = \"" << strdate << "\";" << std::endl; + versionDataFile << "extern char const * const version_time = \"" << strtime << "\";" << std::endl; + versionDataFile << "extern char const * const product_version = \"" << smVersionFull << "\";" << std::endl; + versionDataFile.close(); + } + + return 0; +} diff --git a/src/version_updater/version.hpp.in b/src/version_updater/version.hpp.in new file mode 100644 index 0000000000..7a43182bec --- /dev/null +++ b/src/version_updater/version.hpp.in @@ -0,0 +1,11 @@ +#ifndef VERSION_UPDATER_HPP_ +#define VERSION_UPDATER_HPP_ + +int smVersionMajor = @SM_VERSION_MAJOR@; +int smVersionMinor = @SM_VERSION_MINOR@; +int smVersionPatch = @SM_VERSION_PATCH@; +char const * const smVersionGitHash = "@SM_VERSION_GIT_HASH@"; +char const * const smVersionFull = "@SM_VERSION_FULL@"; +char const * const smVersionTraditional = "@SM_VERSION_TRADITIONAL@"; + +#endif