casadi provides CMake targets: find_package(casadi CONFIG REQUIRED) target_link_libraries(main PRIVATE $)