memsharded / conan-protobuf

Google protocol buffers conan package
MIT License
1 stars 17 forks source link

ConanException: First argument of CMake() has to be ConanFile. Use CMake(self) #23

Open rwols opened 6 years ago

rwols commented 6 years ago

I get this when issuing conan create foo/bar:

ERROR: PROJECT: Error in build() method, line 11
    cmake = CMake(self.settings)
    ConanException: First argument of CMake() has to be ConanFile. Use CMake(self)

Note I'm on conan 0.30. I'm running the release/3.3.0 branch.

memsharded commented 6 years ago

Yes, this has changed in the last conan release, and the recipe is a bit outdated. I am going to correct it asap, but if you are using it from bintray (conan-transit), I don't know if I will be able to update it. Thanks for reporting!

memsharded commented 6 years ago

I have updated both the git branch release/3.3.0 and the bintray conan-transit recipe. Please tell me if it works, thanks!

rwols commented 6 years ago

This brings me a bit further :) But now protoc seems to complain:

/home/raoul/.conan/data/protobuf/3.3.0/qipc/snapshot/package/a22947addb79cf353b6edadaed388d4998a1af6f/bin/protoc: error: '/home/raoul/.conan/data/protobuf/3.3.0/qipc/snapshot/package/a22947addb79cf353b6edadaed388d4998a1af6f/bin/.libs/protoc' does not exist
This script is just a wrapper for protoc.
See the libtool documentation for more information.

This is at the test package step:

protobuf/3.3.0@qipc/snapshot test package: Running build()
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan: called by CMake conan helper
-- Conan: Compiler GCC>=5, checking major version 6.3
-- Conan: Checking correct version: 6.3
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: C++ stdlib: libstdc++11
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- 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  
/home/raoul/.conan/data/protobuf/3.3.0/qipc/snapshot/package/a22947addb79cf353b6edadaed388d4998a1af6f/bin/protoc: error: '/home/raoul/.conan/data/protobuf/3.3.0/qipc/snapshot/package/a22947addb79cf353b6edadaed388d4998a1af6f/bin/.libs/protoc' does not exist
This script is just a wrapper for protoc.
See the libtool documentation for more information.
CMake Warning at /usr/share/cmake-3.7/Modules/FindProtobuf.cmake:387 (message):
  Protobuf compiler version doesn't match library version 3.3.0
Call Stack (most recent call first):
  CMakeLists.txt:10 (find_package)
memsharded commented 6 years ago

Myabe the FindProtobuf.cmake helper is finding another protoc in your system? (I just tested in Windows).

Also, I am not a big fan of find-cmake scripts, what I want to do is to actually create an independent package for protoc, because it also has some issues for dynamic libraries. I will be updating this package once we are able to release conan 1.0, hopefully soon.