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()
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 install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/breathe/html
COMPONENT doc OPTIONAL COMPONENT doc OPTIONAL
DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/breathe) DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/breathe)

View File

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

View File

@ -18,15 +18,22 @@ function(myx_cmake_format_sources target)
endif() endif()
if(EXISTS ${CMAKE_SOURCE_DIR}/.uncrustify.cfg) 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() endif()
# cmake-format: off # cmake-format: off
add_custom_target(${target}-check-format-sources-uncrustify add_custom_target(${target}-check-format-sources-uncrustify
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --check ${__sources}) COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --check ${__sources})
list(APPEND UNCRUSTIFY_OPTS --replace --no-backup) list(APPEND UNCRUSTIFY_OPTS --replace --no-backup)
add_custom_target(${target}-format-sources-uncrustify add_custom_target(${target}-format-sources-uncrustify
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --mtime ${__sources}) COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} --mtime ${__sources})
add_custom_target(${target}-add-doxygen-comments-uncrustify add_custom_target(${target}-add-doxygen-comments-uncrustify
DEPENDS ${CMAKE_BINARY_DIR}/uncrustify.cfg
COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS} COMMAND ${UNCRUSTIFY_EXE} ${UNCRUSTIFY_OPTS}
--set cmt_insert_file_header=fileheader.txt --set cmt_insert_file_header=fileheader.txt
--set cmt_insert_file_footer=filefooter.txt --set cmt_insert_file_footer=filefooter.txt