首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Github动作中的Cmake和PugiXML

Github动作中的Cmake和PugiXML
EN

Stack Overflow用户
提问于 2021-08-07 12:23:54
回答 1查看 217关注 0票数 0

我试图让pugixml在github操作中运行。我很乐意接受任何可行的解决方案.

我将下载添加到cmake.yml中。

代码语言:javascript
复制
      run: sudo apt-get update && sudo apt-get install libsystemd-dev libpugixml-dev

github中的Ubuntu正在安装1.10-1:

代码语言:javascript
复制
Get:1 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 libpugixml1v5 amd64 1.10-1 [89.9 kB]
Get:2 http://azure.archive.ubuntu.com/ubuntu focal/universe amd64 libpugixml-dev amd64 1.10-1 [105 kB]
Get:3 http://azure.archive.ubuntu.com/ubuntu focal-updates/main amd64 libsystemd-dev amd64 245.4-4ubuntu3.11 [246 kB]

在我的专用机器上,我使用Debian测试,其中安装了pugixml的版本: 1.11.4-1。

CMake现在告诉我们,它找不到1.10或更高版本。看起来,ubuntu的版本标签不正确(?)。在这些github操作中有调试方法吗?

代码语言:javascript
复制
CMake Deprecation Warning at plog/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Checking for module 'libsystemd'
--   Found libsystemd, version 245
CMake Error at CMakeLists.txt:20 (find_package):
  Could not find a configuration file for package "pugixml" that is
-- Configuring incomplete, errors occurred!
  compatible with requested version "1.10".
See also "/home/runner/work/sdbus_for_dummies/sdbus_for_dummies/build/CMakeFiles/CMakeOutput.log".

See also "/home/runner/work/sdbus_for_dummies/sdbus_for_dummies/build/CMakeFiles/CMakeError.log".
  The following configuration files were considered but not accepted:

    /usr/lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake, version: unknown
    /lib/x86_64-linux-gnu/cmake/pugixml/pugixml-config.cmake, version: unknown
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-08-12 06:36:08

我通过使用vcpkg安装pugixml来解决这个问题:

代码语言:javascript
复制
    - name: Install pugixml via vcpkg
      run: sudo vcpkg install pugixml && sudo vcpkg integrate install
  
    - name: Configure CMake
      # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
      # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
      run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake
    - name: Build
      # Build your program with the given configuration
      run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68692337

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档