CMakeLists.txt 978 B

1234567891011121314151617181920212223242526272829303132333435
  1. cmake_minimum_required (VERSION 2.6)
  2. project(SourceGroups)
  3. # this is not really a test which can fail
  4. # it is more an example with several source_group()
  5. # commands.
  6. # The created projects have to be loaded manually
  7. # in Visual Studio/Xcode/Eclipse/...
  8. # to see whether the correct groups have been created.
  9. source_group(Base FILES main.c)
  10. # a sub group
  11. source_group(Base\\Sub1 FILES sub1/foo.c)
  12. # a sub sub group
  13. source_group(Base\\Sub1\\Sub2 FILES sub1/foobar.c)
  14. # a group with empty name
  15. source_group("" FILES foo.c)
  16. # a group, whose name consists only of the delimiter
  17. #should be handled the same way as an empty name
  18. source_group("\\" FILES baz.c)
  19. # a sub sub group whose last component has the same name
  20. # as an already existing group
  21. source_group(Base\\Sub1\\Base FILES bar.c)
  22. # a group without files, is currently not created
  23. source_group(EmptyGroup)
  24. add_executable(SourceGroups main.c bar.c foo.c sub1/foo.c sub1/foobar.c baz.c README.txt)