Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
menu_book Course Curriculum (CMake) expand_more
CMake / Variables & Flow

if elseif else

Learn if elseif else in CMake with a dedicated explanation, a topic-specific example, edge guidance, and a mastery check.

12 min read • Beginner
cmake-013.cmake
cmake
set(ENVIRONMENT "staging")
if(ENVIRONMENT STREQUAL "production")
  message(STATUS "prod")
elseif(ENVIRONMENT STREQUAL "staging")
  message(STATUS "stage")
else()
  message(STATUS "dev")
endif()
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content