mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-01 18:35:40 +00:00
e38467ef3a
# Conflicts: # .github/workflows/reLCS_msvc_amd64.yml # .github/workflows/reLCS_msvc_x86.yml # README.md # gamefiles/TEXT/american.gxt # gamefiles/TEXT/french.gxt # gamefiles/TEXT/german.gxt # gamefiles/TEXT/italian.gxt # gamefiles/TEXT/spanish.gxt # premake5.lua # src/animation/AnimManager.cpp # src/animation/AnimationId.h # src/audio/MusicManager.cpp # src/audio/audio_enums.h # src/control/Script7.cpp # src/core/FileLoader.cpp # src/core/re3.cpp # src/extras/custompipes_d3d9.cpp # src/extras/custompipes_gl.cpp # src/extras/postfx.cpp # src/extras/shaders/colourfilterVC.frag # src/extras/shaders/colourfilterVC_PS.hlsl # src/extras/shaders/make_hlsl.cmd # src/extras/shaders/obj/colourfilterVC_PS.cso # src/extras/shaders/obj/colourfilterVC_PS.inc # src/extras/shaders/obj/colourfilterVC_frag.inc # src/peds/PedFight.cpp # src/render/Font.cpp # src/render/Hud.cpp # src/render/Particle.cpp # src/render/WaterCannon.cpp # src/skel/win/gtavc.ico # src/vehicles/Automobile.cpp # utils/gxt/american.txt # utils/gxt/french.txt # utils/gxt/german.txt # utils/gxt/italian.txt # utils/gxt/spanish.txt
86 lines
2.8 KiB
CMake
86 lines
2.8 KiB
CMake
cmake_minimum_required(VERSION 3.8)
|
|
|
|
set(EXECUTABLE reLCS)
|
|
set(PROJECT RELCS)
|
|
|
|
project(${EXECUTABLE} C CXX)
|
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
|
|
|
include(GetGitRevisionDescription)
|
|
get_git_head_revision(GIT_REFSPEC GIT_SHA1 "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR")
|
|
message(STATUS "Building ${CMAKE_PROJECT_NAME} GIT SHA1: ${GIT_SHA1}")
|
|
|
|
if(WIN32)
|
|
set(${PROJECT}_AUDIOS "OAL" "MSS")
|
|
else()
|
|
set(${PROJECT}_AUDIOS "OAL")
|
|
endif()
|
|
|
|
set(${PROJECT}_AUDIO "OAL" CACHE STRING "Audio")
|
|
|
|
option(${PROJECT}_WITH_OPUS "Build ${EXECUTABLE} with opus support" OFF)
|
|
option(${PROJECT}_WITH_LIBSNDFILE "Build ${EXECUTABLE} with libsndfile (instead of internal decoder)" OFF)
|
|
|
|
set_property(CACHE ${PROJECT}_AUDIO PROPERTY STRINGS ${${PROJECT}_AUDIOS})
|
|
message(STATUS "${PROJECT}_AUDIO = ${${PROJECT}_AUDIO} (choices=${${PROJECT}_AUDIOS})")
|
|
set("${PROJECT}_AUDIO_${${PROJECT}_AUDIO}" ON)
|
|
if(NOT ${PROJECT}_AUDIO IN_LIST ${PROJECT}_AUDIOS)
|
|
message(FATAL_ERROR "Illegal ${PROJECT}_AUDIO=${${PROJECT}_AUDIO}")
|
|
endif()
|
|
|
|
option(${PROJECT}_VENDORED_LIBRW "Use vendored librw" ON)
|
|
if(${PROJECT}_VENDORED_LIBRW)
|
|
add_subdirectory(vendor/librw)
|
|
else()
|
|
find_package(librw REQUIRED)
|
|
endif()
|
|
add_subdirectory(src)
|
|
|
|
if(${PROJECT}_INSTALL)
|
|
install(DIRECTORY gamefiles/ DESTINATION ".")
|
|
if(LIBRW_PLATFORM_NULL)
|
|
set(platform "-null")
|
|
elseif(LIBRW_PLATFORM_PS2)
|
|
set(platform "-ps2")
|
|
elseif(LIBRW_PLATFORM_GL3)
|
|
if(LIBRW_GL3_GFXLIB STREQUAL "GLFW")
|
|
set(platform "-gl3-glfw")
|
|
else()
|
|
set(platform "-gl3-sdl2")
|
|
endif()
|
|
elseif(LIBRW_PLATFORM_D3D9)
|
|
set(platform "-d3d9")
|
|
endif()
|
|
if(${PROJECT}_AUDIO_OAL)
|
|
set(audio "-oal")
|
|
elseif(${PROJECT}_AUDIO_MSS)
|
|
set(audio "-mss")
|
|
endif()
|
|
if(${PROJECT}_WITH_OPUS)
|
|
set(audio "${audio}-opus")
|
|
endif()
|
|
if(NOT LIBRW_PLATFORM_PS2)
|
|
if(WIN32)
|
|
set(os "-win")
|
|
elseif(APPLE)
|
|
set(os "-apple")
|
|
elseif(UNIX)
|
|
set(os "-linux")
|
|
else()
|
|
set(compiler "-UNK")
|
|
message(WARNING "Unknown os. Created cpack package will be wrong. (override using cpack -P)")
|
|
endif()
|
|
endif()
|
|
|
|
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}${platform}${audio}${os}${compiler}")
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GTA III reversed")
|
|
set(CPACK_PACKAGE_VENDOR "GTAModding")
|
|
# FIXME: missing license (https://github.com/GTAmodding/re3/issues/794)
|
|
# set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/LICENSE")
|
|
# set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
|
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}")
|
|
set(CPACK_GENERATOR "TXZ")
|
|
include(CPack)
|
|
endif()
|