This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
As far as I can tell it should be available to cMake as "Spnav_VERSION" in the PrintFinalReport.cmake (on Linux), but I can't test it, I don't have libspnav installed.
if (WIN32)
#message(STATUS "SPNAV: not available yet for your OS") # FREECAD_USE_3DCONNEXION instead...
else(WIN32)
if(DEFINED SPNAV_FOUND)
message(STATUS "SPNAV: [${SPNAV_LIBRARY}] [${SPNAV_INCLUDE_DIR}]")
else(DEFINED SPNAV_FOUND)
message(STATUS "SPNAV: not found")
endif(DEFINED SPNAV_FOUND)
endif(WIN32)
Neither Spnav_VERSION nor SPNAV_VERSION nor any other variable that stores the version number is defined. CMake support for the spnav library is done with FreeCAD's own FindSpnav.cmake file which only searches for the spnav.h header file.
The SDK of spnav nowhere defines a version number so it's not even possible to extend the CMake support to provide a version number. The only version number comes from the Linux packaging system which on my system e.g. is 0.2.3. And the version number of the package is probably not related to the development state of spnav because here is a PDF from 2012 where it says the version number is 0.9: https://buildmedia.readthedocs.org/medi ... /spnav.pdf
I personally have an interest in seeing more up to date libspnav's because of this confusing output that users will probably redundantly report: https://forum.freecadweb.org/viewtopic.php?f=8&t=65632 (issue #4711)
It's fixed in 0.3 but shortly afterwards upstream released a v1.0
chennes wrote: ↑Thu Apr 14, 2022 3:06 pm
They put a version number in their pkg-config file, I think. Can we get cMake to use pkgconfig to locate spnav?
I think there is a mechanism to load pkgconfig files with CMake but at least inside the two packages on Ubuntu there is no such file provided. However, in the code repository there is a spnav.pc.in
EDIT:
According to the history this file was added just a month ago. So, then of course none of the existing packages will offer such a file.