Last active
May 14, 2023 15:23
-
-
Save tjyuyao/28d13f2209cd0988bf562897e1a4eb37 to your computer and use it in GitHub Desktop.
cmake architecture detect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64") # for desktop | |
message("1") | |
ELSE(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64") # for tx2 | |
message("2") | |
ELSE() | |
message(FATAL_ERROR "Unknown System Architecture: ${CMAKE_SYSTEM_PROCESSOR}") | |
ENDIF() |
Well, on my Windows 10 with CMake 3.26.1 ${CMAKE_SYSTEM_PROCESSOR} equals to AMD64
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the first
ELSE
should beELSEIF
, other than that this works fine!