The package wxwidgets provides CMake integration: find_package(wxWidgets REQUIRED) target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS}) target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES})