summaryrefslogtreecommitdiffstats
path: root/Modules/CPack.cmake
diff options
context:
space:
mode:
authorMatteo Martelli <matteomartelli3@gmail.com>2022-09-02 15:50:18 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-06 13:49:54 (GMT)
commit0c638ab59782fd5210255674f3456d0400ee0223 (patch)
treed06778a6142e064cf047f139c6a9c06dba78896b /Modules/CPack.cmake
parent01e95efc34a2a9bcf9910d65d3b38ff9b8a51750 (diff)
downloadCMake-0c638ab59782fd5210255674f3456d0400ee0223.zip
CMake-0c638ab59782fd5210255674f3456d0400ee0223.tar.gz
CMake-0c638ab59782fd5210255674f3456d0400ee0223.tar.bz2
CPack: re-use paths of tools discovered by CMakeFindBinUtils
`CMakeFindBinUtils.cmake` sets `CMAKE_<TOOL>` variables that in cross-compilation environments point to the toolchain specific executables: e.g. `CMAKE_OBJCOPY` might point to `<path_to_toolchain>/arm-poky-linux-gnueabi-objcopy`. Pass this information to CPack.
Diffstat (limited to 'Modules/CPack.cmake')
-rw-r--r--Modules/CPack.cmake37
1 files changed, 37 insertions, 0 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake
index 07280e0..828d9ca 100644
--- a/Modules/CPack.cmake
+++ b/Modules/CPack.cmake
@@ -472,6 +472,33 @@ The following variables are for advanced uses of CPack:
target or when running :manual:`cpack <cpack(1)>` without the
:option:`-G <cpack -G>` option.
+.. variable:: CPACK_READELF_EXECUTABLE
+
+ .. versionadded:: 3.25
+
+ Specify the ``readelf`` executable path used by CPack.
+ The default value will be ``CMAKE_READELF`` when set. Otherwise,
+ the default value will be empty and CPack will use :command:`find_program`
+ to determine the ``readelf`` path when needed.
+
+.. variable:: CPACK_OBJCOPY_EXECUTABLE
+
+ .. versionadded:: 3.25
+
+ Specify the ``objcopy`` executable path used by CPack.
+ The default value will be ``CMAKE_OBJCOPY`` when set. Otherwise,
+ the default value will be empty and CPack will use :command:`find_program`
+ to determine the ``objcopy`` path when needed.
+
+.. variable:: CPACK_OBJDUMP_EXECUTABLE
+
+ .. versionadded:: 3.25
+
+ Specify the ``objdump`` executable path used by CPack.
+ The default value will be ``CMAKE_OBJDUMP`` when set. Otherwise,
+ the default value will be empty and CPack will use :command:`find_program`
+ to determine the ``objdump`` path when needed.
+
#]=======================================================================]
# Define this var in order to avoid (or warn) concerning multiple inclusion
@@ -591,6 +618,16 @@ _cpack_set_default(CPACK_RESOURCE_FILE_WELCOME
_cpack_set_default(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
+if(CMAKE_READELF)
+ _cpack_set_default(CPACK_READELF_EXECUTABLE "${CMAKE_READELF}")
+endif()
+if(CMAKE_OBJCOPY)
+ _cpack_set_default(CPACK_OBJCOPY_EXECUTABLE "${CMAKE_OBJCOPY}")
+endif()
+if(CMAKE_OBJDUMP)
+ _cpack_set_default(CPACK_OBJDUMP_EXECUTABLE "${CMAKE_OBJDUMP}")
+endif()
+
# Set default directory creation permissions mode
if(CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS)
_cpack_set_default(CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS