CMakeLists.txt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. cmake_minimum_required (VERSION 2.6)
  2. PROJECT(SystemInformation)
  3. INCLUDE_DIRECTORIES("This does not exists")
  4. GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES)
  5. SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}")
  6. MESSAGE("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT")
  7. CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/SystemInformation.in
  8. ${SystemInformation_BINARY_DIR}/SystemInformation.out)
  9. CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in
  10. ${SystemInformation_BINARY_DIR}/DumpInformation.h)
  11. ADD_EXECUTABLE(SystemInformation DumpInformation.cxx)
  12. MACRO(FOO args)
  13. MESSAGE("Test macro")
  14. ENDMACRO(FOO)
  15. FOO(lala)
  16. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "")
  17. GET_CMAKE_PROPERTY(res VARIABLES)
  18. FOREACH(var ${res})
  19. FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt
  20. "${var} \"${${var}}\"\n")
  21. ENDFOREACH(var ${res})
  22. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "")
  23. GET_CMAKE_PROPERTY(res COMMANDS)
  24. FOREACH(var ${res})
  25. FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt
  26. "${var}\n")
  27. ENDFOREACH(var ${res})
  28. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "")
  29. GET_CMAKE_PROPERTY(res MACROS)
  30. FOREACH(var ${res})
  31. FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt
  32. "${var}\n")
  33. ENDFOREACH(var ${res})
  34. FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "")
  35. GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES)
  36. FOREACH(var ${res})
  37. FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
  38. "INCLUDE_DIRECTORY: ${var}\n")
  39. ENDFOREACH(var)
  40. GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES)
  41. FOREACH(var ${res})
  42. FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
  43. "LINK_DIRECTORIES: ${var}\n")
  44. ENDFOREACH(var)
  45. GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION)
  46. FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
  47. "INCLUDE_REGULAR_EXPRESSION: ${res}\n")