CMake平台判断

mac2022-06-30  62

MESSAGE(STATUS "operation system is ${CMAKE_SYSTEM}")    IF (CMAKE_SYSTEM_NAME MATCHES "Linux")      MESSAGE(STATUS "current platform: Linux ")  ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")      MESSAGE(STATUS "current platform: Windows")  ELSEIF (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")      MESSAGE(STATUS "current platform: FreeBSD")  ELSE ()      MESSAGE(STATUS "other platform: ${CMAKE_SYSTEM_NAME}")  ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")    MESSAGE(STSTUS "###################################")  

 

IF (WIN32)      MESSAGE(STATUS "Now is windows")  ELSEIF (APPLE)      MESSAGE(STATUS "Now is Apple systens.")  ELSEIF (UNIX)      MESSAGE(STATUS "Now is UNIX-like OS's. Including aPPLE os x  and CygWin")  ENDIF () 

转载于:https://www.cnblogs.com/Dennis-mi/articles/8053229.html

最新回复(0)