diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ce9ef27b930..3e9d76f165a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,14 +36,21 @@ if (SLIC3R_GUI) find_package(wxWidgets 3.1 REQUIRED COMPONENTS base core adv html gl aui net media webview) endif () else () - find_package(wxWidgets 3.1 REQUIRED COMPONENTS html adv gl core base webview aui net media) + # wxWidgets 3.3 ships CMake config files; use CONFIG mode so wxWidgets_DIR + # is honored. The legacy FindwxWidgets module ignores wxWidgets_DIR and + # only probes WXWIN/wx-config, which is unset on the Windows builder. + find_package(wxWidgets 3.3 CONFIG REQUIRED COMPONENTS html adv gl core base webview aui net media) endif () if(UNIX) message(STATUS "wx-config path: ${wxWidgets_CONFIG_EXECUTABLE}") endif() - include(${wxWidgets_USE_FILE}) + # CONFIG mode (Windows, wx 3.3) does not set wxWidgets_USE_FILE; only the + # legacy module mode (Linux wx-config) does. Guard the include accordingly. + if(wxWidgets_USE_FILE) + include(${wxWidgets_USE_FILE}) + endif() find_package(JPEG QUIET)