don't build WX if it can't be found

This commit is contained in:
Joseph Lenox 2018-05-13 13:37:04 -05:00 committed by Joseph Lenox
parent 314cc26f27
commit 3af915719d
2 changed files with 8 additions and 2 deletions

View File

@ -219,6 +219,7 @@ IF(wxWidgets_FOUND)
target_compile_features(slic3r_gui PUBLIC cxx_std_11)
#only build GUI lib if building with wx
target_link_libraries (slic3r slic3r_gui ${wxWidgets_LIBRARIES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_WX")
ELSE(wxWidgets_FOUND)
# For convenience. When we cannot continue, inform the user
MESSAGE("wx not found!")

View File

@ -13,7 +13,11 @@
#include <boost/filesystem.hpp>
#include <boost/nowide/args.hpp>
#include <boost/nowide/iostream.hpp>
#ifdef USE_WX
#include "GUI/GUI.hpp"
#endif
using namespace Slic3r;
@ -41,6 +45,7 @@ main(int argc, char **argv)
DynamicPrintConfig print_config;
#ifdef USE_WX
std::shared_ptr<GUI::Settings> gui_config = std::make_shared<GUI::Settings>();
GUI::App *gui = new GUI::App(gui_config);
@ -49,7 +54,7 @@ main(int argc, char **argv)
GUI::App::SetInstance(gui);
wxEntry(argc, argv);
#endif
// load config files supplied via --load
for (const std::string &file : cli_config.load.values) {
if (!boost::filesystem::exists(file)) {