mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-12 04:49:00 +08:00
don't build WX if it can't be found
This commit is contained in:
parent
314cc26f27
commit
3af915719d
@ -219,6 +219,7 @@ IF(wxWidgets_FOUND)
|
|||||||
target_compile_features(slic3r_gui PUBLIC cxx_std_11)
|
target_compile_features(slic3r_gui PUBLIC cxx_std_11)
|
||||||
#only build GUI lib if building with wx
|
#only build GUI lib if building with wx
|
||||||
target_link_libraries (slic3r slic3r_gui ${wxWidgets_LIBRARIES})
|
target_link_libraries (slic3r slic3r_gui ${wxWidgets_LIBRARIES})
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_WX")
|
||||||
ELSE(wxWidgets_FOUND)
|
ELSE(wxWidgets_FOUND)
|
||||||
# For convenience. When we cannot continue, inform the user
|
# For convenience. When we cannot continue, inform the user
|
||||||
MESSAGE("wx not found!")
|
MESSAGE("wx not found!")
|
||||||
|
@ -13,7 +13,11 @@
|
|||||||
#include <boost/filesystem.hpp>
|
#include <boost/filesystem.hpp>
|
||||||
#include <boost/nowide/args.hpp>
|
#include <boost/nowide/args.hpp>
|
||||||
#include <boost/nowide/iostream.hpp>
|
#include <boost/nowide/iostream.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef USE_WX
|
||||||
#include "GUI/GUI.hpp"
|
#include "GUI/GUI.hpp"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
using namespace Slic3r;
|
using namespace Slic3r;
|
||||||
@ -41,6 +45,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
DynamicPrintConfig print_config;
|
DynamicPrintConfig print_config;
|
||||||
|
|
||||||
|
#ifdef USE_WX
|
||||||
std::shared_ptr<GUI::Settings> gui_config = std::make_shared<GUI::Settings>();
|
std::shared_ptr<GUI::Settings> gui_config = std::make_shared<GUI::Settings>();
|
||||||
|
|
||||||
GUI::App *gui = new GUI::App(gui_config);
|
GUI::App *gui = new GUI::App(gui_config);
|
||||||
@ -49,7 +54,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
GUI::App::SetInstance(gui);
|
GUI::App::SetInstance(gui);
|
||||||
wxEntry(argc, argv);
|
wxEntry(argc, argv);
|
||||||
|
#endif
|
||||||
// load config files supplied via --load
|
// load config files supplied via --load
|
||||||
for (const std::string &file : cli_config.load.values) {
|
for (const std::string &file : cli_config.load.values) {
|
||||||
if (!boost::filesystem::exists(file)) {
|
if (!boost::filesystem::exists(file)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user