CMakeLists.txt 1.2 KB

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