Allow Specifying Custom Sysroot
This commit is contained in:
parent
f2a9b274d2
commit
ead7e575f3
19
dependencies/armhf-sysroot/CMakeLists.txt
vendored
19
dependencies/armhf-sysroot/CMakeLists.txt
vendored
@ -1,9 +1,15 @@
|
|||||||
project(armhf-sysroot)
|
project(armhf-sysroot)
|
||||||
|
|
||||||
# Packages
|
# Allow Custom Sysroot
|
||||||
|
set(MCPI_CUSTOM_BUNDLED_ARMHF_SYSROOT "" CACHE PATH "Custom Bundled ARMHF Sysroot")
|
||||||
|
if(MCPI_CUSTOM_BUNDLED_ARMHF_SYSROOT)
|
||||||
|
# Custom Sysroot
|
||||||
|
set(SYSROOT_DIR "${MCPI_CUSTOM_BUNDLED_ARMHF_SYSROOT}")
|
||||||
|
else()
|
||||||
|
# Download From APT
|
||||||
set(APT_PACKAGES "libc6" "libstdc++6")
|
set(APT_PACKAGES "libc6" "libstdc++6")
|
||||||
|
|
||||||
# Trigger Reconfigure On APT Change
|
# Reconfigure CMake If APT Data Is Changed
|
||||||
file(GLOB_RECURSE APT_FILES "apt/*")
|
file(GLOB_RECURSE APT_FILES "apt/*")
|
||||||
foreach(APT_FILE IN LISTS APT_FILES)
|
foreach(APT_FILE IN LISTS APT_FILES)
|
||||||
set_property(
|
set_property(
|
||||||
@ -51,7 +57,7 @@ file(WRITE "${APT_DIR}/apt.conf" "${APT_CONFIG}")
|
|||||||
set(APT_ENV
|
set(APT_ENV
|
||||||
"${CMAKE_COMMAND}"
|
"${CMAKE_COMMAND}"
|
||||||
-E env
|
-E env
|
||||||
DEBIAN_FRONTEND=noninteractive
|
"DEBIAN_FRONTEND=noninteractive"
|
||||||
"APT_CONFIG=${APT_DIR}/apt.conf"
|
"APT_CONFIG=${APT_DIR}/apt.conf"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -64,24 +70,25 @@ file(MAKE_DIRECTORY "${SYSROOT_DIR}")
|
|||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${APT_DIR}/.update-stamp"
|
OUTPUT "${APT_DIR}/.update-stamp"
|
||||||
COMMAND ${APT_ENV} apt-get update
|
COMMAND ${APT_ENV} apt-get update
|
||||||
COMMAND touch ARGS "${APT_DIR}/.update-stamp"
|
COMMAND "${CMAKE_COMMAND}" -E touch "${APT_DIR}/.update-stamp"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${APT_DIR}/.download-stamp"
|
OUTPUT "${APT_DIR}/.download-stamp"
|
||||||
DEPENDS "${APT_DIR}/.update-stamp"
|
DEPENDS "${APT_DIR}/.update-stamp"
|
||||||
COMMAND ${APT_ENV} apt-get install -y --no-install-recommends --download-only ${APT_PACKAGES}
|
COMMAND ${APT_ENV} apt-get install -y --no-install-recommends --download-only ${APT_PACKAGES}
|
||||||
COMMAND touch ARGS "${APT_DIR}/.download-stamp"
|
COMMAND "${CMAKE_COMMAND}" -E touch "${APT_DIR}/.download-stamp"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${APT_DIR}/.extract-stamp"
|
OUTPUT "${APT_DIR}/.extract-stamp"
|
||||||
DEPENDS "${APT_DIR}/.download-stamp"
|
DEPENDS "${APT_DIR}/.download-stamp"
|
||||||
COMMAND ${APT_ENV} find "${APT_DIR}/archives" -maxdepth 1 -type f -name "*.deb" -exec dpkg -x {} "${SYSROOT_DIR}" ";"
|
COMMAND ${APT_ENV} find "${APT_DIR}/archives" -maxdepth 1 -type f -name "*.deb" -exec dpkg -x {} "${SYSROOT_DIR}" ";"
|
||||||
COMMAND touch ARGS "${APT_DIR}/.extract-stamp"
|
COMMAND "${CMAKE_COMMAND}" -E touch "${APT_DIR}/.extract-stamp"
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
add_custom_target(armhf-sysroot ALL DEPENDS "${APT_DIR}/.extract-stamp")
|
add_custom_target(armhf-sysroot ALL DEPENDS "${APT_DIR}/.extract-stamp")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
install(
|
install(
|
||||||
|
Loading…
Reference in New Issue
Block a user