coin3d / pivy

python bindings to coin3d
ISC License
53 stars 39 forks source link

How do you recommend projects find pivy using CMake ? (Is there a Findpivy.cmake?) #82

Closed luzpaz closed 3 years ago

luzpaz commented 3 years ago

Trying to find a way to output the version of Pivy during a CMake install.
I've ascertained that the version number is located inhttps://github.com/coin3d/pivy/blob/master/pivy/pivy_meta.py
So would I just need to compile a regex similar to how the Coin3D version is parsed in: https://github.com/FreeCAD/FreeCAD/blob/7b87cc8a74b43615711dce7b1964c6394e194f0c/cMake/FindCoin3D.cmake#L109-L118

looooo commented 3 years ago

Best to use python:

import pivy
try:
    print(pivy.__version__)
except AttributeError:
    print("pivy is outdated, please update ;)")
luzpaz commented 3 years ago

Thanks @looooo but is even possible to use python during the CMake phase?

looooo commented 3 years ago

Sure eg. in this example: https://github.com/booya-at/parabem/blob/master/src/python/CMakeLists.txt#L1L4

But you need python as a build dependency.

luzpaz commented 3 years ago

:exploding_head:
had no idea that was possible!