axmol/thirdparty/cmake/AxisThirdpartyConfig.cmake

58 lines
1.5 KiB
CMake
Raw Normal View History

2020-11-16 14:47:43 +08:00
# set friendly platform define
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(WINDOWS TRUE)
set(SYSTEM_STRING "Windows Desktop")
2021-08-27 00:05:46 +08:00
if(NOT ("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "Win32"))
set(WIN64 TRUE)
2021-08-27 01:09:39 +08:00
set(ARCH_ALIAS "x64")
else()
set(WIN32 TRUE)
2021-08-27 01:09:39 +08:00
set(ARCH_ALIAS "x86")
endif()
2020-11-16 14:47:43 +08:00
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Android")
set(SYSTEM_STRING "Android")
set(ARCH_ALIAS ${ANDROID_ABI})
2020-11-16 14:47:43 +08:00
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if(ANDROID)
set(SYSTEM_STRING "Android")
else()
set(LINUX TRUE)
set(SYSTEM_STRING "Linux")
endif()
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if(IOS)
set(APPLE TRUE)
set(SYSTEM_STRING "IOS")
else()
set(APPLE TRUE)
set(MACOSX TRUE)
set(SYSTEM_STRING "Mac OSX")
endif()
endif()
# set platform specific path
set(_path_prefix ${CMAKE_CURRENT_SOURCE_DIR}/prebuilt/)
if(IOS)
set(platform_name ios)
set(platform_spec_path ios)
elseif(ANDROID)
set(platform_name android)
set(platform_spec_path android/${ANDROID_ABI})
elseif(WINDOWS)
set(platform_name windows)
if(WIN64)
set(platform_spec_path windows/x64)
else()
set(platform_spec_path windows/x86)
endif()
2020-11-16 14:47:43 +08:00
elseif(MACOSX)
set(platform_name mac)
set(platform_spec_path mac)
elseif(LINUX)
set(platform_name linux)
set(platform_spec_path linux/x64)
2020-11-16 14:47:43 +08:00
endif()
set(platform_spec_path "${_path_prefix}${platform_spec_path}")