C++学习(四零八)CMake操作系统类型android windows ios

Posted hankern

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++学习(四零八)CMake操作系统类型android windows ios相关的知识,希望对你有一定的参考价值。

C++学习(四零九)CMAKE_SYSTEM_NAME确定操作系统类型_hankern的专栏-CSDN博客The name of the operating system for which CMake is to build. See the CMAKE_SYSTEM_VERSION variable for the OS version.Note that CMAKE_SYSTEM_NAME is not set to anything by default when running in script mode, since it's not building anything.System ..https://blog.csdn.net/hankern/article/details/121173971

# -----------------------------------------------------------------------------
# O/S Detection

# these are defined in common.h too
SET(LINUX   False)
SET(FREEBSD False)
SET(MACOS   False)

# Detect the operating system
IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
    SET(TARGET_OS_NAME "macos")
    SET(TARGET_OS 3)
    SET(MACOS True)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
    SET(TARGET_OS_NAME "freebsd")
    SET(TARGET_OS 2)
    SET(FREEBSD True)
ELSE()
    SET(TARGET_OS_NAME "linux")
    SET(TARGET_OS 1)
    SET(LINUX True)
ENDIF()

# show the operating system on the console
message(STATUS "operating system: ${TARGET_OS_NAME} (TARGET_OS=${TARGET_OS})")

以上是关于C++学习(四零八)CMake操作系统类型android windows ios的主要内容,如果未能解决你的问题,请参考以下文章

C++学习(四零九)CMAKE_SYSTEM_NAME确定操作系统类型

C++学习(三四零)osg用CMake生成时是如何引入CURL_DIR的

C++学习(四零二)记录20211024

C++学习(四零一)config.guess config.sub

C++学习(四零三)-lm -ldl

C++学习(四零六)AI三大法则