Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,805
    • Issues 3,805
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 4
    • Merge requests 4
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMake
  • CMakeCMake
  • Issues
  • #20787

Closed
Open
Created Jun 04, 2020 by Brad King@brad.kingOwner

find_program finds objcopy and objdump before finding arm-none-eabi-objcopy and arm-none-eabi-objdump

From Mark Betters:

if (NOT TRIPLET)
    set(TRIPLET "arm-none-eabi")
endif()
if (NOT TOOLCHAIN_ROOT)
    set(TOOLCHAIN_ROOT "/usr")
endif()
set(TOOLCHAIN_BIN_PATH "${TOOLCHAIN_ROOT}/bin")
find_program(CMAKE_OBJCOPY
    NAMES ${TRIPLET}-objcopy
    PATHS ${TOOLCHAIN_BIN_PATH}
    NO_DEFAULT_PATH
    NO_PACKAGE_ROOT_PATH
    NO_CMAKE_PATH
    NO_CMAKE_ENVIRONMENT_PATH
    NO_SYSTEM_ENVIRONMENT_PATH
    NO_CMAKE_SYSTEM_PATH
    NO_CMAKE_FIND_ROOT_PATH
)
find_program(CMAKE_OBJDUMP
    NAMES ${TRIPLET}-objdump
    PATHS ${TOOLCHAIN_BIN_PATH}
    NO_DEFAULT_PATH
    NO_PACKAGE_ROOT_PATH
    NO_CMAKE_PATH
    NO_CMAKE_ENVIRONMENT_PATH
    NO_SYSTEM_ENVIRONMENT_PATH
    NO_CMAKE_SYSTEM_PATH
    NO_CMAKE_FIND_ROOT_PATH
)

... finds /usr/bin/objcopy and /usr/bin/objdump, which wasn't what I wanted. I had to add these lines before the find_program(...) calls to successfully find /usr/bin/arm-none-eabi-objcopy and /usr/bin/arm-none-eabi-objdump:

unset(CMAKE_OBJCOPY CACHE)
unset(CMAKE_OBJDUMP CACHE)

CMake version: 3.16.3

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking