but I want to specifically look for the intel compiler. I guess I could just exec icc and see what comes back. Checking for $CC=icc might be useful, but mine is set to /opt/intel/cc/10.0.023/bin/icc..

Any suggestions would be good.

I use this:

SET(MANTA_COMPILER_NAME_REGEXPR "icc.*$")

IF(NOT CMAKE_COMPILER_IS_GNUCC)
  # This regular expression also matches things like icc-9.1
  IF   (CMAKE_C_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
    SET(USING_ICC TRUE)
  ENDIF(CMAKE_C_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
ELSE(NOT CMAKE_COMPILER_IS_GNUCC)
  SET(USING_GCC TRUE)
ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)

SET(MANTA_COMPILER_NAME_REGEXPR "icpc.*$")
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
  IF   (CMAKE_CXX_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
    SET(USING_ICPC TRUE)

    EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
      ARGS --version
      OUTPUT_VARIABLE TEMP)

    STRING(REGEX MATCH "([0-9\\.]+)"
      INTEL_COMPILER_VERSION
      ${TEMP})

    MARK_AS_ADVANCED(INTEL_COMPILER_VERSION)
  ENDIF(CMAKE_CXX_COMPILER MATCHES ${MANTA_COMPILER_NAME_REGEXPR})
ELSE(NOT CMAKE_COMPILER_IS_GNUCXX)
  SET(USING_GPP TRUE)
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to