CMakeLists.txt 1.4 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(WATCOM)
  11. SET(PLUS_NAME_FILES
  12. AnotherSubdir/pair+int.int.c
  13. vcl_algorithm+vcl_pair+double.foo.c)
  14. ENDIF(WATCOM)
  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("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
  25. SET(SOURCES2 ${f} ${SOURCES2})
  26. ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
  27. ENDFOREACH(f)
  28. SET(SOURCES ${SOURCES2})
  29. SET(SOURCES ${SOURCES}
  30. vcl_algorithm_vcl_pair_double.foo.c)
  31. ELSE(WATCOM)
  32. FOREACH(f ${SOURCES})
  33. IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
  34. ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
  35. SET(SOURCES2 ${f} ${SOURCES2})
  36. MESSAGE("${f}")
  37. ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
  38. ENDFOREACH(f)
  39. SET(SOURCES ${SOURCES2})
  40. SET(SOURCES ${SOURCES}
  41. vcl_algorithm+vcl_pair+double.foo.c)
  42. ENDIF(WATCOM)
  43. MESSAGE("Sources: ${SOURCES}")
  44. ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})