The usual way to check if you’re generating for a 64 bits architecture is to test CMAKE_SIZEOF_VOID_P:
project( ... )
...
# won't work before project()!
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# 64 bits
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
# 32 bits
endif()
This variable is only set after the project command!