summaryrefslogtreecommitdiffstats
path: root/cmake/QtPlatformSupport.cmake
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2018-10-24 15:20:27 +0200
committerTobias Hunger <tobias.hunger@qt.io>2018-11-01 11:48:46 +0000
commite9c45bbdddd4df005bdaa5eea9740d351e6eaea2 (patch)
tree23765d4650f8f349d1f32e0fe4b1bc678cae7568 /cmake/QtPlatformSupport.cmake
parent345e6b0213b1273b698163064f80d33bc7ce64a9 (diff)
Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io> Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Done-by: Kevin Funk <kevin.funk@kdab.com> Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Done-by: Simon Hausmann <simon.hausmann@qt.io> Done-by: Tobias Hunger <tobias.hunger@qt.io> Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Done-by: Volker Krause <volker.krause@kdab.com> Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Diffstat (limited to 'cmake/QtPlatformSupport.cmake')
-rw-r--r--cmake/QtPlatformSupport.cmake41
1 files changed, 41 insertions, 0 deletions
diff --git a/cmake/QtPlatformSupport.cmake b/cmake/QtPlatformSupport.cmake
new file mode 100644
index 0000000000..4f3103e304
--- /dev/null
+++ b/cmake/QtPlatformSupport.cmake
@@ -0,0 +1,41 @@
+function(set01 result)
+ if (${ARGN})
+ set("${result}" 1 PARENT_SCOPE)
+ else()
+ set("${result}" 0 PARENT_SCOPE)
+ endif()
+endfunction()
+
+set01(LINUX CMAKE_SYSTEM_NAME STREQUAL "Linux")
+set01(HPUX CMAKE_SYSTEM_NAME STREQUAL "HPUX")
+set01(ANDROID CMAKE_SYSTEM_NAME STREQUAL "Android") # FIXME: How to identify this?
+set01(NACL CMAKE_SYSTEM_NAME STREQUAL "NaCl") # FIXME: How to identify this?
+set01(INTEGRITY CMAKE_SYSTEM_NAME STREQUAL "Integrity") # FIXME: How to identify this?
+set01(VXWORKS CMAKE_SYSTEM_NAME STREQUAL "VxWorks") # FIXME: How to identify this?
+set01(QNX CMAKE_SYSTEM_NAME STREQUAL "QNX") # FIXME: How to identify this?
+set01(OPENBSD CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") # FIXME: How to identify this?
+set01(FREEBSD CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # FIXME: How to identify this?
+set01(NETBSD CMAKE_SYSTEM_NAME STREQUAL "NetBSD") # FIXME: How to identify this?
+set01(WASM CMAKE_SYSTEM_NAME STREQUAL "Webassembly") # FIXME: How to identify this?
+
+set01(BSD APPLE OR OPENBSD OR FREEBSD OR NETBSD)
+
+set01(WINRT WIN32 AND CMAKE_VS_PLATFORM_TOOSLET STREQUAL "winrt") # FIXME: How to identify this?
+
+set01(APPLE_OSX APPLE) # FIXME: How to identify this? For now assume that always building for macOS.
+set01(APPLE_UIKIT APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "uikit") # FIXME: How to identify this?
+set01(APPLE_IOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "ios") # FIXME: How to identify this?
+set01(APPLE_TVOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "tvos") # FIXME: How to identify this?
+set01(APPLE_WATCHOS APPLE AND CMAKE_XCODE_PLATFORM_TOOLSET STREQUAL "watchos") # FIXME: How to identify this?
+
+set01(ANDROID_EMBEDDED ANDROID) # FIXME: How to identify this?
+
+set01(GCC CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+set01(CLANG CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+set01(ICC CMAKE_C_COMPILER MATCHES "icc|icl")
+
+if(CMAKE_SIZEOF_VOID_P EQUAL 8)
+ set(QT_64BIT TRUE)
+elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
+ set(QT_32BIT TRUE)
+endif()