The package flecs provides CMake targets: find_package(flecs CONFIG REQUIRED) target_link_libraries(main PRIVATE $,flecs::flecs,flecs::flecs_static>)