1

I have a yocto sdk to build for and I am trying to make it work with vcpkg, I wrote my triplet file

✦ ❯ cat triples/arm64-linux.cmake

    set(VCPKG_TARGET_ARCHITECTURE arm64)
    set(VCPKG_CRT_LINKAGE dynamic)
    set(VCPKG_LIBRARY_LINKAGE static)
    
    set(VCPKG_CMAKE_SYSTEM_NAME Linux)
    
    set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE /opt/tdx-xwayland/5.6.0/sysroots/x86_64-tdxsdk-linux/usr/share/cmake/OEToolchainConfig.cmake)

but when i invoke vcpkg the first pkg is correctly built but the second doesn't find the dependency: e.g.

./vcpkg install spdlog:arm64-linux 

....

    CMake Error at /home/dev/verdinpkg/vcpkg/scripts/buildsystems/vcpkg.cmake:829 (_find_package):
      Could not find a package configuration file provided by "fmt" with any of
      the following names:
    
        fmtConfig.cmake
        fmt-config.cmake
    
      Add the installation prefix of "fmt" to CMAKE_PREFIX_PATH or set "fmt_DIR"
      to a directory containing one of the above files.  If "fmt" provides a
      separate development package or SDK, be sure it has been installed.
    Call Stack (most recent call first):
      CMakeLists.txt:195 (find_package)

those fmt_config are inside vcpkg/buildtrees/fmt/arm64-linux-rel

Has anyone succeded?

PeppeDx
  • 133
  • 1
  • 10

1 Answers1

0

I found a solution (Tested on 2022.2)

Add CONFIG_fmt to your user-rootfsconfig file.

Then run petalinux-config -c rootfs and inside user packages enable the fmt library.

After that you'll have no issue in building spdlog

vcpkg install spdlog --triplet=arm64-xilinx
Computing installation plan...
The following packages will be built and installed:
  * fmt[core]:arm64-xilinx -> 9.1.0#1
    spdlog[core]:arm64-xilinx -> 1.11.0
  * vcpkg-cmake[core]:x64-linux -> 2022-12-22
  * vcpkg-cmake-config[core]:x64-linux -> 2022-02-06#1
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Detecting compiler hash for triplet arm64-xilinx...
Restored 4 package(s) from /home/shahar/.cache/vcpkg/archives in 101 ms. Use --debug to see more details.
Installing 1/4 vcpkg-cmake:x64-linux...
Elapsed time to handle vcpkg-cmake:x64-linux: 925 us
Installing 2/4 vcpkg-cmake-config:x64-linux...
Elapsed time to handle vcpkg-cmake-config:x64-linux: 361 us
Installing 3/4 fmt:arm64-xilinx...
Elapsed time to handle fmt:arm64-xilinx: 3.32 ms
Installing 4/4 spdlog:arm64-xilinx...
Elapsed time to handle spdlog:arm64-xilinx: 61.7 ms
Total install time: 662 ms
spdlog provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(spdlog CONFIG REQUIRED)
    target_link_libraries(main PRIVATE spdlog::spdlog spdlog::spdlog_header_only)
Shahar Hadas
  • 2,641
  • 1
  • 27
  • 29