junxnone / xwiki

https://junxnone.github.io/xwiki/
0 stars 0 forks source link

Build Cmake Platforms #58

Open junxnone opened 2 years ago

junxnone commented 2 years ago

Reference

Brief

Platform Variables Description
UNIX is TRUE on all UNIX-like OS's, including Apple OS X and CygWin
WIN32 is TRUE on Windows. Prior to 2.8.4 this included CygWin
APPLE is TRUE on Apple systems. Note this does not imply the system is Mac OS X, only that APPLE is #defined in C/C++ header files.
MINGW is TRUE when using the MinGW compiler in Windows
MSYS is TRUE when using the MSYS developer environment in Windows
CYGWIN is TRUE on Windows when using the CygWin version of cmake
CMAKE_SYSTEM_NAME Environments Where Seen
Windows Windows (Visual Studio, MinGW GCC)
Darwin macOS/OS X (Clang, GCC)
Linux Linux (GCC, Intel, PGI)
Android Android NDK (GCC, Clang)
FreeBSD FreeBSD
CrayLinuxEnvironment Cray supercomputers (Cray compiler)
MSYS Windows (MSYS2 shell native GCC)

Examples

message(STATUS "CMAKE_SYSTEM IS ${CMAKE_SYSTEM}")
message(STATUS "CMAKE_SYSTEM_NAME IS ${CMAKE_SYSTEM_NAME}")
message(STATUS "CMAKE_SYSTEM_VERSION IS ${CMAKE_SYSTEM_VERSION}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR IS ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "CMAKE_HOST_SYSTEM_NAME IS ${CMAKE_HOST_SYSTEM_NAME}")
message(STATUS "UNIX IS  ${UNIX}")
message(STATUS "CMAKE_C_COMPILER_ID IS  ${CMAKE_C_COMPILER_ID}")
message(STATUS "CMAKE_CXX_COMPILER_ID IS  ${CMAKE_CXX_COMPILER_ID}")
message(STATUS "CMAKE_C_COMPILER_VERSION IS  ${CMAKE_C_COMPILER_VERSION}")
message(STATUS "CMAKE_CXX_COMPILER_VERSION IS  ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "CMAKE_C_COMPILER IS  ${CMAKE_C_COMPILER}")
message(STATUS "CMAKE_CXX_COMPILER IS  ${CMAKE_CXX_COMPILER}")
message(STATUS "CMAKE_C_COMPILER_LOADED IS  ${CMAKE_C_COMPILER_LOADED}")
message(STATUS "CMAKE_CXX_COMPILER_LOADED IS  ${CMAKE_CXX_COMPILER_LOADED}")