diff options
author | Fire-Head <Fire-Head@users.noreply.github.com> | 2021-01-13 21:17:53 +0100 |
---|---|---|
committer | Fire-Head <Fire-Head@users.noreply.github.com> | 2021-01-13 21:17:53 +0100 |
commit | 8baa104453db38734a3eb9e9ff511389d0e72506 (patch) | |
tree | fadc7c4d71f54a2c6a2add1efb1b741b6f9775d5 /CMakeLists.txt | |
parent | Revert "Merge branch 'lcs' of https://github.com/GTAmodding/re3 into lcs" (diff) | |
download | re3-8baa104453db38734a3eb9e9ff511389d0e72506.tar re3-8baa104453db38734a3eb9e9ff511389d0e72506.tar.gz re3-8baa104453db38734a3eb9e9ff511389d0e72506.tar.bz2 re3-8baa104453db38734a3eb9e9ff511389d0e72506.tar.lz re3-8baa104453db38734a3eb9e9ff511389d0e72506.tar.xz re3-8baa104453db38734a3eb9e9ff511389d0e72506.tar.zst re3-8baa104453db38734a3eb9e9ff511389d0e72506.zip |
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 96 |
1 files changed, 67 insertions, 29 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 387400b3..116d8455 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,44 +1,82 @@ cmake_minimum_required(VERSION 3.8) -project(reVC C CXX) +set(EXECUTABLE reLCS) +set(PROJECT RELCS) + +project(${EXECUTABLE} C CXX) list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") if(WIN32) - set(REVC_AUDIOS "NULL" "OAL" "MSS") + set(${PROJECT}_AUDIOS "OAL" "MSS") else() - set(REVC_AUDIOS "NULL" "OAL") + set(${PROJECT}_AUDIOS "OAL") endif() -set(REVC_AUDIO "OAL" CACHE STRING "Audio") +set(${PROJECT}_AUDIO "OAL" CACHE STRING "Audio") -set_property(CACHE REVC_AUDIO PROPERTY STRINGS ${REVC_AUDIOS}) -message(STATUS "REVC_AUDIO = ${REVC_AUDIO} (choices=${REVC_AUDIOS})") -set("REVC_AUDIO_${REVC_AUDIO}" ON) -if(NOT REVC_AUDIO IN_LIST REVC_AUDIOS) - message(FATAL_ERROR "Illegal REVC_AUDIO=${REVC_AUDIO}") -endif() +option(${PROJECT}_WITH_OPUS "Build ${EXECUTABLE} with opus support" OFF) +option(${PROJECT}_WITH_LIBSNDFILE "Build ${EXECUTABLE} with libsndfile (instead of internal decoder)" OFF) -if(REVC_INSTALL) - include(GNUInstallDirs) - set(REVC_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/reVC") +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() -add_subdirectory("vendor/librw") +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(REVC_INSTALL) - include(CMakePackageConfigHelpers) - configure_package_config_file(reVC-config.cmake.in reVC-config.cmake - INSTALL_DESTINATION "${CMAKE_INSTALL_PREFIX}" - ) - install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/reVC-config.cmake" - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" - ) - install( - EXPORT reVC-targets - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" - ) - - include(CMakeCPack.cmake) +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() |