diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a5bc926..835f4e1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,10 @@ endif() add_custom_target(style) add_custom_command( - TARGET style COMMAND find ${CMAKE_CURRENT_LIST_DIR}/benchmark ${CMAKE_CURRENT_LIST_DIR}/example ${CMAKE_CURRENT_LIST_DIR}/include - ${CMAKE_CURRENT_LIST_DIR}/test -iname "*.hpp" -or -iname "*.cpp" | xargs clang-format -i + TARGET style + POST_BUILD + COMMAND find ${CMAKE_CURRENT_LIST_DIR}/benchmark ${CMAKE_CURRENT_LIST_DIR}/example ${CMAKE_CURRENT_LIST_DIR}/include + ${CMAKE_CURRENT_LIST_DIR}/test -iname "*.hpp" -or -iname "*.cpp" | xargs clang-format -i ) if(BOOST_UT_ENABLE_COVERAGE) diff --git a/cmake/AddCustomCommandOrTest.cmake b/cmake/AddCustomCommandOrTest.cmake index 467b7a85..7eba75c2 100644 --- a/cmake/AddCustomCommandOrTest.cmake +++ b/cmake/AddCustomCommandOrTest.cmake @@ -13,7 +13,11 @@ function(ut_add_custom_command_or_test) target_link_libraries(${PARSE_TARGET} PRIVATE Boost::ut) if(BOOST_UT_ENABLE_RUN_AFTER_BUILD) - add_custom_command(TARGET ${PARSE_TARGET} COMMAND ${PARSE_COMMAND}) + add_custom_command( + TARGET ${PARSE_TARGET} + POST_BUILD + COMMAND ${PARSE_COMMAND} + ) else() add_test(NAME ${PARSE_TARGET} COMMAND ${PARSE_COMMAND}) endif()