在用柯南创建Cmakelist的过程中遇到了一些问题。 我只是按照官方的例子,但这对我不起作用...
这是我的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!
答案 0 :(得分:0)
软件包 Hello/0.1@memsharded/testing 仅在Memsharded的remote
中可用因此,您需要在构建项目之前添加遥控器:
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