Merged branch 'dev_native' into lm_sla_supports_auto

Added igl library files
This commit is contained in:
Lukas Matena 2018-10-26 15:45:52 +02:00
commit 7681d00ee5
2865 changed files with 142806 additions and 22325 deletions

View file

@ -30,20 +30,7 @@ my %recommends = qw(
);
my $sudo = grep { $_ eq '--sudo' } @ARGV;
my $gui = grep { $_ eq '--gui' } @ARGV;
my $nolocal = grep { $_ eq '--nolocal' } @ARGV;
if ($gui) {
%prereqs = qw(
Class::Accessor 0
Wx 0.9918
);
%recommends = qw(
Wx::GLCanvas 0
);
if ($^O eq 'MSWin32') {
$recommends{"Win32::TieRegistry"} = 0;
}
}
my @missing_prereqs = ();
if ($ENV{SLIC3R_NO_AUTO}) {
@ -129,13 +116,6 @@ EOF
}
}
print "\n";
if ($gui) {
print "Perl dependencies for the Slic3r GUI were installed.\n";
} else {
print "Perl dependencies for Slic3r were installed.\n";
print "If you also want to use the GUI you can now run `perl Build.PL --gui` to install the required modules.\n";
}
print "\n";
print "In the next step, you need to build the Slic3r C++ library.\n";
print "1) Create a build directory and change to it\n";

View file

