2007-12-21 18:35:00 +08:00
|
|
|
FILE(GLOB examples_SRCS "*.cpp")
|
|
|
|
|
2007-12-21 19:29:04 +08:00
|
|
|
ADD_CUSTOM_TARGET(all_examples)
|
|
|
|
|
2007-12-21 18:35:00 +08:00
|
|
|
FOREACH(example_src ${examples_SRCS})
|
|
|
|
GET_FILENAME_COMPONENT(example ${example_src} NAME_WE)
|
|
|
|
ADD_EXECUTABLE(${example} ${example_src})
|
|
|
|
GET_TARGET_PROPERTY(example_executable
|
|
|
|
${example} LOCATION)
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
TARGET ${example}
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${example_executable}
|
|
|
|
ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
|
|
|
|
)
|
2007-12-21 19:29:04 +08:00
|
|
|
ADD_DEPENDENCIES(all_examples ${example})
|
2007-12-21 18:35:00 +08:00
|
|
|
ENDFOREACH(example_src)
|