CMakeLists Rhino Plugin C++

Hi,

Why there is no example how C++ Rhino Plugin could be compiled using CMake?

The reason to ask, is that sharing your C++ plugin that links 3rd party libraries can be relatively difficult.

If there is one, it would good to have.

Hi @Petras1,

CMake doesn’t compile - it just creates make files. And since only Visual C++ is supported for C++ plug-ins, it doesn’t make a whole lot of sense to support it.

What library are you trying to use?

— Dale

Hi Dale,

What do you mean it does not compile? I am using it to compile executables, shared .dlls or static libs.

There are bunch of 3rd parties like Boost, Eigen, Open3D, PCL, CGAL, Cilantro, 3D viewers and others with their differences depending on a project. I know how to link them manually through Visual Studio IDE, but seems it is easier to pass onr CMakeLists.txt file rather than instructions for setting a project manually.

CMake is not a compiler. It uses compiler and platform independent configuration files to generate native build tool files specific to your compiler and platform.

Most of the tools you mention are available on vcpkg, which should make using in plug-in projects fairly easy.

– Dale

Dear @Dale vcpkg package does not work on some of the previously mentioned libraries specially on Windows.

It would be really nice if some of you could invest time in providing an example on CMake.
It can be even without linking external libraries.

Maybe you just need this?

https://cmake.org/cmake/help/latest/command/include_external_msproject.html

– Dale

Thanks for a reference but I am searching how to link libraries.

Can it be that McNeel does not provide this explanation partly because Rhino is commercial software? And majority of the libraries I used before are open-source. CMakeLists seems to be one of stadard distribution even together with vcpkg package manager. Maybe there could be something done with OpenNurbs.

Not at all. We just don’t get many requests for this.

– Dale

I’ve been slowly adding this to OpenNURBS. It just takes time and other projects always seem to get in the way.

Fingers crossed we can see this development;)