From: Viktor Szakats Date: Tue, 17 Jun 2025 19:08:02 +0000 (+0200) Subject: cmake: move `OUTPUT` argument in the `add_custom_command()` line X-Git-Tag: curl-8_15_0~241 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb01ac3fc8e1b1c8d8e1195d76da124bd6eff8d1;p=thirdparty%2Fcurl.git cmake: move `OUTPUT` argument in the `add_custom_command()` line For greppability. Closes #17658 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d095b9429..fd2fd93b6a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -30,8 +30,7 @@ set(_curl_definitions "") if(ENABLE_CURL_MANUAL AND HAVE_MANUAL_TOOLS) list(APPEND _curl_definitions "USE_MANUAL") - add_custom_command( - OUTPUT "tool_hugehelp.c" + add_custom_command(OUTPUT "tool_hugehelp.c" COMMAND ${CMAKE_COMMAND} -E echo "#include \"tool_setup.h\"" > "tool_hugehelp.c" COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable COPYRIGHT all */" >> "tool_hugehelp.c" COMMAND ${CMAKE_COMMAND} -E echo "/* !checksrc! disable INCLUDEDUP all */" >> "tool_hugehelp.c" @@ -54,8 +53,7 @@ endif() if(CURL_CA_EMBED_SET) if(PERL_FOUND) list(APPEND _curl_definitions "CURL_CA_EMBED") - add_custom_command( - OUTPUT "tool_ca_embed.c" + add_custom_command(OUTPUT "tool_ca_embed.c" COMMAND "${PERL_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/mk-file-embed.pl" --var curl_ca_embed < "${CURL_CA_EMBED}" > "tool_ca_embed.c" DEPENDS diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt index 2f81adffbf..2521a28970 100644 --- a/tests/client/CMakeLists.txt +++ b/tests/client/CMakeLists.txt @@ -31,8 +31,7 @@ if(LIB_SELECTED STREQUAL LIB_SHARED) list(APPEND _bundle_extra ${CURLX_SRCS}) # Not exported from the libcurl shared build. Build a copy. endif() -add_custom_command( - OUTPUT "${BUNDLE_SRC}" +add_custom_command(OUTPUT "${BUNDLE_SRC}" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" --include ${_bundle_extra} --test ${TESTFILES} ${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}" diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index 3a18caefb6..dd1df40dc5 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -31,16 +31,14 @@ if(LIB_SELECTED STREQUAL LIB_SHARED) list(APPEND _bundle_extra ${CURLX_SRCS}) # Not exported from the libcurl shared build. Build a copy. endif() -add_custom_command( - OUTPUT "lib1521.c" +add_custom_command(OUTPUT "lib1521.c" COMMAND ${PERL_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" < "${PROJECT_SOURCE_DIR}/include/curl/curl.h" "lib1521.c" DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/mk-lib1521.pl" "${PROJECT_SOURCE_DIR}/include/curl/curl.h" VERBATIM) -add_custom_command( - OUTPUT "${BUNDLE_SRC}" +add_custom_command(OUTPUT "${BUNDLE_SRC}" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" --include ${UTILS} ${_bundle_extra} --test ${TESTFILES} "lib1521.c" ${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}" diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index 2a73c5b73e..ff578f38bd 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -26,8 +26,7 @@ curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -add_custom_command( - OUTPUT "${BUNDLE_SRC}" +add_custom_command(OUTPUT "${BUNDLE_SRC}" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" --include ${UTILS} ${CURLX_SRCS} --test ${TESTFILES} ${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}" diff --git a/tests/tunit/CMakeLists.txt b/tests/tunit/CMakeLists.txt index afde8d0a4f..b58022d7e9 100644 --- a/tests/tunit/CMakeLists.txt +++ b/tests/tunit/CMakeLists.txt @@ -26,8 +26,7 @@ curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -add_custom_command( - OUTPUT "${BUNDLE_SRC}" +add_custom_command(OUTPUT "${BUNDLE_SRC}" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" --test ${TESTFILES} ${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}" DEPENDS diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 1c7f86fabe..be1893d002 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -26,8 +26,7 @@ curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake") -add_custom_command( - OUTPUT "${BUNDLE_SRC}" +add_custom_command(OUTPUT "${BUNDLE_SRC}" COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" --test ${TESTFILES} ${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}" DEPENDS