Installing
The library can be installed using CMake (any version over 3.15).
Dependencies
Ensure that a minimal installation of USD is available. Headers and compiled libraries from USD as well as headers from transitive dependencies such as TBB and Boost are required during the building process.
If Python bindings are needed, USD must be built with Python support. Compiled libraries and headers from Python and Boost Python are also required during the building process.
See also
Custom search paths to dependent packages can be provided with the following CMake options (or environment variable):
Option / Environment Variable |
Description |
---|---|
USD_ROOT |
Add search path to USD package. |
TBB_ROOT |
Add search path to TBB package. |
Boost_ROOT |
Add search path to Boost package. |
Python_ROOT |
Add search path to Python package. |
Pytest_ROOT |
Add search path to pytest program. |
Doxygen_ROOT |
Add search path to doxygen program. |
Sphinx_ROOT |
Add search path to sphinx-build program. |
ClangFormat_ROOT |
Add search path to clang-format program. |
Building library
Obtain a copy of the source by either downloading the zipball or cloning the public repository:
git clone git@github.com:wdas/unf.git
Then you can build and install the library as follows:
cd unf
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=/path/to/destination ..
cmake --build . --target install
Here are a few CMake options that can be used to influence the building process:
Option |
Description |
---|---|
BUILD_TESTS |
Indicate whether tests should be built. Default is true. |
BUILD_DOCS |
Indicate whether documentation should be built. Default is true. |
BUILD_PYTHON_BINDINGS |
Indicate whether Python bindings should be built. Default is true. |
BUILD_SHARED_LIBS |
Indicate whether library should be built shared. Default is true. |
BUNDLE_PYTHON_TESTS |
Bundle Python tests per group (faster). Default is false. |
The library can then be used by other programs or libraries via the unf::unf
Cmake target.
Apply clang-format
Ensure that Clang-format is installed for applying C++ style.
Then run the program as follows:
cmake --build . --target format
Warning
When contributing, please run this command before committing your code.
Building documentation
Ensure that Doxygen is installed. The required Python dependencies must also be installed as follows:
pip install -r doc/requirements.txt
Then build the documentation as follows:
cmake --build . --target documentation
Note
Documentation is automatically built with default installation, unless you
set the BUILD_DOCS
CMake option to false.
Running tests
Ensure that GTest is installed. The required Python dependencies must also be installed as follows:
pip install -r test/requirements.txt
Note
Python dependencies are not necessary if the BUILD_PYTHON_BINDINGS
CMake option is set to false.
Once the library and all tests are built, you can run the tests using Ctest within the build folder as follows:
ctest
You can increase the verbosity and filter in one or several tests as follows:
ctest -VV
ctest -R BrokerTest.Create -VV
ctest -R BrokerTest.* -VV
Note
Tests are automatically built with default installation, unless you
set the BUILD_TESTS
CMake option to false.
By default, unit tests and integration tests in Python will be decomposed into
separated tests that can be individually filtered. Set the
BUNDLE_PYTHON_TESTS
CMake option (or environment variable) to true
if you want to combine Python tests per test type.