1

我在用柯南创建 Cmakelists 的过程中遇到了一些问题。我只是按照官方的例子,但它对我不起作用......

这是我的 Cmakefiles.txt :

cmake_minimum_required(VERSION 2.8)
project(UDP_Server)

set(CMAKE_BUILD_TYPE Release)

if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from 
https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake- 
conan/master/conan.cmake"
              "${CMAKE_BINARY_DIR}/conan.cmake")
endif()

include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(REQUIRES Hello/0.1@memsharded/testing
            BASIC_SETUP
            BUILD missing)
add_executable(server server/server.cpp)
add_executable(client client/client.cpp)
target_link_libraries(main ${CONAN_LIBS})

我的错误是:

ERROR: Failed requirement 'Hello/0.1@memsharded/testing' from 'PROJECT'
ERROR: Unable to find 'Hello/0.1@memsharded/testing' in remotes

CMake Error at conan.cmake:368 (message):
Conan install failed='1'
Call Stack (most recent call first):
conan.cmake:448 (conan_cmake_install)
CMakeLists.txt:14 (conan_cmake_run)


-- Configuring incomplete, errors occurred!
4

1 回答 1

1

软件包Hello/0.1@memsharded/testing仅在 Memsharded 的远程可用

因此,您需要在构建项目之前添加遥控器:

conan remote add memsharded https://api.bintray.com/conan/memsharded/conan-common 

否则,将无法找到该包。

另一种选择是下载项目并构建它:

git clone https://github.com/memsharded/conan-hello.git
cd conan-hello
conan create . memsharded/testing
于 2019-02-05T18:25:59.853 回答