summaryrefslogtreecommitdiffstats
path: root/Tests/SystemInformation/CMakeLists.txt
blob: c29f3e86320183c9fc7651d99501021398087ffe (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")