From 30192258ccd73c861b0933a546a855c3f3c495b6 Mon Sep 17 00:00:00 2001 From: tqfx Date: Mon, 4 Mar 2024 21:39:44 +0800 Subject: [PATCH] rename target name a$tool to afmt.$lang --- CMakeLists.txt | 19 +++++++++++-------- lua/CMakeLists.txt | 12 ++++++------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59441bb..de34cca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -540,18 +540,21 @@ include(CPack) if(PROJECT_IS_TOP_LEVEL) find_package(ClangFormat) - find_package(Black) endif() if(CLANG_FORMAT_FOUND) file_scaner(SOURCES RECURSE include src test java/src javascript/src lua/src quickjs/src EXT c h cc hh cpp hpp) - add_clang_format(aformat VERBOSE ${SOURCES}) - add_dependencies(afmt aformat) + add_clang_format(afmt.c VERBOSE ${SOURCES}) + add_dependencies(afmt afmt.c) +endif() + +if(PROJECT_IS_TOP_LEVEL AND LIBA_PYTHON) + find_package(Black) endif() -if(BLACK_FOUND) - add_black(ablack ${CMAKE_CURRENT_LIST_DIR}) - add_dependencies(afmt ablack) +if(PYTHON_FOUND AND BLACK_FOUND) + add_black(afmt.py ${CMAKE_CURRENT_LIST_DIR}) + add_dependencies(afmt afmt.py) endif() if(PYTHON_FOUND AND CYTHON_FOUND) @@ -636,10 +639,10 @@ if(NOT CMAKE_VERSION VERSION_LESS 3.9 AND DOXYGEN_FOUND) endif() # https://www.doxygen.nl/manual/config.html - doxygen_add_docs(adoxygen WORKING_DIRECTORY + doxygen_add_docs(adoc.c WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/a ${CMAKE_CURRENT_LIST_DIR}/include/a ${CMAKE_CURRENT_LIST_DIR}/README.md ) - add_dependencies(adoc adoxygen) + add_dependencies(adoc adoc.c) endif() diff --git a/lua/CMakeLists.txt b/lua/CMakeLists.txt index 8b5a378..74caedb 100644 --- a/lua/CMakeLists.txt +++ b/lua/CMakeLists.txt @@ -58,16 +58,16 @@ if(PROJECT_IS_TOP_LEVEL) find_package(StyLua) if(STYLUA_FOUND) - add_stylua(astylua VERBOSE ${ARGN}) - add_dependencies(afmt astylua) + add_stylua(afmt.lua VERBOSE ${ARGN}) + add_dependencies(afmt afmt.lua) return() endif() find_package(LuaFormat) if(LUA_FORMAT_FOUND) - add_lua_format(aluaformat VERBOSE ${ARGN}) - add_dependencies(afmt aluaformat) + add_lua_format(afmt.lua VERBOSE ${ARGN}) + add_dependencies(afmt afmt.lua) return() endif() endfunction() @@ -87,10 +87,10 @@ if(LIBA_LDOC AND LDOC_FOUND) description = '${PROJECT_DESCRIPTION}' format = 'markdown' ") - create_ldoc(aldoc CONFIG ${CMAKE_CURRENT_BINARY_DIR}/LDoc + create_ldoc(adoc.lua CONFIG ${CMAKE_CURRENT_BINARY_DIR}/LDoc OPTIONS --not_luadoc ${CMAKE_CURRENT_SOURCE_DIR}/src ) - add_dependencies(adoc aldoc) + add_dependencies(adoc adoc.lua) endif() if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/test/CMakeLists.txt AND LUA_EXECUTABLE) -- 2.11.4.GIT