| 1 |
cmake_minimum_required(VERSION 3.14) |
| 2 |
project(ExplicitDirs NONE) |
| 3 |
|
| 4 |
message(STATUS "CMAKE_SOURCE_DIR='${CMAKE_SOURCE_DIR}'") |
| 5 |
message(STATUS "CMAKE_BINARY_DIR='${CMAKE_BINARY_DIR}'") |
| 6 |
|
| 7 |
add_custom_command( |
| 8 |
OUTPUT output1.txt |
| 9 |
COMMAND ${CMAKE_COMMAND} -E echo CustomCommand > output1.txt |
| 10 |
) |
| 11 |
add_custom_target(CustomTarget ALL DEPENDS output1.txt) |
| 12 |
|
| 13 |
add_custom_command( |
| 14 |
OUTPUT output2.txt |
| 15 |
COMMAND ${CMAKE_COMMAND} -E echo CustomCommand2 > output2.txt |
| 16 |
) |
| 17 |
add_custom_target(CustomTarget2 ALL DEPENDS output2.txt) |
| 18 |
|
| 19 |
add_custom_command( |
| 20 |
OUTPUT output3.txt |
| 21 |
COMMAND ${CMAKE_COMMAND} -E echo CustomCommand2 > output3.txt |
| 22 |
) |
| 23 |
add_custom_target(CustomTarget3 ALL DEPENDS output3.txt) |