CMakeLists.txt 1.24 KB
Newer Older
Ken Martin's avatar
Ken Martin committed
1
cmake_minimum_required (VERSION 2.6)
2
project(SUBDIR)
3

4
subdirs(Executable EXCLUDE_FROM_ALL Examples)
5
6
7

set(DEFINED_AFTER_SUBDIRS_COMMAND 42)

8
write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
9
#WATCOM WMAKE does not support + in the name of a file!
10
11
if(WATCOM)
  set(PLUS_NAME_FILES
12
13
    AnotherSubdir/pair_int.int.c
    vcl_algorithm_vcl_pair_double.foo.c)
14
else()
15
    set(PLUS_NAME_FILES
16
17
    AnotherSubdir/pair+int.int.c
    vcl_algorithm+vcl_pair+double.foo.c)
18
endif()
19

20
add_executable(TestFromSubdir
21
22
  AnotherSubdir/testfromsubdir.c
  AnotherSubdir/secondone
23
  ${PLUS_NAME_FILES}
24
25
  )

26
27
28
29
aux_source_directory(ThirdSubDir SOURCES)
if(WATCOM)
  foreach(f ${SOURCES})
    if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
30
    else()
31
      set(SOURCES2 ${f} ${SOURCES2})
32
33
    endif()
  endforeach()
34
35
  set(SOURCES ${SOURCES2})
  set(SOURCES ${SOURCES}
36
    vcl_algorithm_vcl_pair_double.foo.c)
37
else()
38
39
  foreach(f ${SOURCES})
    if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
40
    else()
41
42
      set(SOURCES2 ${f} ${SOURCES2})
      message("${f}")
43
44
    endif()
  endforeach()
45
46
  set(SOURCES ${SOURCES2})
  set(SOURCES ${SOURCES}
47
    vcl_algorithm+vcl_pair+double.foo.c)
48
endif()
49
50
message("Sources: ${SOURCES}")
add_executable(TestWithAuxSourceDir ${SOURCES})