2008-03-25 18:27:18 +03:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
2004-03-10 00:20:41 +03: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!
|
|
|
|
IF(WATCOM)
|
|
|
|
SET(PLUS_NAME_FILES
|
|
|
|
AnotherSubdir/pair_int.int.c
|
|
|
|
vcl_algorithm_vcl_pair_double.foo.c)
|
|
|
|
ELSE(WATCOM)
|
|
|
|
SET(PLUS_NAME_FILES
|
|
|
|
AnotherSubdir/pair+int.int.c
|
|
|
|
vcl_algorithm+vcl_pair+double.foo.c)
|
|
|
|
ENDIF(WATCOM)
|
2004-04-27 01:32:56 +04:00
|
|
|
|
2004-04-27 17:22:57 +04:00
|
|
|
ADD_EXECUTABLE(TestFromSubdir
|
|
|
|
AnotherSubdir/testfromsubdir.c
|
|
|
|
AnotherSubdir/secondone
|
2006-01-17 18:21:45 +03:00
|
|
|
${PLUS_NAME_FILES}
|
2004-04-27 17:22:57 +04:00
|
|
|
)
|
|
|
|
|
|
|
|
AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES)
|
2006-01-17 18:21:45 +03:00
|
|
|
IF(WATCOM)
|
|
|
|
FOREACH(f ${SOURCES})
|
|
|
|
IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
|
|
|
|
ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
|
|
|
|
SET(SOURCES2 ${f} ${SOURCES2})
|
|
|
|
ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c")
|
|
|
|
ENDFOREACH(f)
|
|
|
|
SET(SOURCES ${SOURCES2})
|
|
|
|
SET(SOURCES ${SOURCES}
|
|
|
|
vcl_algorithm_vcl_pair_double.foo.c)
|
|
|
|
ELSE(WATCOM)
|
|
|
|
FOREACH(f ${SOURCES})
|
|
|
|
IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
|
|
|
|
ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
|
|
|
|
SET(SOURCES2 ${f} ${SOURCES2})
|
|
|
|
MESSAGE("${f}")
|
|
|
|
ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c")
|
|
|
|
ENDFOREACH(f)
|
|
|
|
SET(SOURCES ${SOURCES2})
|
|
|
|
SET(SOURCES ${SOURCES}
|
|
|
|
vcl_algorithm+vcl_pair+double.foo.c)
|
|
|
|
ENDIF(WATCOM)
|
2004-04-27 17:22:57 +04:00
|
|
|
MESSAGE("Sources: ${SOURCES}")
|
|
|
|
ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES})
|