File: CompilerIdVendorTest.cmake.in

package info (click to toggle)
cmake 2.8.11.1-1~bpo70+1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy-backports
  • size: 37,056 kB
  • sloc: cpp: 157,219; ansic: 137,155; yacc: 3,254; sh: 2,745; xml: 2,483; lex: 1,028; lisp: 215; python: 199; objc: 134; f90: 105; perl: 99; fortran: 93; makefile: 65; tcl: 55; asm: 28; php: 25; ruby: 22; java: 20
file content (31 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This is not supposed to be included by user code, but we need to
# test it.
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)

set(MY_BINARY_DIR "@CMAKE_CURRENT_BINARY_DIR@/CompilerIdVendor")
file(REMOVE_RECURSE ${MY_BINARY_DIR})
file(MAKE_DIRECTORY ${MY_BINARY_DIR})

set(CMAKE_MyLang_COMPILER ${CMAKE_COMMAND})
set(CMAKE_MyLang_COMPILER_ID_ARG1)
set(CMAKE_MyLang_COMPILER_ID_FLAGS_LIST)
set(CMAKE_MyLang_COMPILER_ID_DIR ${MY_BINARY_DIR})

file(WRITE "${MY_BINARY_DIR}/BogusVendor.cmake" "message(\"This is a BogusVendor compiler\")")
list(APPEND CMAKE_MyLang_COMPILER_ID_VENDORS BogusVendor)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_FLAGS_BogusVendor -P BogusVendor.cmake)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_REGEX_BogusVendor ThisDoesNotMatch_BogusVendor)

file(WRITE "${MY_BINARY_DIR}/MyVendor.cmake" "message(\"This is a MyVendor compiler\")")
list(APPEND CMAKE_MyLang_COMPILER_ID_VENDORS MyVendor)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_FLAGS_MyVendor -P MyVendor.cmake)
set(CMAKE_MyLang_COMPILER_ID_VENDOR_REGEX_MyVendor MyVendor)

set(CMAKE_BINARY_DIR ${MY_BINARY_DIR})
cmake_determine_compiler_id_vendor(MyLang)

if("${CMAKE_MyLang_COMPILER_ID}" STREQUAL "MyVendor")
  message(STATUS "Found MyVendor compiler id!")
else()
  message(FATAL_ERROR "Did not find MyVendor compiler id: [${CMAKE_MyLang_COMPILER_ID}]")
endif()