diff options
author | Brad King <brad.king@kitware.com> | 2020-05-11 14:16:29 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-05-11 14:16:37 (GMT) |
commit | 50f6207c52580caf2c47b3c6a32fde357922c1f3 (patch) | |
tree | bf83519093c987b38bd3e3a0e5e2e7117f13d4d7 /Tests | |
parent | d4b1d3d4f01fe067c163791f2f88ac6dad1d323d (diff) | |
parent | 5ec969080240324f493c8ea55968660a06438aee (diff) | |
download | CMake-50f6207c52580caf2c47b3c6a32fde357922c1f3.zip CMake-50f6207c52580caf2c47b3c6a32fde357922c1f3.tar.gz CMake-50f6207c52580caf2c47b3c6a32fde357922c1f3.tar.bz2 |
Merge topic 'doxygen-generated-sources'
5ec9690802 FindDoxygen: Allow generated files with USE_STAMP_FILE
683abe4366 FindDoxygen: Formatting-only indentation cleanup for test case
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4726
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/FindDoxygen/StampFile/CMakeLists.txt | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/Tests/FindDoxygen/StampFile/CMakeLists.txt b/Tests/FindDoxygen/StampFile/CMakeLists.txt index 2d06540..ed2bfbb 100644 --- a/Tests/FindDoxygen/StampFile/CMakeLists.txt +++ b/Tests/FindDoxygen/StampFile/CMakeLists.txt @@ -3,22 +3,41 @@ project(TestFindDoxygen VERSION 1.0 LANGUAGES NONE) find_package(Doxygen REQUIRED) +set(DOXYGEN_OUTPUT_DIRECTORY noFiles) doxygen_add_docs(docsWithoutFilesWithStamp USE_STAMP_FILE) if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsWithoutFilesWithStamp") - message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithoutFilesWithStamp") + message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithoutFilesWithStamp") endif() if(NOT TARGET docsWithoutFilesWithStamp) - message(FATAL_ERROR "Target docsWithoutFilesWithStamp not created") + message(FATAL_ERROR "Target docsWithoutFilesWithStamp not created") endif() +set(DOXYGEN_OUTPUT_DIRECTORY withFiles) doxygen_add_docs(docsWithFilesWithStamp main.cpp main2.cpp USE_STAMP_FILE) if(NOT EXISTS "${PROJECT_BINARY_DIR}/Doxyfile.docsWithFilesWithStamp") - message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithFilesWithStamp") + message(FATAL_ERROR "Missing generated file: Doxyfile.docsWithFilesWithStamp") endif() if(NOT TARGET docsWithFilesWithStamp) - message(FATAL_ERROR "Target docsWithFilesWithStamp not created") + message(FATAL_ERROR "Target docsWithFilesWithStamp not created") endif() +# Confirm that doxygen_add_docs() doesn't cause a fatal error if given a +# source file that is generated at build time +file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/genDox.cpp) +add_custom_command(OUTPUT genDox.cpp + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main2.cpp genDox.cpp + DEPENDS main2.cpp +) +set(DOXYGEN_OUTPUT_DIRECTORY withGenFiles) +doxygen_add_docs(docsWithGenFilesWithStamp + main.cpp + ${CMAKE_CURRENT_BINARY_DIR}/genDox.cpp + USE_STAMP_FILE +) add_custom_target(allDocTargets) -add_dependencies(allDocTargets docsWithoutFilesWithStamp docsWithFilesWithStamp) +add_dependencies(allDocTargets + docsWithoutFilesWithStamp + docsWithFilesWithStamp + docsWithGenFilesWithStamp +) |