Utilizing CMake with Samples
This documentation is a brief explanation of how to utilize CMake in order to build the samples provided with the HOOPS Luminate package. As stated on the Beginning with HOOPS Luminate page, you can also use the CMakeLists.txt
file to re-compile any of the Tutorials provided in the package.
If you have any further questions, please refer to our Contact Us page.
What is CMake?
CMake is a tool utilized to generate any platform-specific project files, such as Visual Studio solutions, UNIX makefiles, or Xcode projects.
HOOPS Luminate uses this tool for building all samples in order to generate project files. In using CMake for this purpose, you can generate project files corresponding to your preferred platform and IDE.
Generate Sample Project Files
CMake can be downloaded from their official website here.
Once installed, you can use either a terminal or the GUI that comes with the package. Please note that the following instructions are given with the intentions of using a terminal. Also ensure that your CMake installation bin/
folder is added to your PATH.
Create a Build Folder
Within a PowerShell or terminal, and while in your package’s root folder, do the following commands:
mkdir build
cd build
Here we are creating a build directory and changing our current location in our terminal to said directory. We will then call and use CMake from this new directory, as seen below when you generate your project files.
Generate Project Files
You can use any project file generator to suit your OS and IDE preferences. For either Windows, Linux, or macOS, please see the below command to use to generate your project files. Select accordingly, and use this command in the same terminal window.
The full list of generators can be accessed with the following command in terminal:
cmake --help
Windows - Visual Studio 2019 Example
cmake .. -G "Visual Studio 16 2019"
Linux - Makefiles Example
cmake .. -G "Unix Makefiles"
macOS - Xcode Example
cmake .. -G "Xcode"
Build and Run Samples
Grab a License
In order to re-build samples, you will need to have a valid Luminate license. Please refer to the Licensing documentation for further instructions, if necessary.
Build
The output of the project files generated are now located in the build folder you selected. From here, the project files are ready to be used with your preferred operating system and IDE. You can now run any of the samples provided with your preferred method.
Run
Re-compiling samples will override the built-in samples’ binaries, located in the bin/
folder of the package; You can run these from there.