2009-03-19 04:06:06 +08:00
|
|
|
FILE(GLOB examples_SRCS "*.cpp")
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(unsupported_examples)
|
|
|
|
|
|
|
|
FOREACH(example_src ${examples_SRCS})
|
|
|
|
GET_FILENAME_COMPONENT(example ${example_src} NAME_WE)
|
2009-12-03 01:07:47 +08:00
|
|
|
ADD_EXECUTABLE(example_${example} ${example_src})
|
2009-03-19 04:06:06 +08:00
|
|
|
GET_TARGET_PROPERTY(example_executable
|
2009-12-08 03:10:11 +08:00
|
|
|
example_${example} LOCATION)
|
2009-03-19 04:06:06 +08:00
|
|
|
ADD_CUSTOM_COMMAND(
|
2009-12-03 01:07:47 +08:00
|
|
|
TARGET example_${example}
|
2009-03-19 04:06:06 +08:00
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${example_executable}
|
|
|
|
ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
|
|
|
|
)
|
2009-12-03 01:07:47 +08:00
|
|
|
ADD_DEPENDENCIES(unsupported_examples example_${example})
|
2009-03-19 04:06:06 +08:00
|
|
|
ENDFOREACH(example_src)
|