Skip to content

Using PhASAR as a Library

Fabian Schiebel edited this page Dec 12, 2023 · 3 revisions

Getting started using PhASAR as a library, first build and install PhASAR as described in the section "Building PhASAR".

To use PhASAR as a library, add

find_package(phasar REQUIRED)
target_link_libraries(yourphasartool PUBLIC phasar)

to your CMakeLists.txt file.

If you only need specific components, use instead

find_package(phasar COMPONENTS component1 component2 REQUIRED)
target_link_libraries(yourphasartool PUBLIC phasar::component1 phasar::component2)

Make sure to replace component1 and component2 with the phasar components that you need and yourphasartool with the cmake target of your phasar-based tool or library. To be able to use PhASAR a C++ standard of 17 is required.

Please refer to the folder use-phasar-as-library for a complete example program.

Clone this wiki locally