Allow both dependencies to have their Git URLs and tags customized

This commit is contained in:
Jesse Talavera-Greenberg 2023-03-12 18:33:44 -04:00
parent 81cd0cd28e
commit 0ad5f80ca4

View File

@ -12,21 +12,61 @@ include(FetchContent)
find_package(Git)
if (NOT MELONDS_REPOSITORY_URL)
set(
MELONDS_REPOSITORY_URL
"https://github.com/melonDS-emu/melonDS.git"
CACHE STRING
"melonDS repository URL. Set this to use a melonDS fork or mirror."
FORCE
)
endif ()
if (NOT MELONDS_REPOSITORY_TAG)
set(
MELONDS_REPOSITORY_TAG
"4ba7a2c5"
CACHE STRING
"melonDS repository commit hash or tag. Set this when using a new version of melonDS, or when using a custom branch."
FORCE
)
endif ()
FetchContent_Declare(
melonDS
GIT_REPOSITORY https://github.com/melonDS-emu/melonDS.git
GIT_TAG 4ba7a2c5
) # TODO: Make GIT_TAG and GIT_REPOSITORY values configurable
GIT_REPOSITORY "${MELONDS_REPOSITORY_URL}"
GIT_TAG "${MELONDS_REPOSITORY_TAG}"
)
FetchContent_GetProperties(melonDS)
set(BUILD_QT_SDL OFF)
if (NOT LIBRETRO_COMMON_REPOSITORY_URL)
set(
LIBRETRO_COMMON_REPOSITORY_URL
"https://github.com/libretro/libretro-common.git"
CACHE STRING
"libretro-common repository URL. Set this to use a fork or mirror."
FORCE
)
endif ()
if (NOT LIBRETRO_COMMON_REPOSITORY_TAG)
set(
LIBRETRO_COMMON_REPOSITORY_TAG
"20a43ba"
CACHE STRING
"libretro-common repository commit hash or tag. Set this when using a new version or a custom branch."
FORCE
)
endif ()
FetchContent_Declare(
libretro-common
GIT_REPOSITORY https://github.com/libretro/libretro-common.git
GIT_TAG 20a43ba
) # TODO: Make GIT_TAG and GIT_REPOSITORY values configurable
GIT_REPOSITORY "${LIBRETRO_COMMON_REPOSITORY_URL}"
GIT_TAG "${LIBRETRO_COMMON_REPOSITORY_TAG}"
)
FetchContent_GetProperties(libretro-common)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${FETCHCONTENT_BASE_DIR}/melonds-src/cmake" "${CMAKE_MODULE_PATH}")