From 8e0bf6114173c97ed53066632f44d64cc31246ef Mon Sep 17 00:00:00 2001 From: Curve Date: Sun, 10 Nov 2024 12:21:25 +0100 Subject: [PATCH 1/3] fix(cmake): CMP0175 --- CMakeLists.txt | 2 +- cmake/AddCustomCommandOrTest.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a5bc926..57508f4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ if(BOOST_UT_USE_WARNINGS_AS_ERORS) endif() add_custom_target(style) -add_custom_command( +add_custom_command(POST_BUILD 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 ) diff --git a/cmake/AddCustomCommandOrTest.cmake b/cmake/AddCustomCommandOrTest.cmake index 467b7a85..d0b7d79e 100644 --- a/cmake/AddCustomCommandOrTest.cmake +++ b/cmake/AddCustomCommandOrTest.cmake @@ -13,7 +13,7 @@ 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(POST_BUILD TARGET ${PARSE_TARGET} COMMAND ${PARSE_COMMAND}) else() add_test(NAME ${PARSE_TARGET} COMMAND ${PARSE_COMMAND}) endif() From 7fb84d5dfb786802d71871fa89dd8fd29337c9ad Mon Sep 17 00:00:00 2001 From: Curve Date: Sun, 10 Nov 2024 12:25:16 +0100 Subject: [PATCH 2/3] fix(cmake): use default order --- CMakeLists.txt | 4 ++-- cmake/AddCustomCommandOrTest.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57508f4e..59ce584e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,8 +43,8 @@ if(BOOST_UT_USE_WARNINGS_AS_ERORS) endif() add_custom_target(style) -add_custom_command(POST_BUILD - TARGET style COMMAND find ${CMAKE_CURRENT_LIST_DIR}/benchmark ${CMAKE_CURRENT_LIST_DIR}/example ${CMAKE_CURRENT_LIST_DIR}/include +add_custom_command( + 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 ) diff --git a/cmake/AddCustomCommandOrTest.cmake b/cmake/AddCustomCommandOrTest.cmake index d0b7d79e..16bb27fb 100644 --- a/cmake/AddCustomCommandOrTest.cmake +++ b/cmake/AddCustomCommandOrTest.cmake @@ -13,7 +13,7 @@ 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(POST_BUILD 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() From 5dec46c2ac6eea9bb86e9099d088817449ebf4ac Mon Sep 17 00:00:00 2001 From: Curve Date: Sun, 10 Nov 2024 12:25:58 +0100 Subject: [PATCH 3/3] refactor(cmake): run cmake-format --- CMakeLists.txt | 6 ++++-- cmake/AddCustomCommandOrTest.cmake | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 59ce584e..835f4e1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,10 @@ endif() add_custom_target(style) add_custom_command( - 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 + 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 16bb27fb..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} POST_BUILD COMMAND ${PARSE_COMMAND}) + add_custom_command( + TARGET ${PARSE_TARGET} + POST_BUILD + COMMAND ${PARSE_COMMAND} + ) else() add_test(NAME ${PARSE_TARGET} COMMAND ${PARSE_COMMAND}) endif()