1e1ad8c50SMark Nunberg# Gets string/platform information about the specific compiler
2e1ad8c50SMark Nunberg# Defines:
3e1ad8c50SMark Nunberg#  LCB_CC_STRING for the C compiler string (i.e. "msvc", "mingw")
4e1ad8c50SMark Nunberg#  LCB_ARCH_STRING for the target architecture, e.g. "x86"
5e1ad8c50SMark Nunberg
6e1ad8c50SMark Nunberg# Figure out how we're building!
7e1ad8c50SMark NunbergIF(MSVC)
8e1ad8c50SMark Nunberg    IF(CMAKE_CL_64)
9e1ad8c50SMark Nunberg        SET(LCB_ARCH_STRING "amd64")
10e1ad8c50SMark Nunberg    ELSE()
11e1ad8c50SMark Nunberg        SET(LCB_ARCH_STRING "x86")
12e1ad8c50SMark Nunberg    ENDIF(CMAKE_CL_64)
13e1ad8c50SMark Nunberg
14e1ad8c50SMark Nunberg    IF(MSVC80)
15e1ad8c50SMark Nunberg        SET(LCB_CC_STRING "vs8")
16e1ad8c50SMark Nunberg    ELSEIF(MSVC90)
17e1ad8c50SMark Nunberg        SET(LCB_CC_STRING "vc9")
18e1ad8c50SMark Nunberg    ELSEIF(MSVC_VERSION EQUAL 1600)
19e1ad8c50SMark Nunberg        SET(LCB_CC_STRING "vc10")
20e1ad8c50SMark Nunberg    ELSEIF(MSVC_VERSION EQUAL 1700)
21e1ad8c50SMark Nunberg        SET(LCB_CC_STRING "vc11")
220cf47471SMark Nunberg    ELSEIF(MSVC_VERSION EQUAL 1800)
230cf47471SMark Nunberg        SET(LCB_CC_STRING "vc12")
24f0d9cb1fSMark Nunberg    ELSEIF(MSVC_VERSION EQUAL 1900)
25f0d9cb1fSMark Nunberg        SET(LCB_CC_STRING "vc14")
26eb40deacSSergey Avseyev    ELSEIF(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919)
277903de2fSSergey Avseyev        SET(LCB_CC_STRING "vc15")
28b916b7d4SSergey Avseyev    ELSEIF(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS_EQUAL 1929)
29b916b7d4SSergey Avseyev        SET(LCB_CC_STRING "vc16")
30e1ad8c50SMark Nunberg    ENDIF()
31e1ad8c50SMark NunbergELSE()
32e1ad8c50SMark Nunberg    IF(UNIX)
33e1ad8c50SMark Nunberg        SET(LCB_CC_STRING "gcc")
34e1ad8c50SMark Nunberg        EXECUTE_PROCESS(
35e1ad8c50SMark Nunberg            COMMAND
36e1ad8c50SMark Nunberg                uname -m
37e1ad8c50SMark Nunberg            COMMAND
38e1ad8c50SMark Nunberg                tr -d '\n'
39e1ad8c50SMark Nunberg            OUTPUT_VARIABLE
40e1ad8c50SMark Nunberg                LCB_ARCH_STRING)
41e1ad8c50SMark Nunberg    ELSE()
425d255ca1SMark Nunberg        IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
435d255ca1SMark Nunberg            SET(LCB_ARCH_STRING "amd64")
445d255ca1SMark Nunberg        ELSE()
455d255ca1SMark Nunberg            SET(LCB_ARCH_STRING "x86")
465d255ca1SMark Nunberg        ENDIF()
47e1ad8c50SMark Nunberg        SET(LCB_CC_STRING "mingw")
48e1ad8c50SMark Nunberg    ENDIF()
49e1ad8c50SMark NunbergENDIF()
50