Compiling nodes on macOS, CMake error in QT

Hi guys,

Wonder if anyone can help.


When compiling .vuonodes on a macOS High Sierra machine, I got some Ninja errors, something like “Ninja is for macOS 10.15”. But I managed to fix that by downloading Ninja from the web, and replace the version that comes built-in with QT with this one, and now it works.
I still get some CMake errors for functions that were not used, but from reading articles these can be omitted and the .vuonde still builds.
CMake Warnings :

CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_CXX_COMPILER
    CMAKE_C_COMPILER
    QT_QMAKE_EXECUTABLE


However, here is the one I can’t fix, when trying to build and package a node set using QT on macOS High Sierra or macOS Mojave, for example when trying to package the example file that comes with the Vuo SDK in SDK/Example/node/customType, I get an error :

Issues

...Desktop/customType/CMakeLists.txt:12: error: By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Qt5", but CMake did not find one. Could not find a package configuration file provided by "Qt5" with any of the following names: Qt5Config.cmake qt5-config.cmake Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR" to a directory containing one of the above files.  If "Qt5" provides a separate development package or SDK, be sure it has been installed.
:-1: error: CMake process exited with exit code 1.

And in the general messages :

CMake Error at CMakeLists.txt:12 (find_package):
  By not providing "FindQt5.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5" with any of
  the following names:

    Qt5Config.cmake
    qt5-config.cmake

  Add the installation prefix of "Qt5" to CMAKE_PREFIX_PATH or set "Qt5_DIR"
  to a directory containing one of the above files.  If "Qt5" provides a
  separate development package or SDK, be sure it has been installed.


CMake process exited with exit code 1.

Tried to find some help online but no luck.
QT is installed with default parameters, with Qt Creator 4.15.1, Based on Qt 5.15.2 (Clang 11.0 (Apple), 64 bit), and the latest Vuo SDK.
Did I fail to perform some extra step upon the install ?
Or could I have broke stuff because I tried to manually install the latest CMake version from Installing CMake (removed it afterwards).
Or is it the fact that I have manually swapped Ninja to fix the other error ?
Or is the Vuo SDK’s code and CMakeLists supposed to work with macOS past Mojave ?

Thanks for any help

First, figure out where you have the Qt framework installed. On my system, I’ve installed Qt and Vuo’s other dependencies following the steps in the README, so the path I need is ~/.conan/data/qt/5.11.3-8/vuo/stable/package/561db77d4381f1ba28104c239a3135864ee72270/lib/cmake. Depending on where you have Qt installed, the first part of the path may differ, but the /lib/cmake at the end will stay the same. The path refers to a folder that contains other folders (including one called Qt5) that contain .cmake files.

In Qt Creator, click on the Projects icon in the left sidebar. Under Build Settings, there’s a table with Key and Value headings. Next to that, click Add. For Key, put CMAKE_PREFIX_PATH. For Value, put in that path you just found above.

If anyone reading this is using Terminal instead of Qt Creator to build the example, you’ll encounter the same error when you run cmake ... Instead, run…

CMAKE_PREFIX_PATH=~/.conan/data/qt/5.11.3-8/vuo/stable/package/561db77d4381f1ba28104c239a3135864ee72270/lib/cmake cmake ..

… substituting in the correct path for your system, as I described above.

With a recent version of Qt’s “online installer”, if you install to the default location (~/Qt), the path to put in for CMAKE_PREFIX_PATH is ~/Qt/5.15.2/clang_64/lib/cmake. The 5.15.2 refers to the Qt version and of course will change with newer versions. If you ran the installer but don’t see a Qt folder in your home directory, you could try re-running the installer, selecting the “custom” installation option, and checking the “Qt 5.15.2 > macOS” checkbox.

Thanks, appreciated, will try these steps ;)