cgns provides CMake targets: find_package(cgns CONFIG REQUIRED) target_link_libraries(main PRIVATE $,CGNS::cgns_shared,CGNS::cgns_static>)