HawkTracer  0.10.0
Integrate HawkTracer to existing project

HawkTracer is a library which provides functions for instrumenting the code. To provide best user experience, HawkTracer supports multiple build systems. If you can't find the one you use, please let us know. Following build systems/tools are already supported:


There are 2 ways of integrating HawkTracer with CMake project; if HawkTracer is already installed in your system, you can just include HawkTracer config file and use exported targets. If you don't want to download and build HawkTracer as a part of build process of your project, we recommend to use CMake ExternalProject module.


You can find example project which uses CMake ExternalProject module to include HawkTracer in the repository. You can copy the hawktracer.cmake file to your project, include it in one of CMakeLists.txt files, and link to hawktracer target:

# include cmake file
# define your target
add_executable(your_project main.cpp)
# link hawktracer to your target
target_link_libraries(your_project hawktracer)

HawkTracer module

If you have HawkTracer installed in your system, you can simply include it to your project:

# include HawkTracer package, version is not required
find_package(HawkTracer 0.5.0 REQUIRED)
# define your target
add_executable(test main.cc)
# link hawktracer to your target
target_link_libraries(test HawkTracer::hawktracer)

The full example can be found in the repository.


HawkTracer package includes a pkg-config file. In order to use it, HawkTracer has to be installed in your system. The simplest usage:

gcc my_file.c $(pkg-config --cflags --libs hawktracer)

If HawkTracer module can't be found, you should set PKG_CONFIG_PATH to a directory which contains hawktracer.pc file (it should be in installation directory, in a share/pkgconfig subdirectory):

export PKG_CONFIG_PATH=/path/to/hawktracer/install_dir/share/pkgconfig
gcc my_file.c $(pkg-config --cflags --libs hawktracer)