Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gRPCTargets.cmake have invalid target properties #20578

Closed
hdnn opened this issue Oct 11, 2019 · 7 comments
Closed

gRPCTargets.cmake have invalid target properties #20578

hdnn opened this issue Oct 11, 2019 · 7 comments

Comments

@hdnn
Copy link

hdnn commented Oct 11, 2019

What version of gRPC and what language are you using?

1.23.0

What operating system (Linux, Windows,...) and version?

Windows 10 Pro

What runtime / compiler are you using (e.g. python version or version of gcc)

MSBuilder

What did you do?

I compile gRPC, with generating gRPCTargets.cmake file(all dependences is "package")

What did you expect to see?

In gRPCTargets.cmake:
_set_target_properties(gRPC::grpc++ PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "wsock32;ws2_32;OpenSSL::SSL;OpenSSL::Crypto;protobuf::libprotobuf;gRPC::grpc;gRPC::gpr"
)

What did you see instead?

In gRPCTargets.cmake:
_set_target_properties(gRPC::grpc++ PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${IMPORT_PREFIX}/include"
INTERFACE_LINK_LIBRARIES "wsock32;ws2_32;OpenSSL::SSL;OpenSSL::Crypto;libprotoc;libprotobuf;gRPC::grpc;gRPC::gpr"
)

In this case "libprotoc;libprotobuf" evolves into libs names(without absolute path). As result it is impossible to build project that use gRPC, because 'libprotoc.lib' not found.

@jtattermusch
Copy link
Contributor

CC @zackgalbreath

@jtattermusch
Copy link
Contributor

When you say "As result it is impossible to build project that use gRPC, because 'libprotoc.lib' not found.", can you include the exact steps you've made an and the corresponding error log?
(we do have a distrib tests on for windows installation and it's passing, so you just might be doing something wrong).

@hdnn
Copy link
Author

hdnn commented Oct 14, 2019

  1. Create conan package by using this recipe: https://github.com/inexorgame/conan-grpc/tree/stable/1.23.0
  2. in CMakeList.txt:
    set (LIB_DEPS protobuf::libprotobuf gRPC::grpc++ ) target_link_libraries(${PROJECT_NAME} PUBLIC ${LIB_DEPS})
  3. Generate Visual Studio solution: >cmake %Self% -G %GeneratorName% -DFC_OUTPUT_DIR="%OutputDir%" -DCMAKE_CONFIGURATION_TYPES=%BuildType%
  4. Open Solution, Project Settings - Linker - Input - Additional Dependencies:
    Annotation 2019-10-14 124615
    Green highlight - appeared from protobuf::libprotobuf, yellow highlight - appeared from gRPC::grpc++.
    But "yellow" libprotobufd.lib should have the same path that "green" libprotobufd.lib

@jtattermusch
Copy link
Contributor

@hdnn can you reproduce using cmake only, without using conan? (we don't officially conan, so it's not clear to me if this is a problem in our cmake build or in the conan recipe).

@jtattermusch
Copy link
Contributor

Seems similar to #12424?

@KyleFromKitware
Copy link
Contributor

So far, I have not been able to get the Conan recipe to build on my Windows machine to reproduce this.

@jtattermusch
Copy link
Contributor

Closing as "cannot reproduce".

cmake improvements (2019) automation moved this from To Do to Done Jan 7, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

No branches or pull requests

4 participants