From fd87a081bb6acc33ec4e581f1ce60edcad80eda1 Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Thu, 27 Jun 2019 00:00:48 +0200 Subject: [PATCH] Introduce an easier way to identify target systems... (#6846) * Introduce an easier way to identify target systems... * fix missing () * move the include around. also added vcpkg_common_functions to be automatically included * remove warning message * added remaining VCPKG_CMAKE_SYSTEM_NAMEs found only in vcpkg_configure_cmake to load a toolchain. * remove warning again from messed up merge --- scripts/cmake/vcpkg_common_definitions.cmake | 14 ++++++++++++++ scripts/ports.cmake | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 scripts/cmake/vcpkg_common_definitions.cmake diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake new file mode 100644 index 0000000000..8dc05de3cc --- /dev/null +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -0,0 +1,14 @@ +if (NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(VCPKG_TARGET_IS_WINDOWS 1) + if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set(VCPKG_TARGET_IS_UWP 1) + endif() +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") + set(VCPKG_TARGET_IS_OSX 1) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(VCPKG_TARGET_IS_LINUX 1) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android") + set(VCPKG_TARGET_IS_ANDROID 1) +elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + set(VCPKG_TARGET_IS_FREEBSD 1) +endif() diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 7a5f2749f3..118cc94813 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -68,6 +68,8 @@ if(CMD MATCHES "^BUILD$") include(${CMAKE_TRIPLET_FILE}) set(TRIPLET_SYSTEM_ARCH ${VCPKG_TARGET_ARCHITECTURE}) + include(${CMAKE_CURRENT_LIST_DIR}/cmake/vcpkg_common_definitions.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/cmake/vcpkg_common_functions.cmake) include(${CURRENT_PORT_DIR}/portfile.cmake) set(BUILD_INFO_FILE_PATH ${CURRENT_PACKAGES_DIR}/BUILD_INFO)