Skip to content

Instantly share code, notes, and snippets.

@JrGoodle
Last active August 29, 2015 14:21
Show Gist options
  • Save JrGoodle/bcbfb78c33e16cdc0a5e to your computer and use it in GitHub Desktop.
Save JrGoodle/bcbfb78c33e16cdc0a5e to your computer and use it in GitHub Desktop.
Check for current C++ compiler
Configuration based on current compiler
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
# using Clang
set(COMPILER_NAME "Clang")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using GCC
set(COMPILER_NAME "GCC")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# using Visual Studio C++
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment