cmake_minimum_required(VERSION 3.17) project(foo) add_executable(foo WIN32 foo.cpp) if(DEFINED VCPKG_TARGET_TRIPLET AND WIN32) if(VCPKG_TARGET_TRIPLET MATCHES ".*static.*") set_property(TARGET foo PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() endif() find_package(wxWidgets REQUIRED COMPONENTS core qa html xml aui adv stc webview base) include(${wxWidgets_USE_FILE}) target_link_libraries(foo ${wxWidgets_LIBRARIES})