Ptex provides CMake targets: find_package(ptex CONFIG REQUIRED) target_link_libraries(main PRIVATE $,Ptex::Ptex_dynamic,Ptex::Ptex_static>)