Remove CPM cmake

This commit is contained in:
Patrick Nicolas
2023-12-17 10:15:28 +01:00
parent 45cc2ea0c3
commit d6961d35dc
3 changed files with 14 additions and 49 deletions
+13 -7
View File
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.20)
project(WiVRn VERSION 0.7.1 LANGUAGES C CXX)
project(WiVRn VERSION 0.0.0 LANGUAGES C CXX)
# Set default for FetchContent projects
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.24)
@@ -10,8 +12,6 @@ endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 20)
# See: https://github.com/cpm-cmake/CPM.cmake
include("cmake/CPM.cmake")
include(FetchContent)
include(ExternalProject)
include("cmake/AutoOption.cmake")
@@ -100,10 +100,16 @@ if(ANDROID)
android_ndk_import_module_native_app_glue()
endif()
FetchContent_Declare(spdlog URL https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz)
FetchContent_Declare(glm URL https://github.com/g-truc/glm/archive/refs/tags/0.9.9.8.tar.gz)
FetchContent_Declare(tinygltf URL https://github.com/syoyo/tinygltf/archive/refs/tags/v2.6.3.tar.gz)
FetchContent_Declare(boostpfr URL https://github.com/boostorg/pfr/archive/refs/tags/2.0.3.tar.gz)
# Common dependencies
FetchContent_Declare(boostpfr URL https://github.com/boostorg/pfr/archive/refs/tags/2.0.3.tar.gz)
# Client dependencies
FetchContent_Declare(glm URL https://github.com/g-truc/glm/archive/refs/tags/0.9.9.8.tar.gz)
FetchContent_Declare(openxr_loader URL https://github.com/KhronosGroup/OpenXR-SDK/archive/refs/tags/release-1.0.32.tar.gz)
FetchContent_Declare(spdlog URL https://github.com/gabime/spdlog/archive/refs/tags/v1.11.0.tar.gz)
FetchContent_Declare(tinygltf URL https://github.com/syoyo/tinygltf/archive/refs/tags/v2.6.3.tar.gz)
# Server dependencies
FetchContent_Declare(monado
GIT_REPOSITORY https://gitlab.freedesktop.org/monado/monado
GIT_TAG c5f4f0ab7addd4631c295b2ca6e0c7458cd29788
+1 -9
View File
@@ -44,15 +44,7 @@ if(ANDROID)
PROPERTY IMPORTED_LOCATION ${PICO_SDK_PATH}/libs/android.${ANDROID_ABI}/libopenxr_loader.so)
target_link_libraries(wivrn OpenXR)
else()
CPMAddPackage( # We're scraping the comment after the NAME for some other scripts
NAME openxr_loader # 1.0.28
VERSION 1.0.27
GITHUB_REPOSITORY KhronosGroup/OpenXR-SDK
GIT_TAG "release-1.0.28"
OPTIONS
"BUILD_WITH_SYSTEM_JSONCPP OFF"
"DYNAMIC_LOADER ON"
)
FetchContent_MakeAvailable(openxr_loader)
target_link_libraries(wivrn openxr_loader)
endif()
-33
View File
@@ -1,33 +0,0 @@
set(CPM_DOWNLOAD_VERSION 0.38.1)
if(CPM_SOURCE_CACHE)
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
elseif(DEFINED ENV{CPM_SOURCE_CACHE})
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
else()
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake")
endif()
# Expand relative path. This is important if the provided path contains a tilde (~)
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE)
function(download_cpm)
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}")
file(DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake
${CPM_DOWNLOAD_LOCATION}
)
endfunction()
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION}))
download_cpm()
else()
# resume download if it previously failed
file(READ ${CPM_DOWNLOAD_LOCATION} check)
if("${check}" STREQUAL "")
download_cpm()
endif()
unset(check)
endif()
include(${CPM_DOWNLOAD_LOCATION})