astrocurieux
astrocurieux

Reputation: 53

Cmakelists with conan

I encounter some problems during the creation of my Cmakelists with Conan. I just follow the official exemple but it doesn't work for me ...

this is my 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})

and my error is :

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!

Upvotes: 1

Views: 6089

Answers (1)

uilianries
uilianries

Reputation: 3887

The package Hello/0.1@memsharded/testing is only available in Memsharded's remote

Thus, you need to add the remote, before to build your project:

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

Otherwise, won't be able to find that package.

Another option is downloading the project and building it:

git clone https://github.com/memsharded/conan-hello.git
cd conan-hello
conan create . memsharded/testing

Upvotes: 1

Related Questions