@ -1,6 +1,9 @@
project(Slic3r)
cmake_minimum_required(VERSION 3.2)
project(Slic3r)
include("version.inc")
set(SLIC3R_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources")
file(TO_NATIVE_PATH "${SLIC3R_RESOURCES_DIR}" SLIC3R_RESOURCES_DIR_WIN)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "No build type selected, default to Release")
@ -19,36 +22,15 @@ endif()
option(SLIC3R_STATIC "Compile Slic3r with static libraries (Boost, TBB, glew)" ${SLIC3R_STATIC_INITIAL})
option(SLIC3R_GUI "Compile Slic3r with GUI components (OpenGL, wxWidgets)" 1)
option(SLIC3R_PRUSACONTROL "Compile Slic3r with the PrusaControl prject file format (requires wxWidgets base library)" 1)
option(SLIC3R_PROFILE "Compile Slic3r with an invasive Shiny profiler" 0)
option(SLIC3R_MSVC_COMPILE_PARALLEL "Compile on Visual Studio in parallel" 1)
option(SLIC3R_MSVC_PDB "Generate PDB files on MSVC in Release mode" 1)
option(SLIC3R_PERL_XS "Compile XS Perl module and enable Perl unit and integration tests" 0)
if (MSVC AND SLIC3R_MSVC_COMPILE_PARALLEL)
add_compile_options(/MP)
endif ()
# Find the Perl interpreter, add local-lib to PATH and PERL5LIB environment variables,
# so the locally installed modules (mainly the Alien::wxPerl) will be reached.
if (WIN32)
set(ENV_PATH_SEPARATOR ";")
else()
set(ENV_PATH_SEPARATOR ":")
endif()
set(ENV{PATH} "${PROJECT_SOURCE_DIR}/local-lib/bin${ENV_PATH_SEPARATOR}$ENV{PATH}")
set(PERL_INCLUDE "${PROJECT_SOURCE_DIR}/local-lib/lib/perl5${ENV_PATH_SEPARATOR}$ENV{PERL5LIB}")
message("PATH: $ENV{PATH}")
message("PERL_INCLUDE: ${PERL_INCLUDE}")
find_package(Perl REQUIRED)
if (WIN32)
# On Windows passing the PERL5LIB variable causes various problems (such as with MAX_PATH and others),
# basically I've found no good way to do it on Windows.
set(PERL5LIB_ENV_CMD "")
else()
set(PERL5LIB_ENV_CMD ${CMAKE_COMMAND} -E env PERL5LIB=${PERL_INCLUDE})
endif()
# CMAKE_PREFIX_PATH is used to point CMake to the remaining dependencies (Boost, TBB, ...)
# We pick it from environment if it is not defined in another way
if(NOT DEFINED CMAKE_PREFIX_PATH)
@ -57,8 +39,21 @@ if(NOT DEFINED CMAKE_PREFIX_PATH)
endif()
endif()
# Add our own cmake module path.
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/modules/)
enable_testing ()
# Enable C++11 language standard.
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
# To be able to link libslic3r with the Perl XS module.
# Once we get rid of Perl and libslic3r is linked statically, we can get rid of -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# WIN10SDK_PATH is used to point CMake to the WIN10 SDK installation directory.
# We pick it from environment if it is not defined in another way
if(WIN32)
@ -75,26 +70,174 @@ if(WIN32)
endif()
endif()
add_subdirectory(xs)
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# Workaround for an old CMake, which does not understand CMAKE_CXX_STANDARD.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-reorder" )
find_package(PkgConfig REQUIRED)
endif()
get_filename_component(PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY)
if (MSVC)
# By default the startup project in MSVC is the 'ALL_BUILD' cmake-created project,
# but we want 'slic3r' as the startup one because debugging run command is associated with it.
# (Unfortunatelly it cannot be associated with ALL_BUILD using CMake.)
# Note: For some reason this needs to be set in the top-level CMakeLists.txt
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT XS)
set(PERL_PROVE "${PERL_BIN_PATH}/prove.bat")
else ()
set(PERL_PROVE "${PERL_BIN_PATH}/prove")
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
# Adding -fext-numeric-literals to enable GCC extensions on definitions of quad float literals, which are required by Boost.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fext-numeric-literals" )
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=return-type" )
endif()
# Where all the bundled libraries reside?
set(LIBDIR ${CMAKE_CURRENT_SOURCE_DIR}/src/)
# For the bundled boost libraries (boost::nowide)
include_directories(${LIBDIR})
# For libslic3r.h
include_directories(${LIBDIR}/libslic3r ${LIBDIR}/clipper ${LIBDIR}/polypartition)
#set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(WIN32)
# BOOST_ALL_NO_LIB: Avoid the automatic linking of Boost libraries on Windows. Rather rely on explicit linking.
add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -DBOOST_ALL_NO_LIB -DBOOST_USE_WINAPI_VERSION=0x601 -D_CRT_SECURE_NO_WARNINGS)
endif()
add_definitions(-DwxUSE_UNICODE -D_UNICODE -DUNICODE -DWXINTL_NO_GETTEXT_MACRO)
if (SLIC3R_PROFILE)
message("Slic3r will be built with a Shiny invasive profiler")
add_definitions(-DSLIC3R_PROFILE)
endif ()
add_test (NAME xs COMMAND "${PERL_EXECUTABLE}" ${PERL_PROVE} -I ${PROJECT_SOURCE_DIR}/local-lib/lib/perl5 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/xs)
add_test (NAME integration COMMAND "${PERL_EXECUTABLE}" ${PERL_PROVE} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
# Disable optimization even with debugging on.
if (0)
message(STATUS "Perl compiled without optimization. Disabling optimization for the Slic3r build.")
message("Old CMAKE_CXX_FLAGS_RELEASE: ${CMAKE_CXX_FLAGS_RELEASE}")
message("Old CMAKE_CXX_FLAGS_RELWITHDEBINFO: ${CMAKE_CXX_FLAGS_RELEASE}")
message("Old CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASE "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_C_FLAGS_RELEASE "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_CXX_FLAGS "/MD /Od /Zi /EHsc /DWIN32 /DTBB_USE_ASSERT")
set(CMAKE_C_FLAGS "/MD /Od /Zi /DWIN32 /DTBB_USE_ASSERT")
endif()
install(PROGRAMS slic3r.pl DESTINATION bin RENAME slic3r-prusa3d)
# Find and configure boost
if(SLIC3R_STATIC)
# Use static boost libraries.
set(Boost_USE_STATIC_LIBS ON)
# Use boost libraries linked statically to the C++ runtime.
# set(Boost_USE_STATIC_RUNTIME ON)
endif()
#set(Boost_DEBUG ON)
find_package(Boost REQUIRED COMPONENTS system filesystem thread log locale regex)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
if (APPLE)
# BOOST_ASIO_DISABLE_KQUEUE : prevents a Boost ASIO bug on OS X: https://svn.boost.org/trac/boost/ticket/5339
add_definitions(-DBOOST_ASIO_DISABLE_KQUEUE)
endif()
if(NOT SLIC3R_STATIC)
add_definitions(-DBOOST_LOG_DYN_LINK)
endif()
endif()
# Find and configure intel-tbb
if(SLIC3R_STATIC)
set(TBB_STATIC 1)
endif()
set(TBB_DEBUG 1)
find_package(TBB REQUIRED)
include_directories(${TBB_INCLUDE_DIRS})
add_definitions(${TBB_DEFINITIONS})
if(MSVC)
# Suppress implicit linking of the TBB libraries by the Visual Studio compiler.
add_definitions(-D__TBB_NO_IMPLICIT_LINKAGE)
endif()
# The Intel TBB library will use the std::exception_ptr feature of C++11.
add_definitions(-DTBB_USE_CAPTURED_EXCEPTION=0)
#set(CURL_DEBUG 1)
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIRS})
if (SLIC3R_STATIC)
if (NOT APPLE)
# libcurl is always linked dynamically to the system libcurl on OSX.
# On other systems, libcurl is linked statically if SLIC3R_STATIC is set.
add_definitions(-DCURL_STATICLIB)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# As of now, our build system produces a statically linked libcurl,
# which links the OpenSSL library dynamically.
find_package(OpenSSL REQUIRED)
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
endif()
## OPTIONAL packages
# Find eigen3 or use bundled version
if (NOT SLIC3R_STATIC)
find_package(Eigen3)
endif ()
if (NOT Eigen3_FOUND)
set(Eigen3_FOUND 1)
set(EIGEN3_INCLUDE_DIR ${LIBDIR}/eigen/)
endif ()
include_directories(${EIGEN3_INCLUDE_DIR})
# Find expat or use bundled version
# Always use the system libexpat on Linux.
if (NOT SLIC3R_STATIC OR CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(EXPAT)
endif ()
if (NOT EXPAT_FOUND)
add_library(expat STATIC
${LIBDIR}/expat/xmlparse.c
${LIBDIR}/expat/xmlrole.c
${LIBDIR}/expat/xmltok.c
)
set(EXPAT_FOUND 1)
set(EXPAT_INCLUDE_DIRS ${LIBDIR}/expat/)
set(EXPAT_LIBRARIES expat)
endif ()
include_directories(${EXPAT_INCLUDE_DIRS})
# Find glew or use bundled version
if (NOT SLIC3R_STATIC)
find_package(GLEW)
endif ()
if (NOT GLEW_FOUND)
add_library(glew STATIC ${LIBDIR}/glew/src/glew.c)
set(GLEW_FOUND 1)
set(GLEW_INCLUDE_DIRS ${LIBDIR}/glew/include/)
set(GLEW_LIBRARIES glew)
add_definitions(-DGLEW_STATIC)
endif ()
include_directories(${GLEW_INCLUDE_DIRS})
# l10n
set(L10N_DIR "${SLIC3R_RESOURCES_DIR}/localization")
add_custom_target(pot
# FIXME: file list stale
COMMAND xgettext --keyword=L --from-code=UTF-8 --debug
-f "${L10N_DIR}/list.txt"
-o "${L10N_DIR}/Slic3rPE.pot"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate pot file from strings in the source tree"
)
# libslic3r, Slic3r GUI and the slic3r executable.
add_subdirectory(src)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT slic3r)
# Perl bindings, currently only used for the unit / integration tests of libslic3r.
# Also runs the unit / integration tests.
#FIXME Port the tests into C++ to finally get rid of the Perl!
if (SLIC3R_PERL_XS)
add_subdirectory(xs)
endif ()
file(GLOB MyVar var/*.png)
install(FILES ${MyVar} DESTINATION share/slic3r-prusa3d)
install(FILES lib/Slic3r.pm DESTINATION lib/slic3r-prusa3d)
install(DIRECTORY lib/Slic3r DESTINATION lib/slic3r-prusa3d)

View file

@ -5,34 +5,62 @@
# FindCURL
# --------
#
# Find curl
#
# Find the native CURL headers and libraries.
#
# ::
# IMPORTED Targets
# ^^^^^^^^^^^^^^^^
#
# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc.
# CURL_LIBRARIES - List of libraries when using curl.
# CURL_FOUND - True if curl found.
# CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8)
# This module defines :prop_tgt:`IMPORTED` target ``CURL::libcurl``, if
# curl has been found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ``CURL_FOUND``
# True if curl found.
#
# ``CURL_INCLUDE_DIRS``
# where to find curl/curl.h, etc.
#
# ``CURL_LIBRARIES``
# List of libraries when using curl.
#
# ``CURL_VERSION_STRING``
# The version of curl found.
# Look for the header file.
find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
mark_as_advanced(CURL_INCLUDE_DIR)
# Look for the library (sorted from most current/relevant entry to least).
find_library(CURL_LIBRARY NAMES
curl
# Windows MSVC Makefile:
libcurl_a
# Windows MSVC prebuilts:
curllib
libcurl_imp
curllib_static
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
libcurl
)
mark_as_advanced(CURL_LIBRARY)
if(NOT CURL_LIBRARY)
# Look for the library (sorted from most current/relevant entry to least).
find_library(CURL_LIBRARY_RELEASE NAMES
curl
# Windows MSVC prebuilts:
curllib
libcurl_imp
curllib_static
# Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
libcurl
# Static library on Windows
libcurl_a
)
mark_as_advanced(CURL_LIBRARY_RELEASE)
find_library(CURL_LIBRARY_DEBUG NAMES
# Windows MSVC CMake builds in debug configuration on vcpkg:
libcurl-d_imp
libcurl-d
# Static library on Windows, compiled in debug mode
libcurl_a_debug
)
mark_as_advanced(CURL_LIBRARY_DEBUG)
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations_SLIC3R.cmake)
select_library_configurations_SLIC3R(CURL)
endif()
if(CURL_INCLUDE_DIR)
foreach(_curl_version_header curlver.h curl.h)
@ -46,7 +74,8 @@ if(CURL_INCLUDE_DIR)
endforeach()
endif()
find_package_handle_standard_args(CURL
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs_SLIC3R.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS_SLIC3R(CURL
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
VERSION_VAR CURL_VERSION_STRING)
@ -54,6 +83,29 @@ if(CURL_FOUND)
set(CURL_LIBRARIES ${CURL_LIBRARY})
set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
message(STATUS " Curl libraries: = ${CURL_LIBRARIES}")
message(STATUS " Curl include dirs: = ${CURL_INCLUDE_DIRS}")
if(NOT TARGET CURL::libcurl)
add_library(CURL::libcurl UNKNOWN IMPORTED)
set_target_properties(CURL::libcurl PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}")
if(EXISTS "${CURL_LIBRARY}")
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${CURL_LIBRARY}")
endif()
if(CURL_LIBRARY_RELEASE)
set_property(TARGET CURL::libcurl APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION_RELEASE "${CURL_LIBRARY_RELEASE}")
endif()
if(CURL_LIBRARY_DEBUG)
set_property(TARGET CURL::libcurl APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(CURL::libcurl PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}")
endif()
endif()
endif()

View file

@ -0,0 +1,392 @@
# Modified from the CMake github master,
# required by the bundled FindCURL.cmake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#[=======================================================================[.rst:
FindPackageHandleStandardArgs
-----------------------------
This module provides a function intended to be used in :ref:`Find Modules`
implementing :command:`find_package(<PackageName>)` calls. It handles the
``REQUIRED``, ``QUIET`` and version-related arguments of ``find_package``.
It also sets the ``<PackageName>_FOUND`` variable. The package is
considered found if all variables listed contain valid results, e.g.
valid filepaths.
.. command:: find_package_handle_standard_args
There are two signatures::
find_package_handle_standard_args(<PackageName>
(DEFAULT_MSG|<custom-failure-message>)
<required-var>...
)
find_package_handle_standard_args(<PackageName>
[FOUND_VAR <result-var>]
[REQUIRED_VARS <required-var>...]
[VERSION_VAR <version-var>]
[HANDLE_COMPONENTS]
[CONFIG_MODE]
[FAIL_MESSAGE <custom-failure-message>]
)
The ``<PackageName>_FOUND`` variable will be set to ``TRUE`` if all
the variables ``<required-var>...`` are valid and any optional
constraints are satisfied, and ``FALSE`` otherwise. A success or
failure message may be displayed based on the results and on
whether the ``REQUIRED`` and/or ``QUIET`` option was given to
the :command:`find_package` call.
The options are:
``(DEFAULT_MSG|<custom-failure-message>)``
In the simple signature this specifies the failure message.
Use ``DEFAULT_MSG`` to ask for a default message to be computed
(recommended). Not valid in the full signature.
``FOUND_VAR <result-var>``
Obsolete. Specifies either ``<PackageName>_FOUND`` or
``<PACKAGENAME>_FOUND`` as the result variable. This exists only
for compatibility with older versions of CMake and is now ignored.
Result variables of both names are always set for compatibility.
``REQUIRED_VARS <required-var>...``
Specify the variables which are required for this package.
These may be named in the generated failure message asking the
user to set the missing variable values. Therefore these should
typically be cache entries such as ``FOO_LIBRARY`` and not output
variables like ``FOO_LIBRARIES``.
``VERSION_VAR <version-var>``
Specify the name of a variable that holds the version of the package
that has been found. This version will be checked against the
(potentially) specified required version given to the
:command:`find_package` call, including its ``EXACT`` option.
The default messages include information about the required
version and the version which has been actually found, both
if the version is ok or not.
``HANDLE_COMPONENTS``
Enable handling of package components. In this case, the command
will report which components have been found and which are missing,
and the ``<PackageName>_FOUND`` variable will be set to ``FALSE``
if any of the required components (i.e. not the ones listed after
the ``OPTIONAL_COMPONENTS`` option of :command:`find_package`) are
missing.
``CONFIG_MODE``
Specify that the calling find module is a wrapper around a
call to ``find_package(<PackageName> NO_MODULE)``. This implies
a ``VERSION_VAR`` value of ``<PackageName>_VERSION``. The command
will automatically check whether the package configuration file
was found.
``FAIL_MESSAGE <custom-failure-message>``
Specify a custom failure message instead of using the default
generated message. Not recommended.
Example for the simple signature:
.. code-block:: cmake
find_package_handle_standard_args(LibXml2 DEFAULT_MSG
LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
The ``LibXml2`` package is considered to be found if both
``LIBXML2_LIBRARY`` and ``LIBXML2_INCLUDE_DIR`` are valid.
Then also ``LibXml2_FOUND`` is set to ``TRUE``. If it is not found
and ``REQUIRED`` was used, it fails with a
:command:`message(FATAL_ERROR)`, independent whether ``QUIET`` was
used or not. If it is found, success will be reported, including
the content of the first ``<required-var>``. On repeated CMake runs,
the same message will not be printed again.
Example for the full signature:
.. code-block:: cmake
find_package_handle_standard_args(LibArchive
REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
VERSION_VAR LibArchive_VERSION)
In this case, the ``LibArchive`` package is considered to be found if
both ``LibArchive_LIBRARY`` and ``LibArchive_INCLUDE_DIR`` are valid.
Also the version of ``LibArchive`` will be checked by using the version
contained in ``LibArchive_VERSION``. Since no ``FAIL_MESSAGE`` is given,
the default messages will be printed.
Another example for the full signature:
.. code-block:: cmake
find_package(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
find_package_handle_standard_args(Automoc4 CONFIG_MODE)
In this case, a ``FindAutmoc4.cmake`` module wraps a call to
``find_package(Automoc4 NO_MODULE)`` and adds an additional search
directory for ``automoc4``. Then the call to
``find_package_handle_standard_args`` produces a proper success/failure
message.
#]=======================================================================]
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageMessage_SLIC3R.cmake)
# internal helper macro
macro(_FPHSA_FAILURE_MESSAGE _msg)
if (${_NAME}_FIND_REQUIRED)
message(FATAL_ERROR "${_msg}")
else ()
if (NOT ${_NAME}_FIND_QUIETLY)
message(STATUS "${_msg}")
endif ()
endif ()
endmacro()
# internal helper macro to generate the failure message when used in CONFIG_MODE:
macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
# <PackageName>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
if(${_NAME}_CONFIG)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing:${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
else()
# If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
# List them all in the error message:
if(${_NAME}_CONSIDERED_CONFIGS)
set(configsText "")
list(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
math(EXPR configsCount "${configsCount} - 1")
foreach(currentConfigIndex RANGE ${configsCount})
list(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
string(APPEND configsText " ${filename} (version ${version})\n")
endforeach()
if (${_NAME}_NOT_FOUND_MESSAGE)
string(APPEND configsText " Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
else()
# Simple case: No Config-file was found at all:
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
endif()
endif()
endmacro()
function(FIND_PACKAGE_HANDLE_STANDARD_ARGS_SLIC3R _NAME _FIRST_ARG)
# Set up the arguments for `cmake_parse_arguments`.
set(options CONFIG_MODE HANDLE_COMPONENTS)
set(oneValueArgs FAIL_MESSAGE VERSION_VAR FOUND_VAR)
set(multiValueArgs REQUIRED_VARS)
# Check whether we are in 'simple' or 'extended' mode:
set(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
list(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
if(${INDEX} EQUAL -1)
set(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
set(FPHSA_REQUIRED_VARS ${ARGN})
set(FPHSA_VERSION_VAR)
else()
cmake_parse_arguments(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
if(FPHSA_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT FPHSA_FAIL_MESSAGE)
set(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
endif()
# In config-mode, we rely on the variable <PackageName>_CONFIG, which is set by find_package()
# when it successfully found the config-file, including version checking:
if(FPHSA_CONFIG_MODE)
list(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
list(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
set(FPHSA_VERSION_VAR ${_NAME}_VERSION)
endif()
if(NOT FPHSA_REQUIRED_VARS)
message(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
endif()
endif()
# now that we collected all arguments, process them
if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG")
set(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
endif()
list(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
string(TOUPPER ${_NAME} _NAME_UPPER)
string(TOLOWER ${_NAME} _NAME_LOWER)
if(FPHSA_FOUND_VAR)
if(FPHSA_FOUND_VAR MATCHES "^${_NAME}_FOUND$" OR FPHSA_FOUND_VAR MATCHES "^${_NAME_UPPER}_FOUND$")
set(_FOUND_VAR ${FPHSA_FOUND_VAR})
else()
message(FATAL_ERROR "The argument for FOUND_VAR is \"${FPHSA_FOUND_VAR}\", but only \"${_NAME}_FOUND\" and \"${_NAME_UPPER}_FOUND\" are valid names.")
endif()
else()
set(_FOUND_VAR ${_NAME_UPPER}_FOUND)
endif()
# collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
set(MISSING_VARS "")
set(DETAILS "")
# check if all passed variables are valid
set(FPHSA_FOUND_${_NAME} TRUE)
foreach(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
if(NOT ${_CURRENT_VAR})
set(FPHSA_FOUND_${_NAME} FALSE)
string(APPEND MISSING_VARS " ${_CURRENT_VAR}")
else()
string(APPEND DETAILS "[${${_CURRENT_VAR}}]")
endif()
endforeach()
if(FPHSA_FOUND_${_NAME})
set(${_NAME}_FOUND TRUE)
set(${_NAME_UPPER}_FOUND TRUE)
else()
set(${_NAME}_FOUND FALSE)
set(${_NAME_UPPER}_FOUND FALSE)
endif()
# component handling
unset(FOUND_COMPONENTS_MSG)
unset(MISSING_COMPONENTS_MSG)
if(FPHSA_HANDLE_COMPONENTS)
foreach(comp ${${_NAME}_FIND_COMPONENTS})
if(${_NAME}_${comp}_FOUND)
if(NOT DEFINED FOUND_COMPONENTS_MSG)
set(FOUND_COMPONENTS_MSG "found components: ")
endif()
string(APPEND FOUND_COMPONENTS_MSG " ${comp}")
else()
if(NOT DEFINED MISSING_COMPONENTS_MSG)
set(MISSING_COMPONENTS_MSG "missing components: ")
endif()
string(APPEND MISSING_COMPONENTS_MSG " ${comp}")
if(${_NAME}_FIND_REQUIRED_${comp})
set(${_NAME}_FOUND FALSE)
string(APPEND MISSING_VARS " ${comp}")
endif()
endif()
endforeach()
set(COMPONENT_MSG "${FOUND_COMPONENTS_MSG} ${MISSING_COMPONENTS_MSG}")
string(APPEND DETAILS "[c${COMPONENT_MSG}]")
endif()
# version handling:
set(VERSION_MSG "")
set(VERSION_OK TRUE)
# check with DEFINED here as the requested or found version may be "0"
if (DEFINED ${_NAME}_FIND_VERSION)
if(DEFINED ${FPHSA_VERSION_VAR})
set(_FOUND_VERSION ${${FPHSA_VERSION_VAR}})
if(${_NAME}_FIND_VERSION_EXACT) # exact version required
# count the dots in the version string
string(REGEX REPLACE "[^.]" "" _VERSION_DOTS "${_FOUND_VERSION}")
# add one dot because there is one dot more than there are components
string(LENGTH "${_VERSION_DOTS}." _VERSION_DOTS)
if (_VERSION_DOTS GREATER ${_NAME}_FIND_VERSION_COUNT)
# Because of the C++ implementation of find_package() ${_NAME}_FIND_VERSION_COUNT
# is at most 4 here. Therefore a simple lookup table is used.
if (${_NAME}_FIND_VERSION_COUNT EQUAL 1)
set(_VERSION_REGEX "[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 2)
set(_VERSION_REGEX "[^.]*\\.[^.]*")
elseif (${_NAME}_FIND_VERSION_COUNT EQUAL 3)
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*")
else ()
set(_VERSION_REGEX "[^.]*\\.[^.]*\\.[^.]*\\.[^.]*")
endif ()
string(REGEX REPLACE "^(${_VERSION_REGEX})\\..*" "\\1" _VERSION_HEAD "${_FOUND_VERSION}")
unset(_VERSION_REGEX)
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _VERSION_HEAD)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")")
endif ()
unset(_VERSION_HEAD)
else ()
if (NOT ${_NAME}_FIND_VERSION VERSION_EQUAL _FOUND_VERSION)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable exact version \"${_FOUND_VERSION}\")")
endif ()
endif ()
unset(_VERSION_DOTS)
else() # minimum version specified:
if (${_NAME}_FIND_VERSION VERSION_GREATER _FOUND_VERSION)
set(VERSION_MSG "Found unsuitable version \"${_FOUND_VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
set(VERSION_MSG "(found suitable version \"${_FOUND_VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
endif ()
endif()
else()
# if the package was not found, but a version was given, add that to the output:
if(${_NAME}_FIND_VERSION_EXACT)
set(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
else()
set(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
endif()
endif()
else ()
# Check with DEFINED as the found version may be 0.
if(DEFINED ${FPHSA_VERSION_VAR})
set(VERSION_MSG "(found version \"${${FPHSA_VERSION_VAR}}\")")
endif()
endif ()
if(VERSION_OK)
string(APPEND DETAILS "[v${${FPHSA_VERSION_VAR}}(${${_NAME}_FIND_VERSION})]")
else()
set(${_NAME}_FOUND FALSE)
endif()
# print the result:
if (${_NAME}_FOUND)
FIND_PACKAGE_MESSAGE_SLIC3R(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG} ${COMPONENT_MSG}" "${DETAILS}")
else ()
if(FPHSA_CONFIG_MODE)
_FPHSA_HANDLE_FAILURE_CONFIG_MODE()
else()
if(NOT VERSION_OK)
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
else()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing:${MISSING_VARS}) ${VERSION_MSG}")
endif()
endif()
endif ()
set(${_NAME}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
set(${_NAME_UPPER}_FOUND ${${_NAME}_FOUND} PARENT_SCOPE)
endfunction()

View file

@ -0,0 +1,54 @@
# Modified from the CMake github master.
# required by the bundled FindCURL.cmake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindPackageMessage
# ------------------
#
#
#
# FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
#
# This macro is intended to be used in FindXXX.cmake modules files. It
# will print a message once for each unique find result. This is useful
# for telling the user where a package was found. The first argument
# specifies the name (XXX) of the package. The second argument
# specifies the message to display. The third argument lists details
# about the find result so that if they change the message will be
# displayed again. The macro also obeys the QUIET argument to the
# find_package command.
#
# Example:
#
# ::
#
# if(X11_FOUND)
# FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
# "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
# else()
# ...
# endif()
function(FIND_PACKAGE_MESSAGE_SLIC3R pkg msg details)
# Avoid printing a message repeatedly for the same find result.
if(NOT ${pkg}_FIND_QUIETLY)
string(REPLACE "\n" "" details "${details}")
set(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
if(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
# The message has not yet been printed.
message(STATUS "${msg}")
# Save the find details in the cache to avoid printing the same
# message again.
set("${DETAILS_VAR}" "${details}"
CACHE INTERNAL "Details about finding ${pkg}")
endif()
endif()
endfunction()

View file

@ -280,7 +280,7 @@ if(NOT TBB_FOUND)
##################################
if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
add_library(tbb SHARED IMPORTED)
add_library(tbb UNKNOWN IMPORTED)
set_target_properties(tbb PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS}
IMPORTED_LOCATION ${TBB_LIBRARIES})
@ -288,7 +288,7 @@ if(NOT TBB_FOUND)
set_target_properties(tbb PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "$<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:TBB_USE_DEBUG=1>"
IMPORTED_LOCATION_DEBUG ${TBB_LIBRARIES_DEBUG}
IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_DEBUG}
IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_RELEASE}
IMPORTED_LOCATION_RELEASE ${TBB_LIBRARIES_RELEASE}
IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE}
)
@ -310,6 +310,7 @@ if(NOT TBB_FOUND)
unset(TBB_DEFAULT_SEARCH_DIR)
if(TBB_DEBUG)
message(STATUS " TBB_FOUND = ${TBB_FOUND}")
message(STATUS " TBB_INCLUDE_DIRS = ${TBB_INCLUDE_DIRS}")
message(STATUS " TBB_DEFINITIONS = ${TBB_DEFINITIONS}")
message(STATUS " TBB_LIBRARIES = ${TBB_LIBRARIES}")

View file

@ -0,0 +1,77 @@
# Modified from the CMake github master.
# required by the bundled FindCURL.cmake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# SelectLibraryConfigurations
# ---------------------------
#
#
#
# select_library_configurations( basename )
#
# This macro takes a library base name as an argument, and will choose
# good values for basename_LIBRARY, basename_LIBRARIES,
# basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
# has been found and set. If only basename_LIBRARY_RELEASE is defined,
# basename_LIBRARY will be set to the release value, and
# basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG-NOTFOUND.
# If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
# take the debug value, and basename_LIBRARY_RELEASE will be set to
# basename_LIBRARY_RELEASE-NOTFOUND.
#
# If the generator supports configuration types, then basename_LIBRARY
# and basename_LIBRARIES will be set with debug and optimized flags
# specifying the library to be used for the given configuration. If no
# build type has been set or the generator in use does not support
# configuration types, then basename_LIBRARY and basename_LIBRARIES will
# take only the release value, or the debug value if the release one is
# not set.
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
# Dicharry <wdicharry@stellarscience.com>.
macro( select_library_configurations_SLIC3R basename )
if(NOT ${basename}_LIBRARY_RELEASE)
set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
if(NOT ${basename}_LIBRARY_DEBUG)
set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
endif()
get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
( _isMultiConfig OR CMAKE_BUILD_TYPE ) )
# if the generator is multi-config or if CMAKE_BUILD_TYPE is set for
# single-config generators, set optimized and debug libraries
set( ${basename}_LIBRARY "" )
foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
endforeach()
foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
list( APPEND ${basename}_LIBRARY debug "${_libname}" )
endforeach()
elseif( ${basename}_LIBRARY_RELEASE )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
elseif( ${basename}_LIBRARY_DEBUG )
set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
else()
set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
endif()
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
if( ${basename}_LIBRARY )
set( ${basename}_FOUND TRUE )
endif()
mark_as_advanced( ${basename}_LIBRARY_RELEASE
${basename}_LIBRARY_DEBUG
)
endmacro()

55
deps/CMakeLists.txt vendored Normal file
View file

@ -0,0 +1,55 @@
#
# This CMake project downloads, configures and builds Slic3r PE dependencies on Unix and Windows.
#
# When using this script, it's recommended to perform an out-of-source build using CMake.
#
# All the dependencies are installed in a `destdir` directory in the root of the build directory,
# in a traditional Unix-style prefix structure. The destdir can be used directly by CMake
# when building Slic3r - to do this, set the CMAKE_PREFIX_PATH to ${destdir}/usr/local.
#
# For better clarity of console output, it's recommended to _not_ use a parallelized build
# for the top-level command, ie. use `make -j 1` or `ninja -j 1` to force single-threaded top-level
# build. This doesn't degrade performance as individual dependencies are built in parallel fashion
# if supported by the dependency.
#
# On Windows, architecture (64 vs 32 bits) is judged based on the compiler variant.
# To build dependencies for either 64 or 32 bit OS, use the respective compiler command line.
#
project(Slic3r-deps)
cmake_minimum_required(VERSION 3.2)
include(ExternalProject)
include(ProcessorCount)
ProcessorCount(NPROC)
if (NPROC EQUAL 0)
set(NPROC 1)
endif ()
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
option(DEP_DEBUG "Build debug variants (currently only works on Windows)" ON)
if (MSVC)
if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
message(STATUS "\nDetected 64-bit compiler => building 64-bit deps bundle\n")
set(DEPS_BITS 64)
include("deps-windows.cmake")
elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
message(STATUS "\nDetected 32-bit compiler => building 32-bit deps bundle\n")
set(DEPS_BITS 32)
include("deps-windows.cmake")
else ()
message(FATAL_ERROR "Unable to detect architecture")
endif ()
else ()
include("deps-unix-static.cmake")
endif()
add_custom_target(deps ALL
DEPENDS dep_boost dep_tbb dep_libcurl dep_wxwidgets
)
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands
# because they seem to generate bogus build files (possibly a bug in ExternalProject).

168
deps/deps-unix-static.cmake vendored Normal file
View file

@ -0,0 +1,168 @@
ExternalProject_Add(dep_boost
EXCLUDE_FROM_ALL 1
URL "https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz"
URL_HASH SHA256=bd0df411efd9a585e5a2212275f8762079fed8842264954675a4fddc46cfcf60
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./bootstrap.sh
--with-libraries=system,filesystem,thread,log,locale,regex
"--prefix=${DESTDIR}/usr/local"
BUILD_COMMAND ./b2
-j ${NPROC}
link=static
variant=release
threading=multi
boost.locale.icu=off
cxxflags=-fPIC cflags=-fPIC
install
INSTALL_COMMAND "" # b2 does that already
)
ExternalProject_Add(dep_tbb
EXCLUDE_FROM_ALL 1
URL "https://github.com/wjakob/tbb/archive/a0dc9bf76d0120f917b641ed095360448cabc85b.tar.gz"
URL_HASH SHA256=0545cb6033bd1873fcae3ea304def720a380a88292726943ae3b9b207f322efe
CMAKE_ARGS -DTBB_BUILD_SHARED=OFF
-DTBB_BUILD_TESTS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
)
ExternalProject_Add(dep_gtest
EXCLUDE_FROM_ALL 1
URL "https://github.com/google/googletest/archive/release-1.8.1.tar.gz"
URL_HASH SHA256=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c
CMAKE_ARGS -DBUILD_GMOCK=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
)
ExternalProject_Add(dep_nlopt
EXCLUDE_FROM_ALL 1
URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DNLOPT_PYTHON=OFF
-DNLOPT_OCTAVE=OFF
-DNLOPT_MATLAB=OFF
-DNLOPT_GUILE=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
INSTALL_COMMAND ""
)
ExternalProject_Add(dep_zlib
EXCLUDE_FROM_ALL 1
URL "https://zlib.net/zlib-1.2.11.tar.xz"
URL_HASH SHA256=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
INSTALL_COMMAND ""
)
ExternalProject_Add(dep_libpng
DEPENDS dep_zlib
EXCLUDE_FROM_ALL 1
URL "http://prdownloads.sourceforge.net/libpng/libpng-1.6.35.tar.xz?download"
URL_HASH SHA256=23912ec8c9584917ed9b09c5023465d71709dce089be503c7867fec68a93bcd7
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DPNG_SHARED=OFF
-DPNG_TESTS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
INSTALL_COMMAND ""
)
ExternalProject_Add(dep_libopenssl
EXCLUDE_FROM_ALL 1
URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0g.tar.gz"
URL_HASH SHA256=8e9516b8635bb9113c51a7b5b27f9027692a56b104e75b709e588c3ffd6a0422
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./config
"--prefix=${DESTDIR}/usr/local"
no-shared
no-ssl3-method
no-dynamic-engine
-Wa,--noexecstack
BUILD_COMMAND make depend && make "-j${NPROC}"
INSTALL_COMMAND make install_sw
)
ExternalProject_Add(dep_libcurl
EXCLUDE_FROM_ALL 1
DEPENDS dep_libopenssl
URL "https://curl.haxx.se/download/curl-7.58.0.tar.gz"
URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./configure
--enable-static
--disable-shared
"--with-ssl=${DESTDIR}/usr/local"
--with-pic
--enable-ipv6
--enable-versioned-symbols
--enable-threaded-resolver
--with-random=/dev/urandom
--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt
--disable-ldap
--disable-ldaps
--disable-manual
--disable-rtsp
--disable-dict
--disable-telnet
--disable-pop3
--disable-imap
--disable-smb
--disable-smtp
--disable-gopher
--disable-crypto-auth
--without-gssapi
--without-libpsl
--without-libidn2
--without-gnutls
--without-polarssl
--without-mbedtls
--without-cyassl
--without-nss
--without-axtls
--without-brotli
--without-libmetalink
--without-libssh
--without-libssh2
--without-librtmp
--without-nghttp2
--without-zsh-functions-dir
BUILD_COMMAND make "-j${NPROC}"
INSTALL_COMMAND make install "DESTDIR=${DESTDIR}"
)
ExternalProject_Add(dep_wxwidgets
EXCLUDE_FROM_ALL 1
URL "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.tar.bz2"
URL_HASH SHA256=c925dfe17e8f8b09eb7ea9bfdcfcc13696a3e14e92750effd839f5e10726159e
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./configure
"--prefix=${DESTDIR}/usr/local"
--disable-shared
--with-gtk=2
--with-opengl
--enable-unicode
--enable-graphics_ctx
--with-regex=builtin
--with-libpng=builtin
--with-libxpm=builtin
--with-libjpeg=builtin
--with-libtiff=builtin
--with-zlib=builtin
--with-expat=builtin
--disable-precomp-headers
--enable-debug_info
--enable-debug_gdb
BUILD_COMMAND make "-j${NPROC}" && make -C locale allmo
INSTALL_COMMAND make install
)

224
deps/deps-windows.cmake vendored Normal file
View file

@ -0,0 +1,224 @@
if (${DEPS_BITS} EQUAL 32)
set(DEP_MSVC_GEN "Visual Studio 12")
else ()
set(DEP_MSVC_GEN "Visual Studio 12 Win64")
endif ()
if (${DEP_DEBUG})
set(DEP_BOOST_DEBUG "debug")
else ()
set(DEP_BOOST_DEBUG "")
endif ()
ExternalProject_Add(dep_boost
EXCLUDE_FROM_ALL 1
URL "https://dl.bintray.com/boostorg/release/1.63.0/source/boost_1_63_0.tar.gz"
URL_HASH SHA256=fe34a4e119798e10b8cc9e565b3b0284e9fd3977ec8a1b19586ad1dec397088b
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND bootstrap.bat
BUILD_COMMAND b2.exe
-j "${NPROC}"
--with-system
--with-filesystem
--with-thread
--with-log
--with-locale
--with-regex
"--prefix=${DESTDIR}/usr/local"
"address-model=${DEPS_BITS}"
toolset=msvc-12.0
link=static
variant=release
threading=multi
boost.locale.icu=off
"${DEP_BOOST_DEBUG}" release install
INSTALL_COMMAND "" # b2 does that already
)
ExternalProject_Add(dep_tbb
EXCLUDE_FROM_ALL 1
URL "https://github.com/wjakob/tbb/archive/a0dc9bf76d0120f917b641ed095360448cabc85b.tar.gz"
URL_HASH SHA256=0545cb6033bd1873fcae3ea304def720a380a88292726943ae3b9b207f322efe
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DCMAKE_DEBUG_POSTFIX=d
-DTBB_BUILD_SHARED=OFF
-DTBB_BUILD_TESTS=OFF
"-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj
INSTALL_COMMAND ""
)
if (${DEP_DEBUG})
ExternalProject_Get_Property(dep_tbb BINARY_DIR)
ExternalProject_Add_Step(dep_tbb build_debug
DEPENDEES build
DEPENDERS install
COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj
WORKING_DIRECTORY "${BINARY_DIR}"
)
endif ()
ExternalProject_Add(dep_gtest
EXCLUDE_FROM_ALL 1
URL "https://github.com/google/googletest/archive/release-1.8.1.tar.gz"
URL_HASH SHA256=9bf1fe5182a604b4135edc1a425ae356c9ad15e9b23f9f12a02e80184c3a249c
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS -DBUILD_GMOCK=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
"-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj
INSTALL_COMMAND ""
)
if (${DEP_DEBUG})
ExternalProject_Get_Property(dep_gtest BINARY_DIR)
ExternalProject_Add_Step(dep_gtest build_debug
DEPENDEES build
DEPENDERS install
COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj
WORKING_DIRECTORY "${BINARY_DIR}"
)
endif ()
ExternalProject_Add(dep_nlopt
EXCLUDE_FROM_ALL 1
URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz"
URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DNLOPT_PYTHON=OFF
-DNLOPT_OCTAVE=OFF
-DNLOPT_MATLAB=OFF
-DNLOPT_GUILE=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DCMAKE_DEBUG_POSTFIX=d
"-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj
INSTALL_COMMAND ""
)
if (${DEP_DEBUG})
ExternalProject_Get_Property(dep_nlopt BINARY_DIR)
ExternalProject_Add_Step(dep_nlopt build_debug
DEPENDEES build
DEPENDERS install
COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj
WORKING_DIRECTORY "${BINARY_DIR}"
)
endif ()
ExternalProject_Add(dep_zlib
EXCLUDE_FROM_ALL 1
URL "https://zlib.net/zlib-1.2.11.tar.xz"
URL_HASH SHA256=4ff941449631ace0d4d203e3483be9dbc9da454084111f97ea0a2114e19bf066
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
"-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj
INSTALL_COMMAND ""
)
if (${DEP_DEBUG})
ExternalProject_Get_Property(dep_zlib BINARY_DIR)
ExternalProject_Add_Step(dep_zlib build_debug
DEPENDEES build
DEPENDERS install
COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj
WORKING_DIRECTORY "${BINARY_DIR}"
)
endif ()
ExternalProject_Add(dep_libpng
DEPENDS dep_zlib
EXCLUDE_FROM_ALL 1
URL "http://prdownloads.sourceforge.net/libpng/libpng-1.6.35.tar.xz?download"
URL_HASH SHA256=23912ec8c9584917ed9b09c5023465d71709dce089be503c7867fec68a93bcd7
CMAKE_GENERATOR "${DEP_MSVC_GEN}"
CMAKE_ARGS
-DPNG_SHARED=OFF
-DPNG_TESTS=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON
"-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local"
BUILD_COMMAND msbuild /P:Configuration=Release INSTALL.vcxproj
INSTALL_COMMAND ""
)
if (${DEP_DEBUG})
ExternalProject_Get_Property(dep_libpng BINARY_DIR)
ExternalProject_Add_Step(dep_libpng build_debug
DEPENDEES build
DEPENDERS install
COMMAND msbuild /P:Configuration=Debug INSTALL.vcxproj
WORKING_DIRECTORY "${BINARY_DIR}"
)
endif ()
if (${DEPS_BITS} EQUAL 32)
set(DEP_LIBCURL_TARGET "x86")
else ()
set(DEP_LIBCURL_TARGET "x64")
endif ()
ExternalProject_Add(dep_libcurl
EXCLUDE_FROM_ALL 1
URL "https://curl.haxx.se/download/curl-7.58.0.tar.gz"
URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND cd winbuild && nmake /f Makefile.vc mode=static VC=12 GEN_PDB=yes DEBUG=no "MACHINE=${DEP_LIBCURL_TARGET}"
INSTALL_COMMAND cd builds\\libcurl-*-release-*-winssl
&& "${CMAKE_COMMAND}" -E copy_directory include "${DESTDIR}\\usr\\local\\include"
&& "${CMAKE_COMMAND}" -E copy_directory lib "${DESTDIR}\\usr\\local\\lib"
)
if (${DEP_DEBUG})
ExternalProject_Get_Property(dep_libcurl SOURCE_DIR)
ExternalProject_Add_Step(dep_libcurl build_debug
DEPENDEES build
DEPENDERS install
COMMAND cd winbuild && nmake /f Makefile.vc mode=static VC=12 GEN_PDB=yes DEBUG=yes "MACHINE=${DEP_LIBCURL_TARGET}"
WORKING_DIRECTORY "${SOURCE_DIR}"
)
ExternalProject_Add_Step(dep_libcurl install_debug
DEPENDEES install
COMMAND cd builds\\libcurl-*-debug-*-winssl
&& "${CMAKE_COMMAND}" -E copy_directory include "${DESTDIR}\\usr\\local\\include"
&& "${CMAKE_COMMAND}" -E copy_directory lib "${DESTDIR}\\usr\\local\\lib"
WORKING_DIRECTORY "${SOURCE_DIR}"
)
endif ()
if (${DEPS_BITS} EQUAL 32)
set(DEP_WXWIDGETS_TARGET "")
set(DEP_WXWIDGETS_LIBDIR "vc_lib")
else ()
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
endif ()
ExternalProject_Add(dep_wxwidgets
EXCLUDE_FROM_ALL 1
URL "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3.1.1.tar.bz2"
URL_HASH SHA256=c925dfe17e8f8b09eb7ea9bfdcfcc13696a3e14e92750effd839f5e10726159e
BUILD_IN_SOURCE 1
PATCH_COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}\\wxwidgets-pngprefix.h" src\\png\\pngprefix.h
CONFIGURE_COMMAND ""
BUILD_COMMAND cd build\\msw && nmake /f makefile.vc BUILD=release SHARED=0 UNICODE=1 USE_GUI=1 "${DEP_WXWIDGETS_TARGET}"
INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy_directory include "${DESTDIR}\\usr\\local\\include"
&& "${CMAKE_COMMAND}" -E copy_directory "lib\\${DEP_WXWIDGETS_LIBDIR}" "${DESTDIR}\\usr\\local\\lib\\${DEP_WXWIDGETS_LIBDIR}"
)
if (${DEP_DEBUG})
ExternalProject_Get_Property(dep_wxwidgets SOURCE_DIR)
ExternalProject_Add_Step(dep_wxwidgets build_debug
DEPENDEES build
DEPENDERS install
COMMAND cd build\\msw && nmake /f makefile.vc BUILD=debug SHARED=0 UNICODE=1 USE_GUI=1 "${DEP_WXWIDGETS_TARGET}"
WORKING_DIRECTORY "${SOURCE_DIR}"
)
endif ()

168
deps/wxwidgets-pngprefix.h vendored Normal file
View file

@ -0,0 +1,168 @@
// Patched in Slic3r: These two were missing:
#define png_write_eXIf wx_png_write_eXIf
#define png_handle_eXIf wx_png_handle_eXIf
#define png_sRGB_table wx_png_sRGB_table
#define png_sRGB_base wx_png_sRGB_base
#define png_sRGB_delta wx_png_sRGB_delta
#define png_zstream_error wx_png_zstream_error
#define png_free_buffer_list wx_png_free_buffer_list
#define png_fixed wx_png_fixed
#define png_user_version_check wx_png_user_version_check
#define png_malloc_base wx_png_malloc_base
#define png_malloc_array wx_png_malloc_array
#define png_realloc_array wx_png_realloc_array
#define png_create_png_struct wx_png_create_png_struct
#define png_destroy_png_struct wx_png_destroy_png_struct
#define png_free_jmpbuf wx_png_free_jmpbuf
#define png_zalloc wx_png_zalloc
#define png_zfree wx_png_zfree
#define png_default_read_data wx_png_default_read_data
#define png_push_fill_buffer wx_png_push_fill_buffer
#define png_default_write_data wx_png_default_write_data
#define png_default_flush wx_png_default_flush
#define png_reset_crc wx_png_reset_crc
#define png_write_data wx_png_write_data
#define png_read_sig wx_png_read_sig
#define png_read_chunk_header wx_png_read_chunk_header
#define png_read_data wx_png_read_data
#define png_crc_read wx_png_crc_read
#define png_crc_finish wx_png_crc_finish
#define png_crc_error wx_png_crc_error
#define png_calculate_crc wx_png_calculate_crc
#define png_flush wx_png_flush
#define png_write_IHDR wx_png_write_IHDR
#define png_write_PLTE wx_png_write_PLTE
#define png_compress_IDAT wx_png_compress_IDAT
#define png_write_IEND wx_png_write_IEND
#define png_write_gAMA_fixed wx_png_write_gAMA_fixed
#define png_write_sBIT wx_png_write_sBIT
#define png_write_cHRM_fixed wx_png_write_cHRM_fixed
#define png_write_sRGB wx_png_write_sRGB
#define png_write_iCCP wx_png_write_iCCP
#define png_write_sPLT wx_png_write_sPLT
#define png_write_tRNS wx_png_write_tRNS
#define png_write_bKGD wx_png_write_bKGD
#define png_write_hIST wx_png_write_hIST
#define png_write_tEXt wx_png_write_tEXt
#define png_write_zTXt wx_png_write_zTXt
#define png_write_iTXt wx_png_write_iTXt
#define png_set_text_2 wx_png_set_text_2
#define png_write_oFFs wx_png_write_oFFs
#define png_write_pCAL wx_png_write_pCAL
#define png_write_pHYs wx_png_write_pHYs
#define png_write_tIME wx_png_write_tIME
#define png_write_sCAL_s wx_png_write_sCAL_s
#define png_write_finish_row wx_png_write_finish_row
#define png_write_start_row wx_png_write_start_row
#define png_combine_row wx_png_combine_row
#define png_do_read_interlace wx_png_do_read_interlace
#define png_do_write_interlace wx_png_do_write_interlace
#define png_read_filter_row wx_png_read_filter_row
#define png_write_find_filter wx_png_write_find_filter
#define png_read_IDAT_data wx_png_read_IDAT_data
#define png_read_finish_IDAT wx_png_read_finish_IDAT
#define png_read_finish_row wx_png_read_finish_row
#define png_read_start_row wx_png_read_start_row
#define png_zlib_inflate wx_png_zlib_inflate
#define png_read_transform_info wx_png_read_transform_info
#define png_do_strip_channel wx_png_do_strip_channel
#define png_do_swap wx_png_do_swap
#define png_do_packswap wx_png_do_packswap
#define png_do_invert wx_png_do_invert
#define png_do_bgr wx_png_do_bgr
#define png_handle_IHDR wx_png_handle_IHDR
#define png_handle_PLTE wx_png_handle_PLTE
#define png_handle_IEND wx_png_handle_IEND
#define png_handle_bKGD wx_png_handle_bKGD
#define png_handle_cHRM wx_png_handle_cHRM
#define png_handle_gAMA wx_png_handle_gAMA
#define png_handle_hIST wx_png_handle_hIST
#define png_handle_iCCP wx_png_handle_iCCP
#define png_handle_iTXt wx_png_handle_iTXt
#define png_handle_oFFs wx_png_handle_oFFs
#define png_handle_pCAL wx_png_handle_pCAL
#define png_handle_pHYs wx_png_handle_pHYs
#define png_handle_sBIT wx_png_handle_sBIT
#define png_handle_sCAL wx_png_handle_sCAL
#define png_handle_sPLT wx_png_handle_sPLT
#define png_handle_sRGB wx_png_handle_sRGB
#define png_handle_tEXt wx_png_handle_tEXt
#define png_handle_tIME wx_png_handle_tIME
#define png_handle_tRNS wx_png_handle_tRNS
#define png_handle_zTXt wx_png_handle_zTXt
#define png_check_chunk_name wx_png_check_chunk_name
#define png_check_chunk_length wx_png_check_chunk_length
#define png_handle_unknown wx_png_handle_unknown
#define png_chunk_unknown_handling wx_png_chunk_unknown_handling
#define png_do_read_transformations wx_png_do_read_transformations
#define png_do_write_transformations wx_png_do_write_transformations
#define png_init_read_transformations wx_png_init_read_transformations
#define png_push_read_chunk wx_png_push_read_chunk
#define png_push_read_sig wx_png_push_read_sig
#define png_push_check_crc wx_png_push_check_crc
#define png_push_save_buffer wx_png_push_save_buffer
#define png_push_restore_buffer wx_png_push_restore_buffer
#define png_push_read_IDAT wx_png_push_read_IDAT
#define png_process_IDAT_data wx_png_process_IDAT_data
#define png_push_process_row wx_png_push_process_row
#define png_push_handle_unknown wx_png_push_handle_unknown
#define png_push_have_info wx_png_push_have_info
#define png_push_have_end wx_png_push_have_end
#define png_push_have_row wx_png_push_have_row
#define png_push_read_end wx_png_push_read_end
#define png_process_some_data wx_png_process_some_data
#define png_read_push_finish_row wx_png_read_push_finish_row
#define png_push_handle_tEXt wx_png_push_handle_tEXt
#define png_push_read_tEXt wx_png_push_read_tEXt
#define png_push_handle_zTXt wx_png_push_handle_zTXt
#define png_push_read_zTXt wx_png_push_read_zTXt
#define png_push_handle_iTXt wx_png_push_handle_iTXt
#define png_push_read_iTXt wx_png_push_read_iTXt
#define png_colorspace_set_gamma wx_png_colorspace_set_gamma
#define png_colorspace_sync_info wx_png_colorspace_sync_info
#define png_colorspace_sync wx_png_colorspace_sync
#define png_colorspace_set_chromaticities wx_png_colorspace_set_chromaticities
#define png_colorspace_set_endpoints wx_png_colorspace_set_endpoints
#define png_colorspace_set_sRGB wx_png_colorspace_set_sRGB
#define png_colorspace_set_ICC wx_png_colorspace_set_ICC
#define png_icc_check_length wx_png_icc_check_length
#define png_icc_check_header wx_png_icc_check_header
#define png_icc_check_tag_table wx_png_icc_check_tag_table
#define png_icc_set_sRGB wx_png_icc_set_sRGB
#define png_colorspace_set_rgb_coefficients wx_png_colorspace_set_rgb_coefficients
#define png_check_IHDR wx_png_check_IHDR
#define png_do_check_palette_indexes wx_png_do_check_palette_indexes
#define png_fixed_error wx_png_fixed_error
#define png_safecat wx_png_safecat
#define png_format_number wx_png_format_number
#define png_warning_parameter wx_png_warning_parameter
#define png_warning_parameter_unsigned wx_png_warning_parameter_unsigned
#define png_warning_parameter_signed wx_png_warning_parameter_signed
#define png_formatted_warning wx_png_formatted_warning
#define png_app_warning wx_png_app_warning
#define png_app_error wx_png_app_error
#define png_chunk_report wx_png_chunk_report
#define png_ascii_from_fp wx_png_ascii_from_fp
#define png_ascii_from_fixed wx_png_ascii_from_fixed
#define png_check_fp_number wx_png_check_fp_number
#define png_check_fp_string wx_png_check_fp_string
#define png_muldiv wx_png_muldiv
#define png_muldiv_warn wx_png_muldiv_warn
#define png_reciprocal wx_png_reciprocal
#define png_reciprocal2 wx_png_reciprocal2
#define png_gamma_significant wx_png_gamma_significant
#define png_gamma_correct wx_png_gamma_correct
#define png_gamma_16bit_correct wx_png_gamma_16bit_correct
#define png_gamma_8bit_correct wx_png_gamma_8bit_correct
#define png_destroy_gamma_table wx_png_destroy_gamma_table
#define png_build_gamma_table wx_png_build_gamma_table
#define png_safe_error wx_png_safe_error
#define png_safe_warning wx_png_safe_warning
#define png_safe_execute wx_png_safe_execute
#define png_image_error wx_png_image_error
#define png_check_keyword wx_png_check_keyword

View file

@ -26,10 +26,11 @@ TBB_SHA = a0dc9bf76d0120f917b641ed095360448cabc85b
TBB = tbb-$(TBB_SHA)
OPENSSL = openssl-OpenSSL_1_1_0g
CURL = curl-7.58.0
WXWIDGETS = wxWidgets-3.1.1
.PHONY: all destdir boost libcurl libopenssl libtbb
all: destdir boost libtbb libcurl
all: destdir boost libtbb libcurl wxwidgets
@echo
@echo "All done!"
@echo
@ -131,5 +132,33 @@ $(CURL).tar.gz:
curl -L -o $@ https://curl.haxx.se/download/$@
wxwidgets: $(WXWIDGETS).tar.bz2
# tar -jxvf $(WXWIDGETS).tar.bz2
cd $(WXWIDGETS) && ./configure \
--prefix=$(DESTDIR)/usr/local \
--disable-shared \
--with-gtk=2 \
--with-opengl \
--enable-unicode \
--enable-graphics_ctx \
--with-regex=builtin \
--with-libpng=builtin \
--with-libxpm=builtin \
--with-libjpeg=builtin \
--with-libtiff=builtin \
--with-zlib=builtin \
--with-expat=builtin \
--disable-precomp-headers \
--enable-debug_info \
--enable-debug_gdb
$(MAKE) -C $(WXWIDGETS) -j$(NPROC)
$(MAKE) -C $(WXWIDGETS)/locale allmo # XXX: ?
$(MAKE) -C $(WXWIDGETS) install #DESTDIR=$(DESTDIR)
$(WXWIDGETS).tar.bz2:
curl -L -o $@ https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/$@
clean:
rm -rf $(BOOST) $(BOOST).tar.gz $(TBB) $(TBB).tar.gz $(OPENSSL) $(OPENSSL).tar.gz $(CURL) $(CURL).tar.gz

View file

@ -40,6 +40,8 @@ $BOOST = 'boost_1_63_0'
$CURL = 'curl-7.58.0'
$TBB_SHA = 'a0dc9bf76d0120f917b641ed095360448cabc85b'
$TBB = "tbb-$TBB_SHA"
$WXWIDGETS_VER = "3.1.1"
$WXWIDGETS = "wxWidgets-$WXWIDGETS_VER"
try
@ -72,13 +74,21 @@ echo 'Downloading sources ...'
if (!(Test-Path "$BOOST.zip")) { $webclient.DownloadFile("https://dl.bintray.com/boostorg/release/1.63.0/source/$BOOST.zip", "$BOOST.zip") }
if (!(Test-Path "$TBB.zip")) { $webclient.DownloadFile("https://github.com/wjakob/tbb/archive/$TBB_SHA.zip", "$TBB.zip") }
if (!(Test-Path "$CURL.zip")) { $webclient.DownloadFile("https://curl.haxx.se/download/$CURL.zip", ".\$CURL.zip") }
if (!(Test-Path "$WXWIDGETS.zip")) { $webclient.DownloadFile("https://github.com/wxWidgets/wxWidgets/releases/download/v$WXWIDGETS_VER/$WXWIDGETS.zip", ".\$WXWIDGETS.zip") }
# Unpack sources:
echo 'Unpacking ...'
if (!(Test-Path $BOOST)) { [IO.Compression.ZipFile]::ExtractToDirectory("$BOOST.zip", '.') }
if (!(Test-Path $TBB)) { [IO.Compression.ZipFile]::ExtractToDirectory("$TBB.zip", '.') }
if (!(Test-Path $CURL)) { [IO.Compression.ZipFile]::ExtractToDirectory("$CURL.zip", '.') }
if (!(Test-Path "$BOOST")) { [IO.Compression.ZipFile]::ExtractToDirectory("$BOOST.zip", '.') }
if (!(Test-Path "$TBB")) { [IO.Compression.ZipFile]::ExtractToDirectory("$TBB.zip", '.') }
if (!(Test-Path "$CURL")) { [IO.Compression.ZipFile]::ExtractToDirectory("$CURL.zip", '.') }
if (!(Test-Path "$WXWIDGETS")) { [IO.Compression.ZipFile]::ExtractToDirectory("$WXWIDGETS.zip", "$WXWIDGETS") }
# Patch PNG in wxWidgets
# PNG prefix is not applied properly to two functions
$pngprefix_h = "$WXWIDGETS\src\png\pngprefix.h"
"#define png_write_eXIf wx_png_write_eXIf`n#define png_handle_eXIf wx_png_handle_eXIf`n`n" + (Get-Content $pngprefix_h | Out-String) | Set-Content $pngprefix_h
# Build libraries:
@ -127,6 +137,22 @@ Copy-Item -R -Force ..\builds\libcurl-*-winssl\include\* "$destdir\usr\local\inc
Copy-Item -R -Force ..\builds\libcurl-*-winssl\lib\* "$destdir\usr\local\lib\"
popd
# Build wxWidgets
pushd "$WXWIDGETS"
pushd "build\msw"
$target_cpu_opt = ("", "TARGET_CPU=X64")[!$b32]
$lib_dir = ("vc_lib", "vc_x64_lib")[!$b32]
nmake /f makefile.vc `
BUILD=release `
SHARED=0 `
UNICODE=1 `
USE_GUI=1 `
"$target_cpu_opt"
popd
Copy-Item -R -Force include\* "$destdir\usr\local\include\"
Copy-Item -R -Force "lib\$lib_dir" "$destdir\usr\local\lib\"
popd
echo ""
echo "All done!"

View file

@ -41,6 +41,7 @@ our $PROCESS_COMPLETED_EVENT = Wx::NewEventType;
my $PreventListEvents = 0;
our $appController;
# XXX: VK: done, except callback handling and timer
sub new {
my ($class, $parent, %params) = @_;
my $self = $class->SUPER::new($parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
@ -593,6 +594,7 @@ sub new {
$self->on_process_completed($event->GetInt ? undef : $event->GetString);
});
# XXX: not done
{
my $timer_id = Wx::NewId();
$self->{apply_config_timer} = Wx::Timer->new($self, $timer_id);
@ -812,12 +814,14 @@ sub new {
return $self;
}
# XXX: VK: WIP
# sets the callback
sub on_select_preset {
my ($self, $cb) = @_;
$self->{on_select_preset} = $cb;
}
# XXX: merged with on_select_preset
# Called from the platter combo boxes selecting the active print, filament or printer.
sub _on_select_preset {
my ($self, $group, $choice, $idx) = @_;
@ -854,6 +858,7 @@ sub _on_select_preset {
$self->on_config_change(wxTheApp->{preset_bundle}->full_config);
}
# XXX: VK: done
sub on_layer_editing_toggled {
my ($self, $new_state) = @_;
Slic3r::GUI::_3DScene::enable_layers_editing($self->{canvas3D}, $new_state);
@ -872,11 +877,13 @@ sub on_layer_editing_toggled {
$self->{canvas3D}->Update;
}
# XXX: VK: done (Plater::priv::main_frame)
sub GetFrame {
my ($self) = @_;
return &Wx::GetTopLevelParent($self);
}
# XXX: not done
# Called after the Preferences dialog is closed and the program settings are saved.
# Update the UI based on the current preferences.
sub update_ui_from_settings
@ -888,6 +895,7 @@ sub update_ui_from_settings
}
}
# XXX: VK: done
# Update preset combo boxes (Print settings, Filament, Material, Printer) from their respective tabs.
# Called by
# Slic3r::GUI::Tab::Print::_on_presets_changed
@ -933,12 +941,14 @@ sub update_presets {
wxTheApp->{preset_bundle}->export_selections(wxTheApp->{app_config});
}
# XXX: VK: done, in on_action_add()
sub add {
my ($self) = @_;
my @input_files = wxTheApp->open_model($self);
$self->load_files(\@input_files);
}
# XXX: VK: done
sub load_files {
my ($self, $input_files) = @_;
@ -960,7 +970,7 @@ sub load_files {
# Object indices for the UI.
my @obj_idx = ();
# Collected file names to display the final message on the status bar.
my @loaded_files = ();
my @loaded_files = (); # XXX: used???
# For all input files.
for (my $i = 0; $i < @$input_files; $i += 1) {
my $input_file = $input_files->[$i];
@ -996,7 +1006,7 @@ sub load_files {
# objects imported from 3mf require a call to center_around_origin to have gizmos working properly and this call
# need to be done after looks_like_multipart_object detection
if ($input_file =~ /.3[mM][fF]$/)
if ($input_file =~ /[.]3[mM][fF]$/)
{
foreach my $model_object (@{$model->objects}) {
$model_object->center_around_origin; # also aligns object to Z = 0
@ -1029,6 +1039,7 @@ sub load_files {
return @obj_idx;
}
# XXX: VK: done, except a few todos
sub load_model_objects {
my ($self, @model_objects) = @_;
@ -1111,6 +1122,7 @@ sub load_model_objects {
return @obj_idx;
}
# XXX: Removed, replaced with bed_shape_bb()
sub bed_centerf {
my ($self) = @_;
@ -1119,6 +1131,7 @@ sub bed_centerf {
return Slic3r::Pointf->new(unscale($bed_center->x), unscale($bed_center->y)); #)
}
# XXX: VK: done
sub remove {
my ($self, $obj_idx) = @_;
@ -1145,6 +1158,7 @@ sub remove {
$self->update;
}
# XXX: VK: done
sub reset {
my ($self) = @_;
@ -1165,6 +1179,7 @@ sub reset {
$self->update;
}
# XXX: VK: done
sub increase {
my ($self, $copies) = @_;
$copies //= 1;
@ -1196,6 +1211,7 @@ sub increase {
$self->schedule_background_process;
}
# XXX: VK: done
sub decrease {
my ($self, $copies_asked) = @_;
my $copies = $copies_asked // 1;
@ -1223,6 +1239,7 @@ sub decrease {
$self->update;
}
# XXX: VK: done
sub set_number_of_copies {
my ($self) = @_;
# get current number of copies
@ -1241,6 +1258,7 @@ sub set_number_of_copies {
}
}
# XXX: VK: removed
sub _get_number_from_user {
my ($self, $title, $prompt_message, $error_message, $default, $only_positive) = @_;
for (;;) {
@ -1263,6 +1281,7 @@ sub _get_number_from_user {
}
}
# XXX: not done
sub rotate {
my ($self, $angle, $axis, $relative_key, $axis_x, $axis_y, $axis_z) = @_;
$relative_key //= 'absolute'; # relative or absolute coordinates
@ -1333,6 +1352,7 @@ sub rotate {
$self->update;
}
# XXX: not done
sub mirror {
my ($self, $axis) = @_;
@ -1362,6 +1382,7 @@ sub mirror {
$self->update;
}
# XXX: not done, renamed as Plater::priv::scale()
sub changescale {
my ($self, $axis, $tosize) = @_;
@ -1436,6 +1457,7 @@ sub changescale {
$self->update;
}
# XXX: VK: WIP
sub arrange {
my ($self) = @_;
@ -1453,6 +1475,7 @@ sub arrange {
$self->update(0);
}
# XXX: not done
sub split_object {
my $self = shift;
@ -1484,6 +1507,7 @@ sub split_object {
}
}
# XXX: not done
# Trigger $self->async_apply_config() after 500ms.
# The call is delayed to avoid restarting the background processing during typing into an edit field.
sub schedule_background_process {
@ -1491,6 +1515,7 @@ sub schedule_background_process {
$self->{apply_config_timer}->Start(0.5 * 1000, 1); # 1 = one shot, every half a second.
}
# XXX: not done
# Executed asynchronously by a timer every PROCESS_DELAY (0.5 second).
# The timer is started by schedule_background_process(),
sub async_apply_config {
@ -1525,6 +1550,7 @@ sub async_apply_config {
}
}
# XXX: not done
# Background processing is started either by the "Slice now" button, by the "Export G-code button" or by async_apply_config().
sub start_background_process {
my ($self) = @_;
@ -1545,6 +1571,7 @@ sub start_background_process {
$self->{background_slicing_process}->start;
}
# XXX: not done
# Stop the background processing
sub stop_background_process {
my ($self) = @_;
@ -1553,6 +1580,7 @@ sub stop_background_process {
# $self->{preview3D}->reload_print if $self->{preview3D};
}
# XXX: not done
# Called by the "Slice now" button, which is visible only if the background processing is disabled.
sub reslice {
# explicitly cancel a previous thread and start a new one.
@ -1573,6 +1601,7 @@ sub reslice {
}
}
# XXX: VK: done
sub export_gcode {
my ($self, $output_file) = @_;
@ -1653,6 +1682,7 @@ sub export_gcode {
return $self->{export_gcode_output_file};
}
# XXX: not done
# This message should be called by the background process synchronously.
sub on_update_print_preview {
my ($self) = @_;
@ -1665,6 +1695,7 @@ sub on_update_print_preview {
Slic3r::GUI::_3DScene::reload_scene($self->{canvas3D}, 1);
}
# XXX: not done
# This gets called also if we have no threads.
sub on_progress_event {
my ($self, $percent, $message) = @_;
@ -1675,6 +1706,7 @@ sub on_progress_event {
$self->statusbar->SetStatusText("$message...");
}
# XXX: not done
# Called when the G-code export finishes, either successfully or with an error.
# This gets called also if we don't have threads.
sub on_process_completed {
@ -1742,6 +1774,7 @@ sub on_process_completed {
# $self->{preview3D}->reload_print if $self->{preview3D};
}
# XXX: partially done in the Sidebar
# Fill in the "Sliced info" box with the result of the G-code generator.
sub print_info_box_show {
my ($self, $show) = @_;
@ -1818,6 +1851,7 @@ sub print_info_box_show {
$panel->Refresh;
}
# XXX: not done - to be removed
sub do_print {
my ($self) = @_;
@ -1831,6 +1865,7 @@ sub do_print {
$printer_panel->load_print_job($self->{print_file}, $filament_stats);
}
# XXX: VK: done
sub export_stl {
my ($self) = @_;
return if !@{$self->{objects}};
@ -1841,6 +1876,7 @@ sub export_stl {
$self->statusbar->SetStatusText(L("STL file exported to ").$output_file);
}
# XXX: not done
sub reload_from_disk {
my ($self) = @_;
@ -1872,6 +1908,7 @@ sub reload_from_disk {
$self->remove($obj_idx);
}
# XXX: VK: done
sub export_object_stl {
my ($self) = @_;
my ($obj_idx, $object) = $self->selected_object;
@ -1883,6 +1920,7 @@ sub export_object_stl {
$self->statusbar->SetStatusText(L("STL file exported to ").$output_file);
}
# XXX: not done
sub fix_through_netfabb {
my ($self) = @_;
my ($obj_idx, $object) = $self->selected_object;
@ -1911,6 +1949,7 @@ sub fix_through_netfabb {
$self->remove($obj_idx);
}
# XXX: VK: done
sub export_amf {
my ($self) = @_;
return if !@{$self->{objects}};
@ -1927,6 +1966,7 @@ sub export_amf {
}
}
# XXX: VK: done
sub export_3mf {
my ($self) = @_;
return if !@{$self->{objects}};
@ -1943,6 +1983,7 @@ sub export_3mf {
}
}
# XXX: VK: done
# Ask user to select an output file for a given file format (STl, AMF, 3MF).
# Propose a default file name based on the 'output_filename_format' configuration value.
sub _get_export_file {
@ -1992,6 +2033,7 @@ sub _get_export_file {
# $self->{objects}[$obj_idx]->thumbnail(undef);
#}
# XXX: VK: done
# this method gets called whenever print center is changed or the objects' bounding box changes
# (i.e. when an object is added/removed/moved/rotated/scaled)
sub update {
@ -2015,6 +2057,7 @@ sub update {
$self->Thaw;
}
# XXX: YS: done
# When a printer technology is changed, the UI needs to be updated to show/hide needed preset combo boxes.
sub show_preset_comboboxes{
my ($self, $showSLA) = @_; #if showSLA is oposite value to "ptFFF"
@ -2033,6 +2076,7 @@ sub show_preset_comboboxes{
$self->Layout;
}
# XXX: YS: done
# When a number of extruders changes, the UI needs to be updated to show a single filament selection combo box per extruder.
# Also the wxTheApp->{preset_bundle}->filament_presets needs to be resized accordingly
# and some reasonable default has to be selected for the additional extruders.
@ -2077,6 +2121,7 @@ sub on_extruders_change {
$self->Layout;
}
# XXX: not done
sub on_config_change {
my ($self, $config) = @_;
@ -2143,6 +2188,7 @@ sub on_config_change {
$self->schedule_background_process;
}
# XXX: YS: WIP
sub item_changed_selection {
my ($self, $obj_idx) = @_;
@ -2158,6 +2204,7 @@ sub item_changed_selection {
}
}
# XXX: VK: done
sub collect_selections {
my ($self) = @_;
my $selections = [];
@ -2167,6 +2214,7 @@ sub collect_selections {
return $selections;
}
# XXX: YS: done, lambda on LEFT_DOWN
# Called when clicked on the filament preset combo box.
# When clicked on the icon, show the color picker.
sub filament_color_box_lmouse_down
@ -2220,6 +2268,7 @@ sub filament_color_box_lmouse_down
# }
#}
# XXX: YS: done
sub changed_object_settings {
my ($self, $obj_idx, $parts_changed, $part_settings_changed) = @_;
@ -2245,6 +2294,7 @@ sub changed_object_settings {
}
}
# XXX: VK: done
# Called to update various buttons depending on whether there are any objects or
# whether background processing (export of a G-code, sending to Octoprint, forced background re-slicing) is active.
sub object_list_changed {
@ -2275,6 +2325,7 @@ sub object_list_changed {
for grep $self->{"btn_$_"}, qw(reslice export_gcode print send_gcode);
}
# XXX: VK: WIP
# Selection of an active 3D object changed.
sub selection_changed {
my ($self) = @_;
@ -2392,6 +2443,7 @@ sub selection_changed {
$self->{right_panel}->Thaw;
}
# XXX: VK: done
sub select_object {
my ($self, $obj_idx, $child) = @_;
@ -2412,6 +2464,7 @@ sub select_object {
$self->selection_changed(1);
}
# XXX: YS: WIP
sub select_object_from_cpp {
my ($self, $obj_idx, $vol_idx) = @_;
@ -2456,16 +2509,19 @@ sub select_object_from_cpp {
$self->selection_changed(1);
}
# XXX: VK: done
sub selected_object {
my ($self) = @_;
my $obj_idx = first { $self->{objects}[$_]->selected } 0..$#{ $self->{objects} };
return defined $obj_idx ? ($obj_idx, $self->{objects}[$obj_idx]) : undef;
}
# XXX: VK: done
sub statusbar {
return $_[0]->GetFrame->{statusbar};
}
# XXX: not done, to be removed (?)
sub object_menu {
my ($self) = @_;
@ -2576,6 +2632,7 @@ sub object_menu {
return $menu;
}
# XXX: not done
# Set a camera direction, zoom to all objects.
sub select_view {
my ($self, $direction) = @_;
@ -2593,6 +2650,8 @@ sub select_view {
}
}
# XXX: VK: done, in PlaterDropTarget
package Slic3r::GUI::Plater::DropTarget;
use Wx::DND;
use base 'Wx::FileDropTarget';

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -1,642 +0,0 @@
<< start
<< echo: 3.1.1-RC5-150z
<< echo: Last Updated: Feb 7 2018 15:28:23 | Author: (none, default config)
<< Compiled: Feb 7 2018
<< echo: Free Memory: 1777 PlannerBufferBytes: 1312
<< echo:Hardcoded Default Settings Loaded
<< adc_init
>> N0 M105*39
<< CrashDetect ENABLED!
<< tmc2130_init(), mode=NORMAL
<< PAT9125_init:1
<< FSensor
<< ENABLED
<< echo:SD card ok
<< echo:busy: processing
<< Error:Line Number is not Last Line Number+1, Last Line: 0
<< Resend: 1
<< ok
>> N1 M107*36
<< ok
>> N2 M115 U3.1.1-RC5*107
<< ok
>> N3 M201 X1000 Y1000 Z200 E5000*10
<< ok
>> N4 M203 X200 Y200 Z12 E120*8
<< ok
>> N5 M204 S1250 T1250*39
<< ok
>> N6 M205 X10 Y10 Z0.4 E2.5*63
<< ok
>> N7 M205 S0 T0*36
<< ok
>> N8 M83*16
<< ok
>> N9 M104 S215*106
<< ok
>> N10 M140 S60*98
<< ok
>> N11 M190 S60*110
<< T:158.08 E:0 B:57.1
<< T:157.04 E:0 B:57.1
<< T:156.77 E:0 B:56.9
<< T:156.97 E:0 B:57.0
<< T:158.14 E:0 B:57.0
<< T:159.62 E:0 B:56.9
<< T:161.25 E:0 B:56.8
<< T:163.64 E:0 B:56.8
<< T:165.94 E:0 B:56.7
<< T:168.40 E:0 B:56.8
<< T:170.79 E:0 B:56.7
<< T:173.68 E:0 B:56.7
<< T:175.53 E:0 B:56.6
<< T:178.40 E:0 B:56.6
<< T:180.94 E:0 B:56.5
<< T:183.92 E:0 B:56.4
<< T:186.73 E:0 B:56.4
<< T:189.20 E:0 B:56.4
<< T:191.32 E:0 B:56.3
<< T:193.91 E:0 B:56.3
<< T:196.38 E:0 B:56.2
<< T:198.75 E:0 B:56.2
<< T:201.65 E:0 B:56.3
<< T:203.57 E:0 B:56.4
<< T:206.38 E:0 B:56.5
<< T:208.71 E:0 B:56.6
<< T:211.04 E:0 B:56.6
<< T:212.86 E:0 B:56.8
<< T:214.84 E:0 B:57.0
<< T:215.52 E:0 B:57.2
<< T:215.78 E:0 B:57.4
<< T:216.30 E:0 B:57.6
<< T:216.51 E:0 B:57.7
<< T:215.73 E:0 B:58.0
<< T:215.47 E:0 B:58.2
<< T:214.95 E:0 B:58.5
<< T:214.22 E:0 B:58.7
<< T:213.65 E:0 B:59.0
<< T:212.24 E:0 B:59.2
<< T:212.14 E:0 B:59.4
<< T:212.03 E:0 B:59.7
<< T:211.51 E:0 B:59.8
<< ok
>> N12 M105*20
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N13 M105*21
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N14 M105*18
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N15 M105*19
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N16 M105*16
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N17 M105*17
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N18 M105*30
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N19 M105*31
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N20 M105*21
<< ok T:211.0 /215.0 B:60.0 /60.0 T0:211.0 /215.0 @:60 B@:0 P:46.3 A:36.2
>> N21 M109 S215*93
<< T:211.3 E:0 W:?
<< T:211.8 E:0 W:?
<< T:211.8 E:0 W:?
<< T:212.1 E:0 W:?
<< T:212.4 E:0 W:?
<< T:213.3 E:0 W:?
<< T:213.3 E:0 W:?
<< T:213.8 E:0 W:?
<< T:214.1 E:0 W:2
<< T:214.1 E:0 W:1
<< T:214.2 E:0 W:0
<< ok
>> N22 M105*23
<< ok T:214.3 /215.0 B:60.8 /60.0 T0:214.3 /215.0 @:20 B@:7 P:46.4 A:36.0
>> N23 M105*22
<< ok T:214.3 /215.0 B:60.8 /60.0 T0:214.3 /215.0 @:20 B@:7 P:46.4 A:36.0
>> N24 G28 W*82
<< 0 step=62 mscnt= 993
<< tmc2130_goto_step 0 0 2 1000
<< step 61 mscnt = 984
<< dir=0 steps=-61
<< dir=1 steps=61
<< dir=0 steps=3
<< cnt 2 step 61 mscnt = 986
<< cnt 1 step 62 mscnt = 1005
<< cnt 0 step 63 mscnt = 1021
<< echo:busy: processing
<< echo:busy: processing
<< 0 step=34 mscnt= 547
<< tmc2130_goto_step 1 0 2 1000
<< step 34 mscnt = 552
<< dir=1 steps=-34
<< dir=0 steps=34
<< dir=1 steps=30
<< cnt 29 step 34 mscnt = 554
<< cnt 28 step 35 mscnt = 572
<< cnt 27 step 36 mscnt = 588
<< cnt 26 step 37 mscnt = 604
<< cnt 25 step 38 mscnt = 620
<< cnt 24 step 39 mscnt = 637
<< cnt 23 step 40 mscnt = 653
<< cnt 22 step 41 mscnt = 668
<< cnt 21 step 42 mscnt = 684
<< cnt 20 step 43 mscnt = 701
<< cnt 19 step 44 mscnt = 717
<< cnt 18 step 45 mscnt = 733
<< cnt 17 step 46 mscnt = 748
<< cnt 16 step 47 mscnt = 765
<< cnt 15 step 48 mscnt = 780
<< cnt 14 step 49 mscnt = 796
<< cnt 13 step 50 mscnt = 812
<< cnt 12 step 51 mscnt = 828
<< cnt 11 step 52 mscnt = 844
<< cnt 10 step 53 mscnt = 860
<< cnt 9 step 54 mscnt = 876
<< cnt 8 step 55 mscnt = 893
<< cnt 7 step 56 mscnt = 909
<< cnt 6 step 57 mscnt = 925
<< cnt 5 step 58 mscnt = 941
<< cnt 4 step 59 mscnt = 956
<< cnt 3 step 60 mscnt = 972
<< cnt 2 step 61 mscnt = 988
<< cnt 1 step 62 mscnt = 1005
<< cnt 0 step 63 mscnt = 1021
<< echo:busy: processing
<< ok
>> N25 M105*16
<< ok T:213.1 /215.0 B:60.8 /60.0 T0:213.1 /215.0 @:44 B@:35 P:46.5 A:35.6
>> N26 G80*37
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< ok
>> N27 M105*18
<< ok T:214.8 /215.0 B:60.9 /60.0 T0:214.8 /215.0 @:31 B@:25 P:46.3 A:35.7
>> N28 M105*29
<< ok T:214.8 /215.0 B:60.9 /60.0 T0:214.8 /215.0 @:31 B@:25 P:46.3 A:35.7
>> N29 M105*28
<< ok T:214.8 /215.0 B:60.9 /60.0 T0:214.8 /215.0 @:31 B@:25 P:46.3 A:35.7
>> N30 M105*20
<< ok T:214.8 /215.0 B:60.9 /60.0 T0:214.8 /215.0 @:31 B@:25 P:46.3 A:35.7
>> N31 M105*21
<< ok T:214.8 /215.0 B:60.9 /60.0 T0:214.8 /215.0 @:31 B@:25 P:46.3 A:35.7
>> N32 M105*22
<< ok T:214.8 /215.0 B:60.9 /60.0 T0:214.8 /215.0 @:31 B@:25 P:46.3 A:35.7
>> N33 G1 Y-3.0 F1000.0*24
<< ok
>> N34 G92 E0.0*110
<< ok
>> N35 G1 X60.0 E9.0 F1000.0*101
<< ok
>> N36 G1 X100.0 E12.5 F1000.0*110
<< ok
>> N37 G92 E0.0*109
<< ok
>> N38 M221 S95*102
<< ok
>> N39 M900 K30*120
<< Invalid M code.
<< ok
>> N40 G21*46
<< ok
>> N41 G90*37
<< ok
>> N42 M83*46
<< ok
>> N43 G1 E-0.80000 F2100.00000*10
<< ok
>> N44 G1 Z0.600 F10200.000*1
<< ok
>> N45 G1 X112.437 Y93.991 F10200.000*106
<< ok
>> N46 G1 Z0.200 F10200.000*7
<< ok
>> N47 G1 E0.80000 F2100.00000*35
<< ok
>> N48 M204 S1000*107
<< ok
>> N49 G1 F1800*122
<< ok
>> N50 G1 X112.930 Y93.183 E0.02968*106
<< ok
>> N51 G1 X113.335 Y92.806 E0.01733*99
<< ok
>> N52 G1 X113.810 Y92.516 E0.01745*97
<< ok
>> N53 G1 X114.334 Y92.328 E0.01745*97
<< ok
>> N54 G1 X114.885 Y92.248 E0.01745*96
<< ok
>> N55 M105*23
<< ok T:214.9 /215.0 B:60.8 /60.0 T0:214.9 /215.0 @:30 B@:28 P:46.2 A:35.7
>> N56 G1 X135.004 Y92.246 E0.63084*96
<< ok
>> N57 G1 X136.005 Y92.436 E0.03195*101
<< ok
>> N58 G1 X136.866 Y92.974 E0.03183*107
<< ok
>> N59 G1 X137.473 Y93.788 E0.03183*111
<< ok
>> N60 G1 X137.745 Y94.770 E0.03195*100
<< ok
>> N61 G1 X137.753 Y115.086 E0.63700*88
<< ok
>> N62 G1 X137.563 Y116.009 E0.02955*87
<< ok
>> N63 G1 X137.070 Y116.817 E0.02968*88
<< ok
>> N64 G1 X136.646 Y117.208 E0.01809*93
<< ok
>> N65 G1 X136.149 Y117.503 E0.01809*88
<< ok
>> N66 G1 X135.603 Y117.687 E0.01809*94
<< ok
>> N67 G1 X135.029 Y117.754 E0.01809*94
<< ok
>> N68 G1 X114.914 Y117.753 E0.63071*81
<< ok
>> N69 G1 X113.991 Y117.563 E0.02955*83
<< ok
>> N70 G1 X113.183 Y117.070 E0.02968*89
<< ok
>> N71 G1 X112.792 Y116.646 E0.01809*88
<< ok
>> N72 M105*18
<< ok T:214.0 /215.0 B:60.8 /60.0 T0:214.0 /215.0 @:45 B@:16 P:46.2 A:35.5
>> N73 G1 X112.497 Y116.149 E0.01809*84
<< ok
>> N74 G1 X112.313 Y115.603 E0.01809*82
<< ok
>> N75 G1 X112.246 Y115.029 E0.01809*92
<< ok
>> N76 G1 X112.247 Y94.914 E0.63071*98
<< ok
>> N77 G1 X112.425 Y94.050 E0.02767*111
<< ok
>> N78 G1 F8160*126
<< ok
>> N79 G1 X112.930 Y93.183 E-0.24526*78
<< ok
>> N80 G1 F8160*121
<< ok
>> N81 G1 X113.335 Y92.806 E-0.13510*67
<< ok
>> N82 G1 F8160*123
<< ok
>> N83 G1 X113.810 Y92.516 E-0.13609*74
<< ok
>> N84 G1 F8160*125
<< ok
>> N85 G1 X114.334 Y92.328 E-0.13609*77
<< ok
>> N86 G1 F8160*127
<< ok
>> N87 G1 X114.769 Y92.265 E-0.10746*66
<< ok
>> N88 G1 E-0.04000 F2100.00000*1
<< ok
>> N89 G1 Z0.800 F10200.000*14
<< ok
>> N90 G1 X113.989 Y92.849 F10200.000*110
<< ok
>> N91 G1 Z0.200 F10200.000*13
<< ok
>> N92 G1 E0.80000 F2100.00000*43
<< ok
>> N93 G1 F1800*125
<< ok
>> N94 G1 X114.911 Y92.625 E0.02977*99
<< ok
>> N95 G1 X135.004 Y92.623 E0.62999*108
<< ok
>> N96 G1 X135.871 Y92.788 E0.02767*108
<< ok
>> N97 G1 X136.617 Y93.258 E0.02767*105
<< ok
>> N98 G1 X137.141 Y93.968 E0.02767*107
<< ok
>> N99 G1 X137.371 Y94.824 E0.02778*107
<< ok
>> N100 G1 X137.376 Y115.065 E0.63464*97
<< ok
>> N101 G1 X137.209 Y115.878 E0.02602*104
<< ok
>> N102 G1 X136.773 Y116.584 E0.02602*111
<< ok
>> N103 G1 X136.407 Y116.916 E0.01550*110
<< ok
>> N104 G1 X135.980 Y117.166 E0.01550*102
<< ok
>> N105 G1 X135.511 Y117.321 E0.01550*98
<< ok
>> N106 G1 X135.020 Y117.377 E0.01550*101
<< ok
>> N107 G1 X114.935 Y117.376 E0.62975*101
<< ok
>> N108 G1 X114.122 Y117.209 E0.02602*100
<< ok
>> N109 G1 X113.416 Y116.773 E0.02602*105
<< ok
>> N110 G1 X113.084 Y116.407 E0.01550*105
<< ok
>> N111 G1 X112.834 Y115.980 E0.01550*107
<< ok
>> N112 G1 X112.679 Y115.511 E0.01550*107
<< ok
>> N113 G1 X112.623 Y115.020 E0.01550*98
<< ok
>> N114 G1 X112.624 Y94.935 E0.62975*89
<< ok
>> N115 G1 X112.791 Y94.122 E0.02602*80
<< ok
>> N116 G1 X113.227 Y93.416 E0.02602*95
<< ok
>> N117 G1 X113.940 Y92.885 E0.02789*81
<< ok
>> N118 G1 F8160*73
<< ok
>> N119 G1 X114.911 Y92.625 E-0.24574*113
<< ok
>> N120 G1 F8160*66
<< ok
>> N121 G1 X117.015 Y92.624 E-0.51426*113
<< ok
>> N122 G1 E-0.04000 F2100.00000*48
<< ok
>> N123 G1 Z0.800 F10200.000*63
<< ok
>> N124 G1 X115.587 Y95.587 F10200.000*92
<< ok
>> N125 M105*33
<< ok T:214.2 /215.0 B:60.7 /60.0 T0:214.2 /215.0 @:41 B@:24 P:46.2 A:36.0
>> N126 G1 Z0.200 F10200.000*48
<< ok
>> N127 G1 E0.80000 F2100.00000*20
<< ok
>> N128 G1 F1800*76
<< ok
>> N129 G1 X134.413 Y95.587 E0.59027*87
<< ok
>> N130 G1 X134.413 Y114.413 E0.59027*107
<< ok
>> N131 G1 X115.587 Y114.413 E0.59027*101
<< ok
>> N132 G1 X115.587 Y95.647 E0.58839*91
<< ok
>> N133 G1 X115.210 Y95.210 F10200.000*90
<< ok
>> N134 G1 F1800*65
<< ok
>> N135 G1 X134.790 Y95.210 E0.61392*93
<< ok
>> N136 G1 X134.790 Y114.790 E0.61392*107
<< ok
>> N137 G1 X115.210 Y114.790 E0.61392*100
<< ok
>> N138 G1 X115.210 Y95.270 E0.61204*86
<< ok
>> N139 G1 X115.596 Y95.314 F10200.000*92
<< ok
>> N140 G1 F8160*68
<< ok
>> N141 G1 X118.319 Y95.260 E-0.76000*113
<< ok
>> N142 G1 E-0.04000 F2100.00000*54
<< ok
>> N143 G1 Z0.800 F10200.000*57
<< ok
>> N144 G1 X115.700 Y113.527 F10200.000*98
<< ok
>> N145 G1 Z0.200 F10200.000*53
<< ok
>> N146 G1 E0.80000 F2100.00000*19
<< ok
>> N147 G1 F1800*69
<< ok
>> N148 G1 X116.303 Y114.130 E0.02708*98
<< ok
>> N149 G1 X116.843 Y114.130 E0.01716*96
<< ok
>> N150 G1 X115.870 Y113.157 E0.04372*110
<< ok
>> N151 G1 X115.870 Y112.617 E0.01716*110
<< ok
>> N152 G1 X117.383 Y114.130 E0.06799*108
<< ok
>> N153 G1 X117.924 Y114.130 E0.01716*106
<< ok
>> N154 M105*39
<< ok T:215.1 /215.0 B:60.7 /60.0 T0:215.1 /215.0 @:29 B@:12 P:46.2 A:35.7
>> N155 G1 X115.870 Y112.076 E0.09225*102
<< ok
>> N156 G1 X115.870 Y111.536 E0.01716*106
<< ok
>> N157 G1 X118.464 Y114.130 E0.11652*104
<< ok
>> N158 G1 X119.004 Y114.130 E0.01716*100
<< ok
>> N159 G1 X115.870 Y110.996 E0.14079*104
<< ok
>> N160 G1 X115.870 Y110.456 E0.01716*105
<< ok
>> N161 G1 X119.544 Y114.130 E0.16505*105
<< ok
>> N162 G1 X120.085 Y114.130 E0.01716*110
<< ok
>> N163 G1 X115.870 Y109.915 E0.18932*104
<< ok
>> N164 G1 X115.870 Y109.375 E0.01716*99
<< ok
>> N165 G1 X120.625 Y114.130 E0.21358*105
<< ok
>> N166 G1 X121.165 Y114.130 E0.01716*100
<< ok
>> N167 G1 X115.870 Y108.835 E0.23785*100
<< ok
>> N168 G1 X115.870 Y108.295 E0.01716*97
<< ok
>> N169 G1 X121.705 Y114.130 E0.26212*111
<< ok
>> N170 G1 X122.245 Y114.130 E0.01716*97
<< ok
>> N171 G1 X115.870 Y107.755 E0.28638*105
<< ok
>> N172 G1 X115.870 Y107.214 E0.01716*108
<< ok
>> N173 G1 X122.786 Y114.130 E0.31065*104
<< ok
>> N174 G1 X123.326 Y114.130 E0.01716*96
<< ok
>> N175 G1 X115.870 Y106.674 E0.33491*101
<< ok
>> N176 G1 X115.870 Y106.134 E0.01716*104
<< ok
>> N177 G1 X123.866 Y114.130 E0.35918*107
<< ok
>> N178 G1 X124.406 Y114.130 E0.01716*110
<< ok
>> N179 G1 X115.870 Y105.594 E0.38344*99
<< ok
>> N180 G1 X115.870 Y105.054 E0.01716*101
<< ok
>> N181 G1 X124.946 Y114.130 E0.40771*101
<< ok
>> N182 G1 X125.487 Y114.130 E0.01716*99
<< ok
>> N183 G1 X115.870 Y104.513 E0.43198*103
<< ok
>> N184 G1 X115.870 Y103.973 E0.01716*107
<< ok
>> N185 G1 X126.027 Y114.130 E0.45624*105
<< ok
>> N186 G1 X126.567 Y114.130 E0.01716*107
<< ok
>> N187 G1 X115.870 Y103.433 E0.48051*104
<< ok
>> N188 G1 X115.870 Y102.893 E0.01716*105
<< ok
>> N189 G1 X127.107 Y114.130 E0.50477*103
<< ok
>> N190 M105*47
<< ok T:215.3 /215.0 B:60.7 /60.0 T0:215.3 /215.0 @:28 B@:18 P:46.3 A:35.5
>> N191 G1 X127.648 Y114.130 E0.01716*98
<< ok
>> N192 G1 X115.870 Y102.352 E0.52904*111
<< ok
>> N193 G1 X115.870 Y101.812 E0.01716*105
<< ok
>> N194 G1 X128.188 Y114.130 E0.55330*98
<< ok
>> N195 G1 X128.728 Y114.130 E0.01716*110
<< ok
>> N196 G1 X115.870 Y101.272 E0.57757*102
<< ok
>> N197 G1 X115.870 Y100.732 E0.01716*97
<< ok
>> N198 G1 X129.268 Y114.130 E0.60184*105
<< ok
>> N199 G1 X129.808 Y114.130 E0.01716*110
<< ok
>> N200 G1 X115.870 Y100.192 E0.62610*98
<< ok
>> N201 G1 X115.870 Y99.651 E0.01716*88
<< ok
>> N202 G1 X130.349 Y114.130 E0.65037*111
<< ok
>> N203 G1 X130.889 Y114.130 E0.01716*111
<< ok
>> N204 G1 X115.870 Y99.111 E0.67463*95
<< ok
>> N205 G1 X115.870 Y98.571 E0.01716*92
<< ok
>> N206 G1 X131.429 Y114.130 E0.69890*98
<< ok
>> N207 G1 X131.969 Y114.130 E0.01716*101
<< ok
>> N208 M105*45
<< ok T:214.7 /215.0 B:60.6 /60.0 T0:214.7 /215.0 @:38 B@:12 P:46.2 A:35.9
>> N209 G1 X115.870 Y98.031 E0.72316*81
<< ok
>> N210 G1 X115.870 Y97.491 E0.01716*88
<< ok
>> N211 G1 X132.509 Y114.130 E0.74743*105
<< ok
>> N212 G1 X133.050 Y114.130 E0.01716*96
<< ok
>> N213 M105*39
<< ok T:215.1 /215.0 B:60.4 /60.0 T0:215.1 /215.0 @:32 B@:39 P:46.3 A:35.8
>> N214 M105*32
<< ok T:214.6 /215.0 B:60.5 /60.0 T0:214.6 /215.0 @:39 B@:14 P:46.3 A:36.3
>> N215 G28*21
<< echo:busy: processing
<< 0 step=61 mscnt= 989
<< tmc2130_goto_step 0 0 2 1000
<< step 61 mscnt = 984
<< dir=0 steps=-61
<< dir=1 steps=61
<< dir=0 steps=3
<< cnt 2 step 61 mscnt = 986
<< cnt 1 step 62 mscnt = 1004
<< cnt 0 step 63 mscnt = 1021
<< echo:busy: processing
<< echo:busy: processing
<< 0 step=34 mscnt= 547
<< tmc2130_goto_step 1 0 2 1000
<< step 34 mscnt = 552
<< dir=1 steps=-34
<< dir=0 steps=34
<< dir=1 steps=30
<< cnt 29 step 34 mscnt = 554
<< cnt 28 step 35 mscnt = 573
<< cnt 27 step 36 mscnt = 589
<< cnt 26 step 37 mscnt = 604
<< cnt 25 step 38 mscnt = 621
<< cnt 24 step 39 mscnt = 636
<< cnt 23 step 40 mscnt = 652
<< cnt 22 step 41 mscnt = 668
<< cnt 21 step 42 mscnt = 684
<< cnt 20 step 43 mscnt = 701
<< cnt 19 step 44 mscnt = 717
<< cnt 18 step 45 mscnt = 733
<< cnt 17 step 46 mscnt = 749
<< cnt 16 step 47 mscnt = 765
<< cnt 15 step 48 mscnt = 781
<< cnt 14 step 49 mscnt = 796
<< cnt 13 step 50 mscnt = 812
<< cnt 12 step 51 mscnt = 829
<< cnt 11 step 52 mscnt = 844
<< cnt 10 step 53 mscnt = 860
<< cnt 9 step 54 mscnt = 876
<< cnt 8 step 55 mscnt = 893
<< cnt 7 step 56 mscnt = 909
<< cnt 6 step 57 mscnt = 925
<< cnt 5 step 58 mscnt = 941
<< cnt 4 step 59 mscnt = 957
<< cnt 3 step 60 mscnt = 973
<< cnt 2 step 61 mscnt = 989
<< cnt 1 step 62 mscnt = 1005
<< cnt 0 step 63 mscnt = 1021
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< echo:busy: processing
<< ok
>> N216 M105*34
<< ok T:214.8 /215.0 B:60.2 /60.0 T0:214.8 /215.0 @:33 B@:27 P:46.0 A:36.1
>> N217 M105*35
<< ok T:214.8 /215.0 B:60.2 /60.0 T0:214.8 /215.0 @:33 B@:27 P:46.0 A:36.1
>> N218 M105*44
<< ok T:214.9 /215.0 B:60.1 /60.0 T0:214.9 /215.0 @:31 B@:33 P:45.9 A:36.1
>> N219 M105*45
<< ok T:214.9 /215.0 B:60.1 /60.0 T0:214.9 /215.0 @:31 B@:33 P:45.9 A:36.1
>> N220 M105*39
<< ok T:214.9 /215.0 B:60.1 /60.0 T0:214.9 /215.0 @:31 B@:33 P:45.9 A:36.1
>> N221 M105*38
<< ok T:214.9 /215.0 B:60.1 /60.0 T0:214.9 /215.0 @:31 B@:33 P:45.9 A:36.1
>> N222 M105*37
<< ok T:214.9 /215.0 B:60.1 /60.0 T0:214.9 /215.0 @:31 B@:33 P:45.9 A:36.1
>> N223 M105*36
<< ok T:214.5 /215.0 B:60.1 /60.0 T0:214.5 /215.0 @:38 B@:31 P:46.0 A:36.3
DISCONNECTED

146
src/CMakeLists.txt Normal file
View file

@ -0,0 +1,146 @@
project(Slic3r-native)
add_subdirectory(admesh)
add_subdirectory(avrdude)
# boost/nowide
add_subdirectory(boost)
add_subdirectory(clipper)
add_subdirectory(miniz)
add_subdirectory(polypartition)
add_subdirectory(poly2tri)
add_subdirectory(qhull)
add_subdirectory(Shiny)
add_subdirectory(semver)
# Adding libnest2d project for bin packing...
set(LIBNEST2D_UNITTESTS ON CACHE BOOL "Force generating unittests for libnest2d")
add_subdirectory(libnest2d)
include_directories(${LIBDIR}/qhull/src)
#message(STATUS ${LIBDIR}/qhull/src)
# ##############################################################################
# Configure rasterizer target
# ##############################################################################
find_package(PNG QUIET)
option(RASTERIZER_FORCE_BUILTIN_LIBPNG "Force the usage of builting libpng instead of the system version." OFF)
if(PNG_FOUND AND NOT RASTERIZER_FORCE_BUILTIN_LIBPNG)
message(STATUS "Using system libpng.")
else()
set(ZLIB_LIBRARY "")
message(WARNING "Using builtin libpng. This can cause crashes on some platforms.")
add_subdirectory(png/zlib)
set(ZLIB_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/png/zlib ${CMAKE_CURRENT_BINARY_DIR}/png/zlib)
include_directories(${ZLIB_INCLUDE_DIR})
add_subdirectory(png/libpng)
set_target_properties(zlibstatic PROPERTIES POSITION_INDEPENDENT_CODE ON)
set_target_properties(png_static PROPERTIES POSITION_INDEPENDENT_CODE ON)
set(PNG_LIBRARIES png_static zlibstatic)
set(PNG_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/png/libpng ${CMAKE_CURRENT_BINARY_DIR}/png/libpng)
endif()
add_subdirectory(libslic3r)
if (SLIC3R_GUI)
message(STATUS "WXWIN environment set to: $ENV{WXWIN}")
find_package(wxWidgets REQUIRED COMPONENTS base core adv html gl)
include(${wxWidgets_USE_FILE})
endif()
add_subdirectory(slic3r)
# Create a slic3r executable
# Process mainfests for various platforms.
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/slic3r.rc.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/msw/slic3r.manifest.in ${CMAKE_CURRENT_BINARY_DIR}/slic3r.manifest @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/platform/osx/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/Info.plist @ONLY)
add_executable(slic3r slic3r.cpp ${CMAKE_CURRENT_BINARY_DIR}/slic3r.rc)
if(SLIC3R_GUI)
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-gui")
else()
set_target_properties(slic3r PROPERTIES OUTPUT_NAME "slic3r-console")
endif()
target_link_libraries(slic3r libslic3r)
if (APPLE)
# add_compile_options(-stdlib=libc++)
# add_definitions(-DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_NO_CXX11_RVALUE_REFERENCES -DBOOST_THREAD_USES_MOVE)
# -liconv: boost links to libiconv by default
target_link_libraries(slic3r "-liconv -framework IOKit" "-framework CoreFoundation" -lc++)
elseif (MSVC)
# Manifest is provided through slic3r.rc, don't generate your own.
set(CMAKE_EXE_LINKER_FLAGS /MANIFEST:NO)
else ()
target_link_libraries(slic3r -ldl -lstdc++)
endif ()
# Add the Slic3r GUI library, libcurl, OpenGL and GLU libraries.
if (SLIC3R_GUI)
target_link_libraries(slic3r libslic3r_gui ${wxWidgets_LIBRARIES})
# Configure libcurl & OpenSSL
find_package(CURL REQUIRED)
target_include_directories(slic3r PRIVATE ${CURL_INCLUDE_DIRS})
target_link_libraries(slic3r CURL::libcurl)
if (SLIC3R_STATIC)
if (NOT APPLE)
# libcurl is always linked dynamically to the system libcurl on OSX.
# On other systems, libcurl is linked statically if SLIC3R_STATIC is set.
target_compile_definitions(slic3r PRIVATE CURL_STATICLIB)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# As of now, our build system produces a statically linked libcurl,
# which links the OpenSSL library dynamically.
find_package(OpenSSL REQUIRED)
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
target_include_directories(slic3r PRIVATE ${OPENSSL_INCLUDE_DIR})
target_link_libraries(slic3r ${OPENSSL_LIBRARIES})
endif()
endif()
if (MSVC)
target_link_libraries(slic3r user32.lib Setupapi.lib OpenGL32.Lib GlU32.Lib)
elseif (MINGW)
target_link_libraries(slic3r -lopengl32)
elseif (APPLE)
target_link_libraries(slic3r "-framework OpenGL")
else ()
target_link_libraries(slic3r -ldl -lGL -lGLU)
endif ()
endif ()
# Link the resources dir to where Slic3r GUI expects it
if (MSVC)
if (CMAKE_CONFIGURATION_TYPES)
foreach (CONF ${CMAKE_CONFIGURATION_TYPES})
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CONF}" WIN_CONF_OUTPUT_DIR)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${CONF}/resources" WIN_RESOURCES_SYMLINK)
add_custom_command(TARGET slic3r POST_BUILD
COMMAND if exist "${WIN_CONF_OUTPUT_DIR}" "("
if not exist "${WIN_RESOURCES_SYMLINK}" "("
mklink /J "${WIN_RESOURCES_SYMLINK}" "${SLIC3R_RESOURCES_DIR_WIN}"
")"
")"
COMMENT "Symlinking the resources directory into the build tree"
VERBATIM
)
endforeach ()
else ()
file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/resources" WIN_RESOURCES_SYMLINK)
add_custom_command(TARGET slic3r POST_BUILD
COMMAND if not exist "${WIN_RESOURCES_SYMLINK}" "(" mklink /J "${WIN_RESOURCES_SYMLINK}" "${SLIC3R_RESOURCES_DIR_WIN}" ")"
COMMENT "Symlinking the resources directory into the build tree"
VERBATIM
)
endif ()
else ()
add_custom_command(TARGET slic3r POST_BUILD
COMMAND ln -sf "${SLIC3R_RESOURCES_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/../resources"
COMMENT "Symlinking the resources directory into the build tree"
VERBATIM
)
endif()

25
src/Shiny/CMakeLists.txt Normal file
View file

@ -0,0 +1,25 @@
project(Shiny)
cmake_minimum_required(VERSION 2.6)
add_library(Shiny STATIC
Shiny.h
ShinyConfig.h
ShinyData.h
ShinyMacros.h
ShinyManager.c
ShinyManager.h
ShinyNode.c
ShinyNode.h
ShinyNodePool.c
ShinyNodePool.h
ShinyNodeState.c
ShinyNodeState.h
ShinyOutput.c
ShinyOutput.h
ShinyPrereqs.h
ShinyTools.c
ShinyTools.h
ShinyVersion.h
ShinyZone.c
ShinyZone.h
)

12
src/admesh/CMakeLists.txt Normal file
View file

@ -0,0 +1,12 @@
project(admesh)
cmake_minimum_required(VERSION 2.6)
add_library(admesh STATIC
connect.cpp
normals.cpp
shared.cpp
stl.h
stl_io.cpp
stlinit.cpp
util.cpp
)

View file

@ -25,6 +25,9 @@
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <boost/detail/endian.hpp>
#include "stl.h"
@ -125,11 +128,11 @@ stl_load_edge_exact(stl_file *stl, stl_hash_edge *edge,
std::swap(a, b);
edge->which_edge += 3; /* this edge is loaded backwards */
}
memcpy(&edge->key[0], a->data(), sizeof(stl_vertex));
memcpy(&edge->key[sizeof(stl_vertex)], b->data(), sizeof(stl_vertex));
memcpy(&edge->key[0], a->data(), sizeof(stl_vertex));
memcpy(&edge->key[3], b->data(), sizeof(stl_vertex));
// Switch negative zeros to positive zeros, so memcmp will consider them to be equal.
for (size_t i = 0; i < 6; ++ i) {
unsigned char *p = edge->key + i * 4;
unsigned char *p = (unsigned char*)(edge->key + i);
#ifdef BOOST_LITTLE_ENDIAN
if (p[0] == 0 && p[1] == 0 && p[2] == 0 && p[3] == 0x80)
// Negative zero, switch to positive zero.
@ -142,6 +145,16 @@ stl_load_edge_exact(stl_file *stl, stl_hash_edge *edge,
}
}
static inline size_t hash_size_from_nr_faces(const size_t nr_faces)
{
// Good primes for addressing a cca. 30 bit space.
// https://planetmath.org/goodhashtableprimes
static std::vector<uint32_t> primes{ 98317, 196613, 393241, 786433, 1572869, 3145739, 6291469, 12582917, 25165843, 50331653, 100663319, 201326611, 402653189, 805306457, 1610612741 };
// Find a prime number for 50% filling of the shared triangle edges in the mesh.
auto it = std::upper_bound(primes.begin(), primes.end(), nr_faces * 3 * 2 - 1);
return (it == primes.end()) ? primes.back() : *it;
}
static void
stl_initialize_facet_check_exact(stl_file *stl) {
int i;
@ -152,10 +165,9 @@ stl_initialize_facet_check_exact(stl_file *stl) {
stl->stats.freed = 0;
stl->stats.collisions = 0;
stl->M = hash_size_from_nr_faces(stl->stats.number_of_facets);
stl->M = 81397;
for(i = 0; i < stl->stats.number_of_facets ; i++) {
for (i = 0; i < stl->stats.number_of_facets ; i++) {
/* initialize neighbors list to -1 to mark unconnected edges */
stl->neighbors_start[i].neighbor[0] = -1;
stl->neighbors_start[i].neighbor[1] = -1;
@ -296,11 +308,11 @@ static int stl_load_edge_nearby(stl_file *stl, stl_hash_edge *edge, stl_vertex *
((vertex1[1] != vertex2[1]) ?
(vertex1[1] < vertex2[1]) :
(vertex1[2] < vertex2[2]))) {
memcpy(&edge->key[0], vertex1.data(), sizeof(stl_vertex));
memcpy(&edge->key[sizeof(stl_vertex)], vertex2.data(), sizeof(stl_vertex));
memcpy(&edge->key[0], vertex1.data(), sizeof(stl_vertex));
memcpy(&edge->key[3], vertex2.data(), sizeof(stl_vertex));
} else {
memcpy(&edge->key[0], vertex2.data(), sizeof(stl_vertex));
memcpy(&edge->key[sizeof(stl_vertex)], vertex1.data(), sizeof(stl_vertex));
memcpy(&edge->key[0], vertex2.data(), sizeof(stl_vertex));
memcpy(&edge->key[3], vertex1.data(), sizeof(stl_vertex));
edge->which_edge += 3; /* this edge is loaded backwards */
}
return 1;
@ -338,7 +350,7 @@ static void stl_initialize_facet_check_nearby(stl_file *stl)
/* tolerance = STL_MAX((stl->stats.bounding_diameter / 500000.0), tolerance);*/
/* tolerance *= 0.5;*/
stl->M = 81397;
stl->M = hash_size_from_nr_faces(stl->stats.number_of_facets);
stl->heads = (stl_hash_edge**)calloc(stl->M, sizeof(*stl->heads));
if(stl->heads == NULL) perror("stl_initialize_facet_check_nearby");

View file

@ -65,11 +65,11 @@ typedef struct {
typedef struct stl_hash_edge {
// Key of a hash edge: sorted vertices of the edge.
unsigned char key[2 * sizeof(stl_vertex)];
uint32_t key[6];
// Compare two keys.
bool operator==(const stl_hash_edge &rhs) { return memcmp(key, rhs.key, sizeof(key)) == 0; }
bool operator!=(const stl_hash_edge &rhs) { return ! (*this == rhs); }
int hash(int M) const { return ((key[0] / 23 + key[1] / 19 + key[2] / 17 + key[3] /13 + key[4] / 11 + key[5] / 7 ) % M); }
int hash(int M) const { return ((key[0] / 11 + key[1] / 7 + key[2] / 3) ^ (key[3] / 11 + key[4] / 7 + key[5] / 3)) % M; }
// Index of a facet owning this edge.
int facet_number;
// Index of this edge inside the facet with an index of facet_number.

Some files were not shown because too many files have changed in this diff Show more