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