Compare commits

...

2 Commits

3 changed files with 17 additions and 1 deletions

View File

@ -79,6 +79,11 @@ function(myx_cmake_doc_breathe)
endif()
endif()
if(NOT TARGET myx-cmake-doc-breathe)
add_custom_target(myx-cmake-doc-breathe)
endif()
add_dependencies(myx-cmake-doc-breathe ${_target})
install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/breathe/html
COMPONENT doc OPTIONAL
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/breathe)

View File

@ -49,6 +49,10 @@ function(myx_cmake_doc_doxygen)
COMPONENT doc OPTIONAL
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/doxygen)
endif()
if(NOT TARGET myx-cmake-doc-doxygen)
add_custom_target(myx-cmake-doc-doxygen)
endif()
add_dependencies(myx-cmake-doc-doxygen ${_target})
else()
message(STATUS "MyxCMake: target ${_target} is already defined.")
endif()

View File

@ -18,15 +18,22 @@ function(myx_cmake_format_sources target)
endif()
if(EXISTS ${CMAKE_SOURCE_DIR}/.uncrustify.cfg)
list(APPEND UNCRUSTIFY_OPTS -c ${CMAKE_SOURCE_DIR}/.uncrustify.cfg)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/uncrustify.cfg
COMMAND ${UNCRUSTIFY_EXE} --update-config-with-doc
-c ${CMAKE_SOURCE_DIR}/.uncrustify.cfg
-o ${CMAKE_BINARY_DIR}/uncrustify.cfg)
list(APPEND UNCRUSTIFY_OPTS -L ERR -c ${CMAKE_BINARY_DIR}/uncrustify.cfg)
endif()
# cmake-format: off
add_custom_target(${target}-check-format-sources-uncrustify
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --check ${__sources})
list(APPEND UNCRUSTIFY_OPTS --replace --no-backup)
add_custom_target(${target}-format-sources-uncrustify
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --mtime ${__sources})
add_custom_target(${target}-add-doxygen-comments-uncrustify
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
--set cmt_insert_file_header=fileheader.txt
--set cmt_insert_file_footer=filefooter.txt