CMakeLists.txt 2.1 KB

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