brew install tbb
sudo apt-get install libtbb-dev
vcpkg install tbb
cmake -B build -DTBB_ROOT=/path/to/tbb
The easiest way to get trueform C++ headers is via pip. This installs both Python bindings and C++ headers:
pip install trueform
Use the header-only library as a CMake package:
cmake_minimum_required(VERSION 3.16)
project(my_app LANGUAGES CXX)
find_package(trueform REQUIRED CONFIG)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE tf::trueform)
Configure your build so CMake can find the package installed by pip:
cmake -B build -Dtrueform_ROOT=$(python -m trueform.cmake)
cmake --build build
python -m trueform.cmake — CMake config directorypython -m trueform.cmake --include_dir — C++ headers pathpython -m trueform.cmake --cmake_dir — Same as defaultClone and install trueform system-wide:
git clone https://github.com/xlabmedical/trueform.git
cd trueform
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
cmake --install build --config Release
Then use find_package in your project:
cmake_minimum_required(VERSION 3.16)
project(my_app LANGUAGES CXX)
find_package(trueform REQUIRED CONFIG)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE tf::trueform)
cmake -B build
cmake --build build
cmake --install build --prefix ~/mylibs
cmake -B build -DCMAKE_PREFIX_PATH=~/mylibs
For a self-contained project without system installation:
cmake_minimum_required(VERSION 3.16)
project(my_app LANGUAGES CXX)
include(FetchContent)
FetchContent_Declare(
trueform
GIT_REPOSITORY https://github.com/xlabmedical/trueform.git
GIT_TAG main
)
FetchContent_MakeAvailable(trueform)
add_executable(my_app main.cpp)
target_link_libraries(my_app PRIVATE tf::trueform)
cmake -B build
cmake --build build
GIT_TAG.#include <trueform/trueform.hpp>
#include <iostream>
int main() {
auto pt = tf::make_point(1.0, 2.0, 3.0);
std::cout << "trueform is working!" << std::endl;
return 0;
}
For VTK integration (tf::vtk), see the VTK documentation for build and installation instructions.