CMakeLists.txt 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. PROJECT(SUBDIR)
  2. # Some systems do not seem to support rpath with spaces.
  3. IF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
  4. SET(CMAKE_SKIP_BUILD_RPATH 1)
  5. ENDIF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX")
  6. # be able to see output from make on dashboards
  7. SET(CMAKE_VERBOSE_MAKEFILE 1)
  8. message("${CMAKE_MAKE_PROGRAM}")
  9. set(CMAKE_PAREN TRUE)
  10. IF("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake")
  11. message("wmake does not support () in path")
  12. set(CMAKE_PAREN FALSE)
  13. ENDIF("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake")
  14. IF(CMAKE_PAREN)
  15. ADD_DEFINITIONS(-DCMAKE_PAREN=1)
  16. SUBDIRS("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples")
  17. ELSE(CMAKE_PAREN)
  18. SUBDIRS("Executable Sources" EXCLUDE_FROM_ALL "Some Examples")
  19. ENDIF(CMAKE_PAREN)
  20. WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
  21. #WATCOM WMAKE does not support + in the name of a file!
  22. IF(WATCOM)
  23. SET(PLUS_NAME_FILES
  24. "Another Subdir/pair_int.int.c"
  25. vcl_algorithm_vcl_pair_double.foo.c)
  26. ELSE(WATCOM)
  27. SET(PLUS_NAME_FILES
  28. "Another Subdir/pair+int.int.c"
  29. vcl_algorithm+vcl_pair+double.foo.c)
  30. ENDIF(WATCOM)
  31. ADD_EXECUTABLE(TestFromSubdir
  32. "Another Subdir/testfromsubdir.c"
  33. "Another Subdir/secondone"
  34. ${PLUS_NAME_FILES}
  35. )
  36. AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES)
  37. IF(WATCOM)
  38. FOREACH(f ${SOURCES})
  39. IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
  40. ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
  41. SET(SOURCES2 ${f} ${SOURCES2})
  42. ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
  43. ENDFOREACH(f)
  44. SET(SOURCES ${SOURCES2})
  45. SET(SOURCES ${SOURCES}
  46. vcl_algorithm_vcl_pair_double.foo.c)
  47. ELSE(WATCOM)
  48. FOREACH(f ${SOURCES})
  49. IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
  50. ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
  51. SET(SOURCES2 ${f} ${SOURCES2})
  52. ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
  53. ENDFOREACH(f)
  54. SET(SOURCES ${SOURCES2})
  55. SET(SOURCES ${SOURCES}
  56. vcl_algorithm+vcl_pair+double.foo.c)
  57. ENDIF(WATCOM)
  58. ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
  59. IF(CMAKE_PAREN)
  60. target_link_libraries(TestWithAuxSourceDir testOddPath)
  61. ENDIF(CMAKE_PAREN)