Given this is such a common issue, geronto-posting:
if(UNIX AND NOT APPLE)
set(LINUX TRUE)
endif()
# if(NOT LINUX) should work, too, if you need that
if(LINUX)
message(STATUS ">>> Linux")
# linux stuff here
else()
message(STATUS ">>> Not Linux")
# stuff that should happen not on Linux
endif()