[vcpkg] Improve defaults for other platforms

This commit is contained in:
Robert Schumacher 2018-03-06 10:07:39 -08:00
parent ad7fa55bb0
commit f56a5e4e94
6 changed files with 37 additions and 2 deletions

View File

@ -57,9 +57,9 @@ endif()
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone")
set(_VCPKG_TARGET_TRIPLET_PLAT uwp)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_VCPKG_TARGET_TRIPLET_PLAT linux)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set(_VCPKG_TARGET_TRIPLET_PLAT osx)
else()
set(_VCPKG_TARGET_TRIPLET_PLAT windows)

View File

@ -154,6 +154,12 @@ function(vcpkg_configure_cmake)
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" OR NOT DEFINED VCPKG_CMAKE_SYSTEM_NAME)
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/windows.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/linux.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android")
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/android.cmake")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")
list(APPEND _csc_OPTIONS "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_ROOT_DIR}/scripts/toolchains/osx.cmake")
endif()
list(APPEND _csc_OPTIONS

View File

@ -106,6 +106,8 @@ function(vcpkg_find_acquire_program VAR)
set(PROGNAME ninja)
set(SUBDIR "ninja-1.8.2")
set(PATHS ${DOWNLOADS}/tools/ninja/${SUBDIR})
set(BREW_PACKAGE_NAME "ninja")
set(APT_PACKAGE_NAME "ninja-build")
set(URL "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-win.zip")
set(ARCHIVE "ninja-1.8.2-win.zip")
set(HASH 9b9ce248240665fcd6404b989f3b3c27ed9682838225e6dc9b67b551774f251e4ff8a207504f941e7c811e7a8be1945e7bcb94472a335ef15e23a0200a32e6d5)
@ -181,6 +183,16 @@ function(vcpkg_find_acquire_program VAR)
do_find()
if("${${VAR}}" MATCHES "-NOTFOUND")
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
set(EXAMPLE ".")
if(DEFINED BREW_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(EXAMPLE ":\n brew install ${BREW_PACKAGE_NAME}")
elseif(DEFINED APT_PACKAGE_NAME AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
set(EXAMPLE ":\n sudo apt-get install ${APT_PACKAGE_NAME}")
endif()
message(FATAL_ERROR "Could not find ${PROGNAME}. Please install it via your package manager${EXAMPLE}")
endif()
vcpkg_download_distfile(ARCHIVE_PATH
URLS ${URL}
SHA512 ${HASH}

View File

@ -0,0 +1,13 @@
set(ANDROID_CPP_FEATURES "rtti exceptions" CACHE STRING "")
set(CMAKE_SYSTEM_NAME Android CACHE STRING "")
set(ANDROID_ABI x86_64 CACHE STRING "")
set(ANDROID_TOOLCHAIN clang CACHE STRING "")
set(ANDROID_NATIVE_API_LEVEL 21 CACHE STRING "")
set(CMAKE_ANDROID_NDK_TOOLCHAIN_VERSION clang CACHE STRING "")
if(NOT EXISTS "$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/build/cmake/android.toolchain.cmake")
message(FATAL_ERROR "Could not find android ndk. Searched at $ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b")
endif()
include("$ENV{ProgramData}/Microsoft/AndroidNDK64/android-ndk-r13b/build/cmake/android.toolchain.cmake")

View File

@ -0,0 +1,3 @@
cmake_minimum_required(VERSION 3.5)
set(CMAKE_SYSTEM_NAME Linux CACHE STRING "")

View File

@ -0,0 +1 @@
set(CMAKE_SYSTEM_NAME Darwin CACHE STRING "")