2008-03-25 18:27:18 +03:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2012-08-13 21:47:32 +04:00
|
|
|
project(SUBDIR)
|
|
|
|
subdirs(Executable EXCLUDE_FROM_ALL Examples)
|
|
|
|
write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.")
|
2006-01-17 18:21:45 +03:00
|
|
|
#WATCOM WMAKE does not support + in the name of a file!
|
2012-08-13 21:47:32 +04:00
|
|
|
if(WATCOM)
|
|
|
|
set(PLUS_NAME_FILES
|
2006-01-17 18:21:45 +03:00
|
|
|
AnotherSubdir/pair_int.int.c
|
|
|
|
vcl_algorithm_vcl_pair_double.foo.c)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(PLUS_NAME_FILES
|
2006-01-17 18:21:45 +03:00
|
|
|
AnotherSubdir/pair+int.int.c
|
|
|
|
vcl_algorithm+vcl_pair+double.foo.c)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2004-04-27 01:32:56 +04:00
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
add_executable(TestFromSubdir
|
2004-04-27 17:22:57 +04:00
|
|
|
AnotherSubdir/testfromsubdir.c
|
|
|
|
AnotherSubdir/secondone
|
2006-01-17 18:21:45 +03:00
|
|
|
${PLUS_NAME_FILES}
|
2004-04-27 17:22:57 +04:00
|
|
|
)
|
|
|
|
|
2012-08-13 21:47:32 +04:00
|
|
|
aux_source_directory(ThirdSubDir SOURCES)
|
|
|
|
if(WATCOM)
|
|
|
|
foreach(f ${SOURCES})
|
|
|
|
if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(SOURCES2 ${f} ${SOURCES2})
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(SOURCES ${SOURCES2})
|
|
|
|
set(SOURCES ${SOURCES}
|
2006-01-17 18:21:45 +03:00
|
|
|
vcl_algorithm_vcl_pair_double.foo.c)
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
foreach(f ${SOURCES})
|
|
|
|
if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
|
2012-08-13 21:50:14 +04:00
|
|
|
else()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(SOURCES2 ${f} ${SOURCES2})
|
|
|
|
message("${f}")
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2012-08-13 21:47:32 +04:00
|
|
|
set(SOURCES ${SOURCES2})
|
|
|
|
set(SOURCES ${SOURCES}
|
2006-01-17 18:21:45 +03:00
|
|
|
vcl_algorithm+vcl_pair+double.foo.c)
|
2012-08-13 21:50:14 +04:00
|
|
|
endif()
|
2012-08-13 21:47:32 +04:00
|
|
|
message("Sources: ${SOURCES}")
|
|
|
|
add_executable(TestWithAuxSourceDir ${SOURCES})
|