mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-14 08:50:53 +00:00
cmake: Add CPack Package Generation
Generates zips only at the moment
This commit is contained in:
parent
1c9de50ad2
commit
53799eb390
4 changed files with 86 additions and 13 deletions
|
@ -65,6 +65,27 @@ if(${CMAKE_SYSTEM} MATCHES "Darwin")
|
|||
endif()
|
||||
endif()
|
||||
|
||||
# TODO support MacOSX builds
|
||||
# Set EXE names so the assets CMakeLists can refer to its target
|
||||
set(SRB2_SDL2_EXE_NAME srb2)
|
||||
set(SRB2_WIN_EXE_NAME srb2dd)
|
||||
|
||||
add_subdirectory(src/)
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(assets)
|
||||
|
||||
|
||||
|
||||
##### PACKAGE CONFIGURATION #####
|
||||
|
||||
if(${CMAKE_SYSTEM} MATCHES "Windows")
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
endif()
|
||||
|
||||
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Sonic Robo Blast 2")
|
||||
set(CPACK_PACKAGE_VENDOR "Sonic Team Jr.")
|
||||
#set(CPACK_PACKAGE_DESCRIPTION_FILE )
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR ${SRB2_VERSION_MAJOR})
|
||||
set(CPACK_PACKAGE_VERSION_MINOR ${SRB2_VERSION_MINOR})
|
||||
set(CPACK_PACKAGE_VERSION_PATCH ${SRB2_VERSION_PATCH})
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMAKE_VERSION_MAJOR}.${CMAKE_VERSION_MINOR}")
|
||||
include(CPack)
|
||||
|
|
29
assets/CMakeLists.txt
Normal file
29
assets/CMakeLists.txt
Normal file
|
@ -0,0 +1,29 @@
|
|||
## Assets Target Configuration ##
|
||||
|
||||
# MD5 generation
|
||||
set(SRB2_ASSET_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/srb2.srb
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/player.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rings.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zones.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/patch.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/music.dta
|
||||
)
|
||||
|
||||
set(SRB2_ASSET_HASHED
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/srb2.srb
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/player.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/rings.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/zones.dta
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/patch.dta
|
||||
)
|
||||
|
||||
foreach(SRB2_ASSET ${SRB2_ASSET_HASHED})
|
||||
file(MD5 ${SRB2_ASSET} "SRB2_ASSET_${SRB2_ASSET}_HASH")
|
||||
endforeach()
|
||||
|
||||
# Installation
|
||||
|
||||
install(FILES ${SRB2_ASSET_ALL}
|
||||
DESTINATION .
|
||||
)
|
|
@ -42,15 +42,6 @@ set(SRB2_SDL2_HEADERS
|
|||
prepend_sources(SRB2_SDL2_SOURCES)
|
||||
prepend_sources(SRB2_SDL2_HEADERS)
|
||||
|
||||
# Binary name
|
||||
set(SRB2_SDL2_EXE_NAME srb2sdl2)
|
||||
if(${CMAKE_SYSTEM} MATCHES "Windows")
|
||||
set(SRB2_SDL2_EXE_NAME srb2win)
|
||||
endif()
|
||||
if(CLANG)
|
||||
set(SRB2_SDL2_EXE_NAME SRB2)
|
||||
endif()
|
||||
|
||||
# Dependency
|
||||
find_package(SDL2)
|
||||
|
||||
|
@ -160,6 +151,40 @@ if(${SDL2_FOUND})
|
|||
-DHAVE_SDL
|
||||
-DNDEBUG
|
||||
)
|
||||
|
||||
#### Installation ####
|
||||
install(TARGETS ${SRB2_SDL2_EXE_NAME} ${SRB2_SDL2_EXE_NAME}
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM} MATCHES Windows)
|
||||
find_library(SRB2_SDL2_DLL_SDL2 "SDL2.dll")
|
||||
if(${SRB2_CONFIG_SDL2_USEMIXER})
|
||||
find_library(SRB2_SDL2_DLL_SDL2_mixer "SDL2_mixer.dll")
|
||||
find_library(SRB2_SDL2_DLL_libmikmod-2 "libmikmod-2.dll")
|
||||
find_library(SRB2_SDL2_DLL_libogg_0 "libogg-0.dll")
|
||||
find_library(SRB2_SDL2_DLL_libvorbis_0 "libvorbis-0.dll")
|
||||
find_library(SRB2_SDL2_DLL_libvorbisfile_3 "libvorbisfile-3.dll")
|
||||
find_library(SRB2_SDL2_DLL_smpeg2 "smpeg2.dll")
|
||||
endif()
|
||||
if(${SRB2_CONFIG_HAVE_GME})
|
||||
find_library(SRB2_SDL2_DLL_libgme "libgme.dll")
|
||||
endif()
|
||||
|
||||
install(PROGRAMS
|
||||
${SRB2_SDL2_DLL_SDL2}
|
||||
|
||||
${SRB2_SDL2_DLL_SDL2_mixer}
|
||||
${SRB2_SDL2_DLL_libmikmod}
|
||||
${SRB2_SDL2_DLL_libogg_0}
|
||||
${SRB2_SDL2_DLL_libvorbis_0}
|
||||
${SRB2_SDL2_DLL_libvorbisfile_3}
|
||||
${SRB2_SDL2_DLL_smpeg2}
|
||||
|
||||
${SRB2_SDL2_DLL_libgme}
|
||||
DESTINATION .
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "SDL2 wasn't found, so ${SRB2_SDL2_EXE_NAME} won't be available")
|
||||
endif()
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
set(SRB2_WIN_EXE_NAME srb2dd)
|
||||
|
||||
add_executable(${SRB2_WIN_EXE_NAME} EXCLUDE_FROM_ALL
|
||||
${SRB2_CORE_SOURCES}
|
||||
${SRB2_CORE_HEADERS}
|
||||
|
|
Loading…
Reference in a new issue