CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. cmake_minimum_required (VERSION 2.6)
  2. project(SUBDIR)
  3. subdirs(Executable EXCLUDE_FROM_ALL Examples)
  4. set(DEFINED_AFTER_SUBDIRS_COMMAND 42)
  5. write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
  6. #WATCOM WMAKE does not support + in the name of a file!
  7. if(WATCOM)
  8. set(PLUS_NAME_FILES
  9. AnotherSubdir/pair_int.int.c
  10. vcl_algorithm_vcl_pair_double.foo.c)
  11. else()
  12. set(PLUS_NAME_FILES
  13. AnotherSubdir/pair+int.int.c
  14. vcl_algorithm+vcl_pair+double.foo.c)
  15. endif()
  16. add_executable(TestFromSubdir
  17. AnotherSubdir/testfromsubdir.c
  18. AnotherSubdir/secondone
  19. ${PLUS_NAME_FILES}
  20. )
  21. aux_source_directory(ThirdSubDir SOURCES)
  22. if(WATCOM)
  23. foreach(f ${SOURCES})
  24. if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
  25. else()
  26. set(SOURCES2 ${f} ${SOURCES2})
  27. endif()
  28. endforeach()
  29. set(SOURCES ${SOURCES2})
  30. set(SOURCES ${SOURCES}
  31. vcl_algorithm_vcl_pair_double.foo.c)
  32. else()
  33. foreach(f ${SOURCES})
  34. if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
  35. else()
  36. set(SOURCES2 ${f} ${SOURCES2})
  37. message("${f}")
  38. endif()
  39. endforeach()
  40. set(SOURCES ${SOURCES2})
  41. set(SOURCES ${SOURCES}
  42. vcl_algorithm+vcl_pair+double.foo.c)
  43. endif()
  44. message("Sources: ${SOURCES}")
  45. add_executable(TestWithAuxSourceDir ${SOURCES})