Cmake's FetchContent with gRPC issue - cmake

I recently read the blog here: https://grpc.io/blog/cmake-improvements/ and they recommended using FetchContent as part of the Cmake configuration.
My project requires both protobuf and gRPC, and I would like to install protobuf first then gRPC. However, when there is a system that has neither installed, the proposal to use FetchCotent does not work as gRPC expects protobuf to be installed as a dependency.
How can I use FetchContent so protobuf can be installed before gRPC as part of the compilation process.
Just to be clear, the reason this doesn't work is because gRPC's make uses find_package for protobuf which requires protobuf to be installed.

Related

Use Doxygen 1.9 (built from source) in CMake

I am not that much sound in CMake and which leads to me in this issue. I am trying to use Doxygen in a project using CMake. Previously, I have used Doxygen version 1.8.11 which was installed from Ubuntu package manager. I have simply followed the following command to install Doxygen
sudo apt-get install doxygen
And in the project in CMakeLists.txt file I have included
find_package(Doxygen REQUIRED)
Everything works flawlessly.
But now for a specific reason I have to upgrade my Doxygen version which is not available in Ubuntu package manager, that's why I have built the binary by following this. The downloaded Doxygen Source directory and my project directory are not the same.
My query is how can I tell CMake to search for this newly installed/build Doxygen?
Still, I am finding the version of Doxygen is 1.8.11
I am using Ubuntu 16.04, cmake version 3.19.0-rc3

How can I build in KDevelop a Ninja project without using CMake?

CMake can generate a Ninja configured project, which can then be built from KDevelop.
However I already get my Ninja files with another tool (Meson).
How can I make KDevelop use the Ninja files I provide, without calling CMake?
I don't think there is a way other than using Custom buildsystem plugin yet. So, eiter use CMake build system with Ninja generator, or custom buildsystem.
But the good news are that Meson plugin for KDevelop is already being baked and hopefully will see a release!

Does Conan install build dependencies when building from source?

E.g. if my package requires gcc to build and gcc is not present on the target system, will it be installed when building my package from source? If so, how do I specify build dependencies for my package? They may be different for different systems.
Conan does not install anything that it is not instructed to install.
For installing build dependencies, there is the concept of build_requires
They can be declared:
In the package recipe, for specific tools to that package. Could be, for example, a testing library (it is a build-require, only required for build & test, but not required once you have the binary. It doesn't affect the final binary)
In a profile: This is for general tools, things that mostly apply to all dependencies. They are declared here by the final user, who can choose this way to use their system installed tools, or a tool installed by conan.
There are existing packages for tools for CMake, and MinGW in Bintray (conan-center, bincrafters repos)
Packages in conan are installed at the user level, no root required. Those tools (CMake, MinGW) are easy to install and operate at the user level. It is, however, not very typical to have gcc compilers in Linux at the user level. I am not aware of conan packages for Linux gcc, though might be possible to build them, either as full package or as a thin wrapper over the system one. This latter might be more difficult to provide switches between different compiler versions installed in the system.

Avoiding platform-dependent dependencies when creating Eclipse Plugin

We are developing an Eclipse plugin for graphic editing of task graphs and then stores the serialized version in XML. We have used EMF and GMF to build our plugin, and were able to package and test it on win32 systems.
However, when we try to use install on other systems (64-bit windows, Linux), we get the
requires 'org.eclipse.core.filesystem.win32.x86[1.1.200.v20100505-1235]'
error.
We are not explicitly calling a win32 filesystem method, and I thought that although the plugin was developed on a win32 system, the plugin's dependency would only be on the org.eclipse.core.filesystem package, which would be resolved locally at install time on the user's machine.
Am I missing something? Should I edit a specific (autogenerated) file and remove the reference to the win32 package mention?
Thanks in advance for your time.
-A
org.eclipse.core.filesystem is the plugin and org.eclipse.core.filesystem.win32.x86 is a fragment. Ideally you should have dependency on the plugin only. How did the fragment end up as a dependency in your plugin? You can safely remove the fragment from your dependency

pjsip using cmake

Has someone compiled pjsip using cmake?
The project does not have a way of using CMake to build the library itself (yet). But you can link to pjproject libs from your CMake project.
Here's a snippet from one of mine that uses pjproject as a dependency:
find_package(PKGCONFIG REQUIRED)
pkg_check_modules(PJSIP libpjproject>=1.14 REQUIRED)
include_directories(${PJSIP_INCLUDE_DIRS})
...
target_link_libraries(your_target ${PJSIP_LIBRARIES})
This requires pkg-config as well, and that pjproject.pc should be in it's default search path, or in directory in $PKG_CONFIG_PATH.
This should work on Linux and OS X.
I just made cmake-based compilation of PJSIP v2.3.
I use this compilation only on Windows platform for now, not tested on linux.
On Linux I recommend use PKG_CONFIG tool to discover PJSIP for your app.
Having peeked at their repository, the project is auto-tools/configure based. You would need to port the build system yourself. Depending on complexity, it is not that hard to accomplish. I have converted many projects to cmake. Maybe the pjsip comunity would welcome an upgrade to their build system, as I see they support multiple platforms like iphone, and windows through visual studio.
If you are using Clion IDE then it can automatically generate cmake file for pjproject. Just import it and it will open a wizard. You’ll need to specify the location of the sources, then select project files and include directories. Clion has the ability to make the cmake file from existing projects. for more help please see this link Clion Documentation