我试图让pugixml在github操作中运行。我很乐意接受任何可行的解决方案.
我将下载添加到cmake.yml中。
run: sudo apt-get update && sudo apt-get install libsystemd-dev libpugixml-devgithub中的Ubuntu正在安装1.10-1:
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操作中有调试方法吗?
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发布于 2021-08-12 06:36:08
我通过使用vcpkg安装pugixml来解决这个问题:
- 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}}https://stackoverflow.com/questions/68692337
复制相似问题