CMake で CMAKE_SYSTEM_NAME を利用して Linux 等の情報を調べる ― 2021年02月14日 00時31分15秒
他にも追加情報を調べたいのなら CMAKE_SYSTEM_NAME といった別の変数を使うことも出来る。
OS 名に関しては、Variables that Describe the Systemに、CMake が生成する変数に付いてはcmake-variables(7) に詳細が記述されている
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
# Linux
else()
# non-Linux
endif()
最近のコメント