summaryrefslogtreecommitdiff
path: root/Tests/SystemInformation/CMakeLists.txt
blob: c4285758eb74eea56fe66f416bc6eb4c62dac6cb (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
cmake_minimum_required (VERSION 2.6)
PROJECT(SystemInformation)

INCLUDE_DIRECTORIES("This does not exists")
GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES)
SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}")

MESSAGE("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT")


CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/SystemInformation.in 
${SystemInformation_BINARY_DIR}/SystemInformation.out)
CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in 
${SystemInformation_BINARY_DIR}/DumpInformation.h)
ADD_EXECUTABLE(SystemInformation DumpInformation.cxx)

MACRO(FOO args)
  MESSAGE("Test macro")
ENDMACRO(FOO)

FOO(lala)

FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt 
             "${var} \"${${var}}\"\n")
ENDFOREACH(var ${res})

FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "")
GET_CMAKE_PROPERTY(res COMMANDS)
FOREACH(var ${res})
  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt 
             "${var}\n")
ENDFOREACH(var ${res})

FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
GET_CMAKE_PROPERTY(res MACROS)
FOREACH(var ${res})
  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt 
             "${var}\n")
ENDFOREACH(var ${res})

FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "")
GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES)
FOREACH(var ${res})
  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
    "INCLUDE_DIRECTORY: ${var}\n")
ENDFOREACH(var)

GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES)
FOREACH(var ${res})
  FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
    "LINK_DIRECTORIES: ${var}\n")
ENDFOREACH(var)

GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION)
FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
  "INCLUDE_REGULAR_EXPRESSION: ${res}\n")