CMakeLists.txt 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. cmake_minimum_required (VERSION 3.0)
  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()
  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()
  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()
  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()
  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()
  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()
  45. get_directory_property(res INCLUDE_REGULAR_EXPRESSION)
  46. file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt
  47. "INCLUDE_REGULAR_EXPRESSION: ${res}\n")