From f78e251adf760a89576643fee6c72bb3e19c390e Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Mon, 5 Aug 2024 11:01:43 +0100 Subject: [PATCH] [FIXUP] cmake: Use `PROJECT_BINARY_DIR` consistently --- cmake/module/Maintenance.cmake | 44 +++++++++++++++++----------------- cmake/tests.cmake | 4 ++-- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/cmake/module/Maintenance.cmake b/cmake/module/Maintenance.cmake index d9fd71465236a..c2cf2f6a9455d 100644 --- a/cmake/module/Maintenance.cmake +++ b/cmake/module/Maintenance.cmake @@ -74,19 +74,19 @@ function(add_windows_deploy_target) include(GenerateSetupNsi) generate_setup_nsi() add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/bitcoin-win64-setup.exe - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/release - COMMAND ${CMAKE_STRIP} $ -o ${CMAKE_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${CMAKE_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${CMAKE_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${CMAKE_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${CMAKE_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${CMAKE_BINARY_DIR}/release/$ - COMMAND ${CMAKE_STRIP} $ -o ${CMAKE_BINARY_DIR}/release/$ - COMMAND makensis -V2 ${CMAKE_BINARY_DIR}/bitcoin-win64-setup.nsi + OUTPUT ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe + COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/release + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND makensis -V2 ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi VERBATIM ) - add_custom_target(deploy DEPENDS ${CMAKE_BINARY_DIR}/bitcoin-win64-setup.exe) + add_custom_target(deploy DEPENDS ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe) endif() endfunction() @@ -104,8 +104,8 @@ function(add_macos_deploy_target) ) add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt - COMMAND ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --config $ --component GUI --prefix ${macos_app}/Contents/MacOS --strip + OUTPUT ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $ --component GUI --prefix ${macos_app}/Contents/MacOS --strip COMMAND ${CMAKE_COMMAND} -E rename ${macos_app}/Contents/MacOS/bin/$ ${macos_app}/Contents/MacOS/Bitcoin-Qt COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/bin VERBATIM @@ -114,37 +114,37 @@ function(add_macos_deploy_target) string(REPLACE " " "-" osx_volname ${PACKAGE_NAME}) if(CMAKE_HOST_APPLE) add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/${osx_volname}.zip + OUTPUT ${PROJECT_BINARY_DIR}/${osx_volname}.zip COMMAND ${PYTHON_COMMAND} ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} -zip - DEPENDS ${CMAKE_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt VERBATIM ) add_custom_target(deploydir - DEPENDS ${CMAKE_BINARY_DIR}/${osx_volname}.zip + DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip ) add_custom_target(deploy - DEPENDS ${CMAKE_BINARY_DIR}/${osx_volname}.zip + DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip ) else() add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt + OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt COMMAND OBJDUMP=${CMAKE_OBJDUMP} ${PYTHON_COMMAND} ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} - DEPENDS ${CMAKE_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt VERBATIM ) add_custom_target(deploydir - DEPENDS ${CMAKE_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt + DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt ) find_program(ZIP_COMMAND zip REQUIRED) add_custom_command( - OUTPUT ${CMAKE_BINARY_DIR}/dist/${osx_volname}.zip + OUTPUT ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip WORKING_DIRECTORY dist COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_COMMAND} ${osx_volname}.zip VERBATIM ) add_custom_target(deploy - DEPENDS ${CMAKE_BINARY_DIR}/dist/${osx_volname}.zip + DEPENDS ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip ) add_dependencies(deploy deploydir) endif() diff --git a/cmake/tests.cmake b/cmake/tests.cmake index d109e044defe5..279132980017f 100644 --- a/cmake/tests.cmake +++ b/cmake/tests.cmake @@ -4,12 +4,12 @@ if(TARGET bitcoin-util AND TARGET bitcoin-tx AND PYTHON_COMMAND) add_test(NAME util_test_runner - COMMAND ${CMAKE_COMMAND} -E env BITCOINUTIL=$ BITCOINTX=$ ${PYTHON_COMMAND} ${CMAKE_BINARY_DIR}/test/util/test_runner.py + COMMAND ${CMAKE_COMMAND} -E env BITCOINUTIL=$ BITCOINTX=$ ${PYTHON_COMMAND} ${PROJECT_BINARY_DIR}/test/util/test_runner.py ) endif() if(PYTHON_COMMAND) add_test(NAME util_rpcauth_test - COMMAND ${PYTHON_COMMAND} ${CMAKE_BINARY_DIR}/test/util/rpcauth-test.py + COMMAND ${PYTHON_COMMAND} ${PROJECT_BINARY_DIR}/test/util/rpcauth-test.py ) endif()