2020-10-31 22:14:28 +00:00
|
|
|
cmake_minimum_required(VERSION 3.8)
|
|
|
|
|
|
|
|
project(re3 C CXX)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
|
|
|
|
|
|
|
if(WIN32)
|
2020-12-06 14:42:15 +00:00
|
|
|
set(RE3_AUDIOS "OAL" "MSS")
|
2020-10-31 22:14:28 +00:00
|
|
|
else()
|
2020-12-06 14:42:15 +00:00
|
|
|
set(RE3_AUDIOS "OAL")
|
2020-10-31 22:14:28 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(RE3_AUDIO "OAL" CACHE STRING "Audio")
|
|
|
|
|
2021-01-12 20:38:55 +00:00
|
|
|
option(RE3_WITH_OPUS "Build re3 with opus support" OFF)
|
2021-01-11 00:29:43 +00:00
|
|
|
option(RE3_WITH_LIBSNDFILE "Build re3 with libsndfile (instead of internal decoder)" OFF)
|
2020-12-06 14:42:15 +00:00
|
|
|
|
2020-10-31 22:14:28 +00:00
|
|
|
set_property(CACHE RE3_AUDIO PROPERTY STRINGS ${RE3_AUDIOS})
|
|
|
|
message(STATUS "RE3_AUDIO = ${RE3_AUDIO} (choices=${RE3_AUDIOS})")
|
|
|
|
set("RE3_AUDIO_${RE3_AUDIO}" ON)
|
|
|
|
if(NOT RE3_AUDIO IN_LIST RE3_AUDIOS)
|
|
|
|
message(FATAL_ERROR "Illegal RE3_AUDIO=${RE3_AUDIO}")
|
|
|
|
endif()
|
|
|
|
|
2020-12-06 12:54:06 +00:00
|
|
|
option(RE3_VENDORED_LIBRW "Use vendored librw" ON)
|
|
|
|
if(RE3_VENDORED_LIBRW)
|
|
|
|
add_subdirectory(vendor/librw)
|
|
|
|
else()
|
|
|
|
find_package(librw REQUIRED)
|
|
|
|
endif()
|
2020-10-31 22:14:28 +00:00
|
|
|
add_subdirectory(src)
|
|
|
|
|
|
|
|
if(RE3_INSTALL)
|
2021-01-03 19:38:53 +00:00
|
|
|
install(DIRECTORY gamefiles/ DESTINATION ".")
|
2021-01-03 15:32:00 +00:00
|
|
|
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(RE3_AUDIO_OAL)
|
|
|
|
set(audio "-oal")
|
|
|
|
elseif(RE3_AUDIO_MSS)
|
|
|
|
set(audio "-mss")
|
|
|
|
endif()
|
|
|
|
if(RE3_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}")
|
2020-12-06 12:54:06 +00:00
|
|
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "GTA III reversed")
|
|
|
|
set(CPACK_PACKAGE_VENDOR "GTAModding")
|
2021-01-03 15:32:00 +00:00
|
|
|
# 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")
|
2020-12-06 12:54:06 +00:00
|
|
|
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}")
|
2021-01-03 15:32:00 +00:00
|
|
|
set(CPACK_GENERATOR "TXZ")
|
2020-12-06 12:54:06 +00:00
|
|
|
include(CPack)
|
2020-10-31 22:14:28 +00:00
|
|
|
endif()
|