summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/try_compile/ConfigureLog.cmake
blob: a8977197557e123933b273aed834a9e45bb07035 (plain)
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
32
33
34
35
36
37
38
enable_language(C)

set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
  ABCDEFGHIJKLMNOPQRSTUVWXYZ
  abcdefghijklmnopqrstuvwxyz
  _-0123456789
  "WITH SPACE"
  )
set(ABCDEFGHIJKLMNOPQRSTUVWXYZ "Upper case")
set(abcdefghijklmnopqrstuvwxyz "Lower case")
set(_-0123456789 "Other chars")
set("WITH SPACE" "Space")

try_compile(COMPILE_RESULT
  SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-bad.c
  LOG_DESCRIPTION "Source that should not compile."
  )

unset(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES)

try_compile(COMPILE_RESULT
  SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c
  NO_LOG
  )

message(CHECK_START "Check 1")
message(CHECK_START "Check 2")
try_compile(COMPILE_RESULT
  SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ConfigureLog-test.c
  LOG_DESCRIPTION "Source that should compile."
  )
if (COMPILE_RESULT)
  message(CHECK_PASS "passed")
  message(CHECK_PASS "passed")
else()
  message(CHECK_FAIL "failed")
  message(CHECK_FAIL "failed")
endif()