diff --git a/.gitignore b/.gitignore index d56825aca..efeaa91b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ Build Build.bat +/build/ MYMETA.json MYMETA.yml _build @@ -11,3 +12,5 @@ xs/MANIFEST.bak xs/assertlib* .init_bundle.ini local-lib +/src/TAGS +/.vscode/ diff --git a/CMakeLists.txt b/CMakeLists.txt index b8b9add60..268380dc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -389,10 +389,13 @@ find_package(CURL REQUIRED) add_library(libcurl INTERFACE) target_link_libraries(libcurl INTERFACE CURL::libcurl) +# Fixing curl's cmake config script bugs if (NOT WIN32) # Required by libcurl find_package(ZLIB REQUIRED) target_link_libraries(libcurl INTERFACE ZLIB::ZLIB) +else() + target_link_libraries(libcurl INTERFACE crypt32) endif() if (SLIC3R_STATIC) diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake index 3b60ac9d3..4fde5fa4a 100644 --- a/cmake/modules/FindOpenVDB.cmake +++ b/cmake/modules/FindOpenVDB.cmake @@ -347,7 +347,7 @@ macro(just_fail msg) return() endmacro() -find_package(IlmBase QUIET COMPONENTS Half) +find_package(IlmBase QUIET) if(NOT IlmBase_FOUND) pkg_check_modules(IlmBase QUIET IlmBase) endif() diff --git a/deps/Blosc/Blosc.cmake b/deps/Blosc/Blosc.cmake new file mode 100644 index 000000000..45c45c7c9 --- /dev/null +++ b/deps/Blosc/Blosc.cmake @@ -0,0 +1,28 @@ +if(BUILD_SHARED_LIBS) + set(_build_shared ON) + set(_build_static OFF) +else() + set(_build_shared OFF) + set(_build_static ON) +endif() + +prusaslicer_add_cmake_project(Blosc + #URL https://github.com/Blosc/c-blosc/archive/refs/tags/v1.17.0.zip + #URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9 + URL https://github.com/tamasmeszaros/c-blosc/archive/refs/heads/v1.17.0_tm.zip + URL_HASH SHA256=dcb48bf43a672fa3de6a4b1de2c4c238709dad5893d1e097b8374ad84b1fc3b3 + DEPENDS ${ZLIB_PKG} + # Patching upstream does not work this way with git version 2.28 installed on mac worker + # PATCH_COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/blosc-mods.patch + CMAKE_ARGS + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DBUILD_SHARED=${_build_shared} + -DBUILD_STATIC=${_build_static} + -DBUILD_TESTS=OFF + -DBUILD_BENCHMARKS=OFF + -DPREFER_EXTERNAL_ZLIB=ON +) + +if (MSVC) + add_debug_dep(dep_Blosc) +endif () \ No newline at end of file diff --git a/deps/blosc-mods.patch b/deps/Blosc/blosc-mods.patch similarity index 100% rename from deps/blosc-mods.patch rename to deps/Blosc/blosc-mods.patch diff --git a/deps/Boost/Boost.cmake b/deps/Boost/Boost.cmake new file mode 100644 index 000000000..ae2bd9646 --- /dev/null +++ b/deps/Boost/Boost.cmake @@ -0,0 +1,150 @@ +include(ExternalProject) + +if (WIN32) + set(_bootstrap_cmd bootstrap.bat) + set(_build_cmd b2.exe) +else() + set(_bootstrap_cmd ./bootstrap.sh) + set(_build_cmd ./b2) +endif() + +set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/common.jam ./tools/build/src/tools/common.jam) + +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + configure_file(${CMAKE_CURRENT_LIST_DIR}/user-config.jam boost-user-config.jam) + set(_boost_toolset gcc) + set(_patch_command ${_patch_command} && ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/boost-user-config.jam ./tools/build/src/tools/user-config.jam) +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html + if (MSVC_VERSION EQUAL 1800) + # 1800 = VS 12.0 (v120 toolset) + set(_boost_toolset "msvc-12.0") + elseif (MSVC_VERSION EQUAL 1900) + # 1900 = VS 14.0 (v140 toolset) + set(_boost_toolset "msvc-14.0") + elseif (MSVC_VERSION LESS 1920) + # 1910-1919 = VS 15.0 (v141 toolset) + set(_boost_toolset "msvc-14.1") + elseif (MSVC_VERSION LESS 1930) + # 1920-1929 = VS 16.0 (v142 toolset) + set(_boost_toolset "msvc-14.2") + else () + message(FATAL_ERROR "Unsupported MSVC version") + endif () +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + if (WIN32) + set(_boost_toolset "clang-win") + else() + set(_boost_toolset "clang") + endif() +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + set(_boost_toolset "intel") +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + set(_boost_toolset "clang") +endif() + +message(STATUS "Deduced boost toolset: ${_boost_toolset} based on ${CMAKE_CXX_COMPILER_ID} compiler") + +set(_libs "") +foreach(_comp ${DEP_Boost_COMPONENTS}) + list(APPEND _libs "--with-${_comp}") +endforeach() + +if (BUILD_SHARED_LIBS) + set(_link shared) +else() + set(_link static) +endif() + +set(_bits "") +if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") + set(_bits 64) +elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") + set(_bits 32) +endif () + +include(ProcessorCount) +ProcessorCount(NPROC) +file(TO_NATIVE_PATH ${DESTDIR}/usr/local/ _prefix) + +set(_boost_flags "") +if (UNIX) + set(_boost_flags "cflags=-fPIC;cxxflags=-fPIC") +elseif(APPLE) + set(_boost_flags + "cflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};" + "cxxflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};" + "mflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET};" + "mmflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}") +endif() + +set(_boost_variants "") +if(CMAKE_BUILD_TYPE) + list(APPEND CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE}) + list(REMOVE_DUPLICATES CMAKE_CONFIGURATION_TYPES) +endif() +list(FIND CMAKE_CONFIGURATION_TYPES "Release" _cfg_rel) +list(FIND CMAKE_CONFIGURATION_TYPES "RelWithDebInfo" _cfg_relwdeb) +list(FIND CMAKE_CONFIGURATION_TYPES "MinSizeRel" _cfg_minsizerel) +list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _cfg_deb) + +if (_cfg_rel GREATER -1 OR _cfg_relwdeb GREATER -1 OR _cfg_minsizerel GREATER -1) + list(APPEND _boost_variants release) +endif() + +if (_cfg_deb GREATER -1 OR (MSVC AND ${DEP_DEBUG}) ) + list(APPEND _boost_variants debug) +endif() + +if (NOT _boost_variants) + set(_boost_variants release) +endif() + +set(_build_cmd ${_build_cmd} + ${_boost_flags} + -j${NPROC} + ${_libs} + --layout=versioned + --debug-configuration + toolset=${_boost_toolset} + address-model=${_bits} + link=${_link} + threading=multi + boost.locale.icu=off + --disable-icu + ${_boost_variants} + stage) + +set(_install_cmd ${_build_cmd} --prefix=${_prefix} install) + +ExternalProject_Add( + dep_Boost + URL "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz" + URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/Boost + CONFIGURE_COMMAND "${_bootstrap_cmd}" + PATCH_COMMAND ${_patch_command} + BUILD_COMMAND "${_build_cmd}" + BUILD_IN_SOURCE ON + INSTALL_COMMAND "${_install_cmd}" +) + +if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") + # Patch the boost::polygon library with a custom one. + ExternalProject_Add(dep_boost_polygon + EXCLUDE_FROM_ALL ON + # GIT_REPOSITORY "https://github.com/prusa3d/polygon" + # GIT_TAG prusaslicer_gmp + URL https://github.com/prusa3d/polygon/archive/refs/heads/prusaslicer_gmp.zip + URL_HASH SHA256=abeb9710f0a7069fb9b22181ae5c56f6066002f125db210e7ffb27032aed6824 + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/boost_polygon + DEPENDS dep_Boost + CONFIGURE_COMMAND "" + BUILD_COMMAND "" + INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon" + "${DESTDIR}/usr/local/include/boost/polygon" + ) + # Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms. + list(APPEND _dep_list "dep_boost_polygon") +endif () \ No newline at end of file diff --git a/deps/Boost/common.jam b/deps/Boost/common.jam new file mode 100644 index 000000000..75d995aa1 --- /dev/null +++ b/deps/Boost/common.jam @@ -0,0 +1,1095 @@ +# Copyright 2003, 2005 Dave Abrahams +# Copyright 2005, 2006 Rene Rivera +# Copyright 2005 Toon Knapen +# Copyright 2002, 2003, 2004, 2005, 2006 Vladimir Prus +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) + +# Provides actions common to all toolsets, such as creating directories and +# removing files. + +import os ; +import modules ; +import utility ; +import print ; +import type ; +import feature ; +import errors ; +import path ; +import sequence ; +import toolset ; +import virtual-target ; +import numbers ; + +if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] +{ + .debug-configuration = true ; +} +if [ MATCH (--show-configuration) : [ modules.peek : ARGV ] ] +{ + .show-configuration = true ; +} + +# Configurations +# +# The following class helps to manage toolset configurations. Each configuration +# has a unique ID and one or more parameters. A typical example of a unique ID +# is a condition generated by 'common.check-init-parameters' rule. Other kinds +# of IDs can be used. Parameters may include any details about the configuration +# like 'command', 'path', etc. +# +# A toolset configuration may be in one of the following states: +# +# - registered +# Configuration has been registered (e.g. explicitly or by auto-detection +# code) but has not yet been marked as used, i.e. 'toolset.using' rule has +# not yet been called for it. +# - used +# Once called 'toolset.using' rule marks the configuration as 'used'. +# +# The main difference between the states above is that while a configuration is +# 'registered' its options can be freely changed. This is useful in particular +# for autodetection code - all detected configurations may be safely overwritten +# by user code. + +class configurations +{ + import errors ; + + rule __init__ ( ) + { + } + + # Registers a configuration. + # + # Returns 'true' if the configuration has been added and an empty value if + # it already exists. Reports an error if the configuration is 'used'. + # + rule register ( id ) + { + if $(id) in $(self.used) + { + errors.error "common: the configuration '$(id)' is in use" ; + } + + local retval ; + + if ! $(id) in $(self.all) + { + self.all += $(id) ; + + # Indicate that a new configuration has been added. + retval = true ; + } + + return $(retval) ; + } + + # Mark a configuration as 'used'. + # + # Returns 'true' if the state of the configuration has been changed to + # 'used' and an empty value if it the state has not been changed. Reports an + # error if the configuration is not known. + # + rule use ( id ) + { + if ! $(id) in $(self.all) + { + errors.error "common: the configuration '$(id)' is not known" ; + } + + local retval ; + + if ! $(id) in $(self.used) + { + self.used += $(id) ; + + # Indicate that the configuration has been marked as 'used'. + retval = true ; + } + + return $(retval) ; + } + + # Return all registered configurations. + # + rule all ( ) + { + return $(self.all) ; + } + + # Return all used configurations. + # + rule used ( ) + { + return $(self.used) ; + } + + # Returns the value of a configuration parameter. + # + rule get ( id : param ) + { + return $(self.$(param).$(id)) ; + } + + # Sets the value of a configuration parameter. + # + rule set ( id : param : value * ) + { + self.$(param).$(id) = $(value) ; + } +} + + +# The rule for checking toolset parameters. Trailing parameters should all be +# parameter name/value pairs. The rule will check that each parameter either has +# a value in each invocation or has no value in each invocation. Also, the rule +# will check that the combination of all parameter values is unique in all +# invocations. +# +# Each parameter name corresponds to a subfeature. This rule will declare a +# subfeature the first time a non-empty parameter value is passed and will +# extend it with all the values. +# +# The return value from this rule is a condition to be used for flags settings. +# +rule check-init-parameters ( toolset requirement * : * ) +{ + local sig = $(toolset) ; + local condition = $(toolset) ; + local subcondition ; + for local index in 2 3 4 5 6 7 8 9 + { + local name = $($(index)[1]) ; + local value = $($(index)[2]) ; + + if $(value)-is-not-empty + { + condition = $(condition)-$(value) ; + if $(.had-unspecified-value.$(toolset).$(name)) + { + errors.user-error + "$(toolset) initialization: parameter '$(name)'" + "inconsistent" : "no value was specified in earlier" + "initialization" : "an explicit value is specified now" ; + } + # The below logic is for intel compiler. It calls this rule with + # 'intel-linux' and 'intel-win' as toolset, so we need to get the + # base part of toolset name. We can not pass 'intel' as toolset + # because in that case it will be impossible to register versionless + # intel-linux and intel-win toolsets of a specific version. + local t = $(toolset) ; + local m = [ MATCH "([^-]*)-" : $(toolset) ] ; + if $(m) + { + t = $(m[1]) ; + } + if ! $(.had-value.$(toolset).$(name)) + { + if ! $(.declared-subfeature.$(t).$(name)) + { + feature.subfeature toolset $(t) : $(name) : : propagated ; + .declared-subfeature.$(t).$(name) = true ; + } + .had-value.$(toolset).$(name) = true ; + } + feature.extend-subfeature toolset $(t) : $(name) : $(value) ; + subcondition += $(value) ; + } + else + { + if $(.had-value.$(toolset).$(name)) + { + errors.user-error + "$(toolset) initialization: parameter '$(name)'" + "inconsistent" : "an explicit value was specified in an" + "earlier initialization" : "no value is specified now" ; + } + .had-unspecified-value.$(toolset).$(name) = true ; + } + sig = $(sig)$(value:E="")- ; + } + # We also need to consider requirements on the toolset as we can + # configure the same toolset multiple times with different options that + # are selected with the requirements. + if $(requirement) + { + sig = $(sig)$(requirement:J=,) ; + } + if $(sig) in $(.all-signatures) + { + local message = + "duplicate initialization of $(toolset) with the following parameters: " ; + for local index in 2 3 4 5 6 7 8 9 + { + local p = $($(index)) ; + if $(p) + { + message += "$(p[1]) = $(p[2]:E=)" ; + } + } + message += "previous initialization at $(.init-loc.$(sig))" ; + errors.user-error + $(message[1]) : $(message[2]) : $(message[3]) : $(message[4]) : + $(message[5]) : $(message[6]) : $(message[7]) : $(message[8]) ; + } + .all-signatures += $(sig) ; + .init-loc.$(sig) = [ errors.nearest-user-location ] ; + + # If we have a requirement, this version should only be applied under that + # condition. To accomplish this we add a toolset requirement that imposes + # the toolset subcondition, which encodes the version. + if $(requirement) + { + local r = $(toolset) $(requirement) ; + r = $(r:J=,) ; + toolset.add-requirements "$(r):$(subcondition)" ; + } + + # We add the requirements, if any, to the condition to scope the toolset + # variables and options to this specific version. + condition += $(requirement) ; + + if $(.show-configuration) + { + ECHO "notice:" $(condition) ; + } + return $(condition:J=/) ; +} + + +# A helper rule to get the command to invoke some tool. If +# 'user-provided-command' is not given, tries to find binary named 'tool' in +# PATH and in the passed 'additional-path'. Otherwise, verifies that the first +# element of 'user-provided-command' is an existing program. +# +# This rule returns the command to be used when invoking the tool. If we can not +# find the tool, a warning is issued. If 'path-last' is specified, PATH is +# checked after 'additional-paths' when searching for 'tool'. +# +rule get-invocation-command-nodefault ( toolset : tool : + user-provided-command * : additional-paths * : path-last ? ) +{ + local command ; + if ! $(user-provided-command) + { + command = [ find-tool $(tool) : $(additional-paths) : $(path-last) ] ; + if ! $(command) && $(.debug-configuration) + { + ECHO "warning:" toolset $(toolset) "initialization:" can not find tool + $(tool) ; + ECHO "warning:" initialized from [ errors.nearest-user-location ] ; + } + } + else + { + command = [ check-tool $(user-provided-command) ] ; + if ! $(command) && $(.debug-configuration) + { + ECHO "warning:" toolset $(toolset) "initialization:" ; + ECHO "warning:" can not find user-provided command + '$(user-provided-command)' ; + ECHO "warning:" initialized from [ errors.nearest-user-location ] ; + } + } + + return $(command) ; +} + + +# Same as get-invocation-command-nodefault, except that if no tool is found, +# returns either the user-provided-command, if present, or the 'tool' parameter. +# +rule get-invocation-command ( toolset : tool : user-provided-command * : + additional-paths * : path-last ? ) +{ + local result = [ get-invocation-command-nodefault $(toolset) : $(tool) : + $(user-provided-command) : $(additional-paths) : $(path-last) ] ; + + if ! $(result) + { + if $(user-provided-command) + { + result = $(user-provided-command) ; + } + else + { + result = $(tool) ; + } + } + return $(result) ; +} + + +# Given an invocation command return the absolute path to the command. This +# works even if command has no path element and was found on the PATH. +# +rule get-absolute-tool-path ( command ) +{ + if $(command:D) + { + return $(command:D) ; + } + else + { + local m = [ GLOB [ modules.peek : PATH Path path ] : $(command) + $(command).exe ] ; + return $(m[1]:D) ; + } +} + + +# Attempts to find tool (binary) named 'name' in PATH and in 'additional-paths'. +# If found in PATH, returns 'name' and if found in additional paths, returns +# absolute name. If the tool is found in several directories, returns the first +# path found. Otherwise, returns an empty string. If 'path-last' is specified, +# PATH is searched after 'additional-paths'. +# +rule find-tool ( name : additional-paths * : path-last ? ) +{ + if $(name:D) + { + return [ check-tool-aux $(name) ] ; + } + local path = [ path.programs-path ] ; + local match = [ path.glob $(path) : $(name) $(name).exe ] ; + local additional-match = [ path.glob $(additional-paths) : $(name) + $(name).exe ] ; + + local result ; + if $(path-last) + { + result = $(additional-match) ; + if ! $(result) && $(match) + { + result = $(name) ; + } + } + else + { + if $(match) + { + result = $(name) ; + } + else + { + result = $(additional-match) ; + } + } + if $(result) + { + return [ path.native $(result[1]) ] ; + } +} + +# Checks if 'command' can be found either in path or is a full name to an +# existing file. +# +local rule check-tool-aux ( command ) +{ + if $(command:D) + { + if [ path.exists $(command) ] + # Both NT and Cygwin will run .exe files by their unqualified names. + || ( [ os.on-windows ] && [ path.exists $(command).exe ] ) + # Only NT will run .bat & .cmd files by their unqualified names. + || ( ( [ os.name ] = NT ) && ( [ path.exists $(command).bat ] || + [ path.exists $(command).cmd ] ) ) + { + return $(command) ; + } + } + else + { + if [ GLOB [ modules.peek : PATH Path path ] : $(command) ] + { + return $(command) ; + } + } +} + + +# Checks that a tool can be invoked by 'command'. If command is not an absolute +# path, checks if it can be found in 'path'. If command is an absolute path, +# check that it exists. Returns 'command' if ok or empty string otherwise. +# +local rule check-tool ( xcommand + ) +{ + if [ check-tool-aux $(xcommand[1]) ] || + [ check-tool-aux $(xcommand[-1]) ] + { + return $(xcommand) ; + } +} + + +# Handle common options for toolset, specifically sets the following flag +# variables: +# - CONFIG_COMMAND to $(command) +# - OPTIONS for compile to the value of in $(options) +# - OPTIONS for compile.c to the value of in $(options) +# - OPTIONS for compile.c++ to the value of in $(options) +# - OPTIONS for compile.asm to the value of in $(options) +# - OPTIONS for compile.fortran to the value of in $(options) +# - OPTIONS for link to the value of in $(options) +# +rule handle-options ( toolset : condition * : command * : options * ) +{ + if $(.debug-configuration) + { + ECHO "notice:" will use '$(command)' for $(toolset), condition + $(condition:E=(empty)) ; + } + + # The last parameter ('unchecked') says it is OK to set flags for another + # module. + toolset.flags $(toolset) CONFIG_COMMAND $(condition) : $(command) + : unchecked ; + + toolset.flags $(toolset).compile OPTIONS $(condition) : + [ feature.get-values : $(options) ] : unchecked ; + + toolset.flags $(toolset).compile.c OPTIONS $(condition) : + [ feature.get-values : $(options) ] : unchecked ; + + toolset.flags $(toolset).compile.c++ OPTIONS $(condition) : + [ feature.get-values : $(options) ] : unchecked ; + + toolset.flags $(toolset).compile.asm OPTIONS $(condition) : + [ feature.get-values : $(options) ] : unchecked ; + + toolset.flags $(toolset).compile.fortran OPTIONS $(condition) : + [ feature.get-values : $(options) ] : unchecked ; + + toolset.flags $(toolset).link OPTIONS $(condition) : + [ feature.get-values : $(options) ] : unchecked ; +} + + +# Returns the location of the "program files" directory on a Windows platform. +# +rule get-program-files-dir ( ) +{ + local ProgramFiles = [ modules.peek : ProgramFiles ] ; + if $(ProgramFiles) + { + ProgramFiles = "$(ProgramFiles:J= )" ; + } + else + { + ProgramFiles = "c:\\Program Files" ; + } + return $(ProgramFiles) ; +} + + +if [ os.name ] = NT +{ + NULL_DEVICE = "NUL" ; + IGNORE = "2>$(NULL_DEVICE) >$(NULL_DEVICE) & setlocal" ; + RM = del /f /q ; + CP = copy /b ; + LN ?= $(CP) ; + # Ugly hack to convince copy to set the timestamp of the destination to the + # current time by concatenating the source with a nonexistent file. Note + # that this requires /b (binary) as the default when concatenating files is + # /a (ascii). + WINDOWS-CP-HACK = "+ this-file-does-not-exist-A698EE7806899E69" ; +} +else if [ os.name ] = VMS +{ + NULL_DEVICE = "NL:" ; + PIPE = PIPE ; + IGNORE = "2>$(NULL_DEVICE) >$(NULL_DEVICE)" ; + RM = DELETE /NOCONF ; + CP = COPY /OVERWRITE ; + LN = $(CP) ; +} +else +{ + NULL_DEVICE = "/dev/null" ; + IGNORE = "2>$(NULL_DEVICE) >$(NULL_DEVICE)" ; + RM = rm -f ; + CP = cp ; + LN = ln ; +} + +NULL_OUT = ">$(NULL_DEVICE)" ; + +rule null-device ( ) +{ + return $(NULL_DEVICE) ; +} + + +rule rm-command ( ) +{ + return $(RM) ; +} + + +rule copy-command ( ) +{ + return $(CP) ; +} + + +if "\n" = "n" +{ + # Escape characters not supported so use ugly hacks. Will not work on Cygwin + # - see below. + nl = " +" ; + q = "" ; +} +else +{ + nl = "\n" ; + q = "\"" ; +} + + +rule newline-char ( ) +{ + return $(nl) ; +} + + +# Returns the command needed to set an environment variable on the current +# platform. The variable setting persists through all following commands and is +# visible in the environment seen by subsequently executed commands. In other +# words, on Unix systems, the variable is exported, which is consistent with the +# only possible behavior on Windows systems. +# +rule variable-setting-command ( variable : value ) +{ + if [ os.name ] = NT + { + return "set $(variable)=$(value)$(nl)" ; + } + else if [ os.name ] = VMS + { + return "$(variable) == $(q)$(value)$(q)$(nl)" ; + } + else + { + # If we do not have escape character support in bjam, the cod below + # blows up on CYGWIN, since the $(nl) variable holds a Windows new-line + # \r\n sequence that messes up the executed export command which then + # reports that the passed variable name is incorrect. + # But we have a check for cygwin in kernel/bootstrap.jam already. + return "$(variable)=$(q)$(value)$(q)$(nl)export $(variable)$(nl)" ; + } +} + + +# Returns a command to sets a named shell path variable to the given NATIVE +# paths on the current platform. +# +rule path-variable-setting-command ( variable : paths * ) +{ + local sep = [ os.path-separator ] ; + return [ variable-setting-command $(variable) : $(paths:J=$(sep)) ] ; +} + + +# Returns a command that prepends the given paths to the named path variable on +# the current platform. +# +rule prepend-path-variable-command ( variable : paths * ) +{ + return [ path-variable-setting-command $(variable) + : $(paths) [ os.expand-variable $(variable) ] ] ; +} + + +# Return a command which can create a file. If 'r' is result of invocation, then +# 'r foobar' will create foobar with unspecified content. What happens if file +# already exists is unspecified. +# +rule file-creation-command ( ) +{ + if [ os.name ] = NT + { + # A few alternative implementations on Windows: + # + # 'type NUL >> ' + # That would construct an empty file instead of a file containing + # a space and an end-of-line marker but it would also not change + # the target's timestamp in case the file already exists. + # + # 'type NUL > ' + # That would construct an empty file instead of a file containing + # a space and an end-of-line marker but it would also destroy an + # already existing file by overwriting it with an empty one. + # + # I guess the best solution would be to allow Boost Jam to define + # built-in functions such as 'create a file', 'touch a file' or 'copy a + # file' which could be used from inside action code. That would allow + # completely portable operations without this kind of kludge. + # (22.02.2009.) (Jurko) + return "echo. > " ; + } + else if [ os.name ] = VMS + { + return "APPEND /NEW NL: " ; + } + else + { + return "touch " ; + } +} + + +# Returns a command that may be used for 'touching' files. It is not a real +# 'touch' command on NT because it adds an empty line at the end of file but it +# works with source files. +# +rule file-touch-command ( ) +{ + if [ os.name ] = NT + { + return "echo. >> " ; + } + else if [ os.name ] = VMS + { + return "APPEND /NEW NL: " ; + } + else + { + return "touch " ; + } +} + + +rule MkDir +{ + # If dir exists, do not update it. Do this even for $(DOT). + NOUPDATE $(<) ; + + if $(<) != $(DOT) && ! $($(<)-mkdir) + { + # Cheesy gate to prevent multiple invocations on same dir. + $(<)-mkdir = true ; + + # Schedule the mkdir build action. + common.mkdir $(<) ; + + # Prepare a Jam 'dirs' target that can be used to make the build only + # construct all the target directories. + DEPENDS dirs : $(<) ; + + # Recursively create parent directories. $(<:P) = $(<)'s parent & we + # recurse until root. + + local s = $(<:P) ; + if [ os.name ] = NT + { + switch $(s) + { + case "*:" : s = ; + case "*:\\" : s = ; + } + } + + if $(s) + { + if $(s) != $(<) + { + DEPENDS $(<) : $(s) ; + MkDir $(s) ; + } + else + { + NOTFILE $(s) ; + } + } + } +} + + +#actions MkDir1 +#{ +# mkdir "$(<)" +#} + +# The following quick-fix actions should be replaced using the original MkDir1 +# action once Boost Jam gets updated to correctly detect different paths leading +# up to the same filesystem target and triggers their build action only once. +# (todo) (04.07.2008.) (Jurko) + +if [ os.name ] = NT +{ + actions quietly mkdir + { + if not exist "$(<)\\" mkdir "$(<)" + } +} +else +{ + actions quietly mkdir + { + mkdir -p "$(<)" + } +} + + +actions piecemeal together existing Clean +{ + $(RM) "$(>)" +} + + +rule copy +{ +} + + +actions copy +{ + $(CP) "$(>)" $(WINDOWS-CP-HACK) "$(<)" +} + + +rule RmTemps +{ +} + + +actions quietly updated piecemeal together RmTemps +{ + $(RM) "$(>)" $(IGNORE) +} + + +actions hard-link +{ + $(RM) "$(<)" 2$(NULL_OUT) $(NULL_OUT) + $(LN) "$(>)" "$(<)" $(NULL_OUT) +} + + +if [ os.name ] = VMS +{ + actions mkdir + { + IF F$PARSE("$(<:W)") .EQS. "" THEN CREATE /DIR $(<:W) + } + + actions piecemeal together existing Clean + { + $(RM) $(>:WJ=;*,);* + } + + actions copy + { + $(CP) $(>:WJ=,) $(<:W) + } + + actions quietly updated piecemeal together RmTemps + { + $(PIPE) $(RM) $(>:WJ=;*,);* $(IGNORE) + } + + actions hard-link + { + $(PIPE) $(RM) $(>[1]:W);* $(IGNORE) + $(PIPE) $(LN) $(>[1]:W) $(<:W) $(NULL_OUT) + } +} + +# Given a target, as given to a custom tag rule, returns a string formatted +# according to the passed format. Format is a list of properties that is +# represented in the result. For each element of format the corresponding target +# information is obtained and added to the result string. For all, but the +# literal, the format value is taken as the as string to prepend to the output +# to join the item to the rest of the result. If not given "-" is used as a +# joiner. +# +# The format options can be: +# +# [joiner] +# :: The basename of the target name. +# [joiner] +# :: The abbreviated toolset tag being used to build the target. +# [joiner] +# :: Indication of a multi-threaded build. +# [joiner] +# :: Collective tag of the build runtime. +# [joiner] +# :: Short version tag taken from the given "version-feature" in the +# build properties. Or if not present, the literal value as the +# version number. +# [joiner] +# :: Direct lookup of the given property-name value in the build +# properties. /property-name/ is a regular expression. E.g. +# will match every toolset. +# /otherwise/ +# :: The literal value of the format argument. +# +# For example this format: +# +# boost_ +# +# Might return: +# +# boost_thread-vc80-mt-gd-1_33.dll, or +# boost_regex-vc80-gd-1_33.dll +# +# The returned name also has the target type specific prefix and suffix which +# puts it in a ready form to use as the value from a custom tag rule. +# +rule format-name ( format * : name : type ? : property-set ) +{ + local result = "" ; + for local f in $(format) + { + switch $(f:G) + { + case : + result += $(name:B) ; + + case : + result += [ join-tag $(f:G=) : [ toolset-tag $(name) : $(type) : + $(property-set) ] ] ; + + case : + result += [ join-tag $(f:G=) : [ threading-tag $(name) : $(type) + : $(property-set) ] ] ; + + case : + result += [ join-tag $(f:G=) : [ runtime-tag $(name) : $(type) : + $(property-set) ] ] ; + + case : + result += [ join-tag $(f:G=) : [ qt-tag $(name) : $(type) : + $(property-set) ] ] ; + + case : + result += [ join-tag $(f:G=) : [ address-model-tag $(name) : + $(type) : $(property-set) ] ] ; + + case : + result += [ join-tag $(f:G=) : [ arch-and-model-tag $(name) : + $(type) : $(property-set) ] ] ; + + case : + local key = [ MATCH : $(f:G) ] ; + local version = [ $(property-set).get <$(key)> ] ; + version ?= $(key) ; + version = [ MATCH "^([^.]+)[.]([^.]+)[.]?([^.]*)" : $(version) ] ; + result += [ join-tag $(f:G=) : $(version[1])_$(version[2]) ] ; + + case : + local key = [ MATCH : $(f:G) ] ; + local p0 = [ MATCH <($(key))> : [ $(property-set).raw ] ] ; + if $(p0) + { + local p = [ $(property-set).get <$(p0)> ] ; + if $(p) + { + result += [ join-tag $(f:G=) : $(p) ] ; + } + } + + case * : + result += $(f:G=) ; + } + } + return [ virtual-target.add-prefix-and-suffix $(result:J=) : $(type) : + $(property-set) ] ; +} + + +local rule join-tag ( joiner ? : tag ? ) +{ + if ! $(joiner) { joiner = - ; } + return $(joiner)$(tag) ; +} + + +local rule toolset-tag ( name : type ? : property-set ) +{ + local tag = ; + + local properties = [ $(property-set).raw ] ; + switch [ $(property-set).get ] + { + case borland* : tag += bcb ; + case clang* : + { + switch [ $(property-set).get ] + { + case darwin : tag += clang-darwin ; + case linux : tag += clang ; + case win : tag += clangw ; + } + } + case como* : tag += como ; + case cw : tag += cw ; + case darwin* : tag += xgcc ; + case edg* : tag += edg ; + case gcc* : + { + switch [ $(property-set).get ] + { + case *windows* : tag += mgw ; + case * : tag += gcc ; + } + } + case intel : + if [ $(property-set).get ] = win + { + tag += iw ; + } + else + { + tag += il ; + } + case kcc* : tag += kcc ; + case kylix* : tag += bck ; + #case metrowerks* : tag += cw ; + #case mingw* : tag += mgw ; + case mipspro* : tag += mp ; + case msvc* : tag += vc ; + case qcc* : tag += qcc ; + case sun* : tag += sw ; + case tru64cxx* : tag += tru ; + case vacpp* : tag += xlc ; + } + local version = [ MATCH "([0123456789]+)[.]?([0123456789]*)" + : $(properties) ] ; + # For historical reasons, vc6.0 and vc7.0 use different naming. + if $(tag) = vc + { + if $(version[1]) = 6 + { + # Cancel minor version. + version = 6 ; + } + else if $(version[1]) = 7 && $(version[2]) = 0 + { + version = 7 ; + } + } + + # From GCC 5, versioning changes and minor becomes patch + if ( $(tag) = gcc || $(tag) = mgw ) && [ numbers.less 4 $(version[1]) ] + { + version = $(version[1]) ; + } + + # Ditto, from Clang 4 + if ( $(tag) = clang || $(tag) = clangw ) && [ numbers.less 3 $(version[1]) ] + { + version = $(version[1]) ; + } + + # On intel, version is not added, because it does not matter and it is the + # version of vc used as backend that matters. Ideally, we should encode the + # backend version but that would break compatibility with V1. + if $(tag) = iw + { + version = ; + } + + # On borland, version is not added for compatibility with V1. + if $(tag) = bcb + { + version = ; + } + + tag += $(version) ; + + return $(tag:J=) ; +} + + +local rule threading-tag ( name : type ? : property-set ) +{ + if multi in [ $(property-set).raw ] + { + return mt ; + } +} + + +local rule runtime-tag ( name : type ? : property-set ) +{ + local tag = ; + + local properties = [ $(property-set).raw ] ; + if static in $(properties) { tag += s ; } + + # This is an ugly thing. In V1, there is code to automatically detect which + # properties affect a target. So, if does not affect gcc + # toolset, the tag rules will not even see . Similar + # functionality in V2 is not implemented yet, so we just check for toolsets + # known to care about runtime debugging. + if ( msvc in $(properties) ) || + ( stlport in $(properties) ) || + ( win in $(properties) ) + { + if on in $(properties) { tag += g ; } + } + + if on in $(properties) { tag += y ; } + if debug in $(properties) { tag += d ; } + if stlport in $(properties) { tag += p ; } + if hostios in $(properties) { tag += n ; } + + return $(tag:J=) ; +} + + +# Create a tag for the Qt library version +# "4.6.0" will result in tag "qt460" +local rule qt-tag ( name : type ? : property-set ) +{ + local v = [ MATCH "([0123456789]+)[.]?([0123456789]*)[.]?([0123456789]*)" : + [ $(property-set).get ] ] ; + return qt$(v:J=) ; +} + + +# Create a tag for the address-model +# 64 will simply generate "64" +local rule address-model-tag ( name : type ? : property-set ) +{ + return [ $(property-set).get ] ; +} + +# Create a tag for the architecture and model +# x86 32 would generate "x32" +# This relies on the fact that all architectures start with +# unique letters. +local rule arch-and-model-tag ( name : type ? : property-set ) +{ + local architecture = [ $(property-set).get ] ; + local address-model = [ $(property-set).get ] ; + + local arch = [ MATCH ^(.) : $(architecture) ] ; + + return $(arch)$(address-model) ; +} + +rule __test__ ( ) +{ + import assert ; + + local save-os = [ modules.peek os : .name ] ; + + modules.poke os : .name : LINUX ; + assert.result "PATH=\"foo:bar:baz\"\nexport PATH\n" + : path-variable-setting-command PATH : foo bar baz ; + assert.result "PATH=\"foo:bar:$PATH\"\nexport PATH\n" + : prepend-path-variable-command PATH : foo bar ; + + modules.poke os : .name : NT ; + assert.result "set PATH=foo;bar;baz\n" + : path-variable-setting-command PATH : foo bar baz ; + assert.result "set PATH=foo;bar;%PATH%\n" + : prepend-path-variable-command PATH : foo bar ; + + modules.poke os : .name : $(save-os) ; +} diff --git a/deps/Boost/user-config.jam b/deps/Boost/user-config.jam new file mode 100644 index 000000000..eff13db28 --- /dev/null +++ b/deps/Boost/user-config.jam @@ -0,0 +1 @@ +using gcc : : @CMAKE_CXX_COMPILER@ ; \ No newline at end of file diff --git a/deps/CGAL/CGAL.cmake b/deps/CGAL/CGAL.cmake index fa88fc29e..b43467b53 100644 --- a/deps/CGAL/CGAL.cmake +++ b/deps/CGAL/CGAL.cmake @@ -1,11 +1,11 @@ prusaslicer_add_cmake_project( CGAL - GIT_REPOSITORY https://github.com/CGAL/cgal.git - GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0 + # GIT_REPOSITORY https://github.com/CGAL/cgal.git + # GIT_TAG bec70a6d52d8aacb0b3d82a7b4edc3caa899184b # releases/CGAL-5.0 # For whatever reason, this keeps downloading forever (repeats downloads if finished) - # URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip - # URL_HASH SHA256=bd9327be903ab7ee379a8a7a0609eba0962f5078d2497cf8e13e8e1598584154 - DEPENDS dep_boost dep_GMP dep_MPFR + URL https://github.com/CGAL/cgal/archive/releases/CGAL-5.0.zip + URL_HASH SHA256=c2b035bd078687b6d8c0fb6371a7443adcdb647856af9969532c4050cd5f48e5 + DEPENDS dep_Boost dep_GMP dep_MPFR ) include(GNUInstallDirs) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 718945828..3ce6b88a9 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -32,6 +32,7 @@ if (NPROC EQUAL 0) endif () set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory") +set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path for downloaded source packages.") option(DEP_DEBUG "Build debug variants (only applicable on Windows)" ON) @@ -46,10 +47,14 @@ endif() # option(DEP_BUILD_IGL_STATIC "Build IGL as a static library. Might cause link errors and increase binary size." OFF) message(STATUS "PrusaSlicer deps DESTDIR: ${DESTDIR}") +message(STATUS "PrusaSlicer dowload dir for source packages: ${DEP_DOWNLOAD_DIR}") message(STATUS "PrusaSlicer deps debug build: ${DEP_DEBUG}") find_package(Git REQUIRED) +# The default command line for patching. Only works for newer +set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix) + get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) function(prusaslicer_add_cmake_project projectname) @@ -71,6 +76,7 @@ function(prusaslicer_add_cmake_project projectname) dep_${projectname} EXCLUDE_FROM_ALL ON INSTALL_DIR ${DESTDIR}/usr/local + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname} ${_gen} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local @@ -79,6 +85,7 @@ function(prusaslicer_add_cmake_project projectname) -DCMAKE_DEBUG_POSTFIX:STRING=d -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} + -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE} -DBUILD_SHARED_LIBS:BOOL=OFF "${_configs_line}" ${DEP_CMAKE_OPTS} @@ -145,27 +152,42 @@ if (NOT EXPAT_FOUND) set(EXPAT_PKG dep_EXPAT) endif () +set(DEP_Boost_COMPONENTS system iostreams filesystem thread log locale regex date_time) +include(Boost/Boost.cmake) + +# The order of includes respects the dependencies between libraries +include(Cereal/Cereal.cmake) +include(Qhull/Qhull.cmake) include(GLEW/GLEW.cmake) include(OpenCSG/OpenCSG.cmake) + +include(TBB/TBB.cmake) + +include(Blosc/Blosc.cmake) +include(OpenEXR/OpenEXR.cmake) +include(OpenVDB/OpenVDB.cmake) + include(GMP/GMP.cmake) include(MPFR/MPFR.cmake) include(CGAL/CGAL.cmake) + +include(NLopt/NLopt.cmake) + +include(OpenSSL/OpenSSL.cmake) +include(CURL/CURL.cmake) + +include(JPEG/JPEG.cmake) +include(TIFF/TIFF.cmake) include(wxWidgets/wxWidgets.cmake) -if (NOT "${ZLIB_PKG}" STREQUAL "") - add_dependencies(dep_blosc ${ZLIB_PKG}) - add_dependencies(dep_openexr ${ZLIB_PKG}) -endif () - set(_dep_list - dep_boost - dep_tbb - dep_libcurl + dep_Boost + dep_TBB + dep_CURL dep_wxWidgets - dep_gtest - dep_cereal - dep_nlopt - dep_openvdb + dep_Cereal + dep_NLopt + dep_OpenVDB dep_OpenCSG dep_CGAL ${PNG_PKG} @@ -173,28 +195,11 @@ set(_dep_list ${EXPAT_PKG} ) -if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") - # Patch the boost::polygon library with a custom one. - ExternalProject_Add(dep_boost_polygon - EXCLUDE_FROM_ALL ON - GIT_REPOSITORY "https://github.com/prusa3d/polygon" - GIT_TAG prusaslicer_gmp - DEPENDS dep_boost - CONFIGURE_COMMAND "" - BUILD_COMMAND "" - INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory - "${CMAKE_CURRENT_BINARY_DIR}/dep_boost_polygon-prefix/src/dep_boost_polygon/include/boost/polygon" - "${DESTDIR}/usr/local/include/boost/polygon" - ) - # Only override boost::Polygon Voronoi implementation with Vojtech's GMP hacks on 64bit platforms. - list(APPEND _dep_list "dep_boost_polygon") -endif () - if (MSVC) # Experimental #list(APPEND _dep_list "dep_qhull") else() - list(APPEND _dep_list "dep_qhull") + list(APPEND _dep_list "dep_Qhull") # Not working, static build has different Eigen #list(APPEND _dep_list "dep_libigl") endif() diff --git a/deps/CURL/CURL.cmake b/deps/CURL/CURL.cmake new file mode 100644 index 000000000..a05a4e97e --- /dev/null +++ b/deps/CURL/CURL.cmake @@ -0,0 +1,78 @@ +set(_curl_platform_flags + -DENABLE_IPV6:BOOL=ON + -DENABLE_VERSIONED_SYMBOLS:BOOL=ON + -DENABLE_THREADED_RESOLVER:BOOL=ON + + # -DCURL_DISABLE_LDAP:BOOL=ON + # -DCURL_DISABLE_LDAPS:BOOL=ON + -DENABLE_MANUAL:BOOL=OFF + # -DCURL_DISABLE_RTSP:BOOL=ON + # -DCURL_DISABLE_DICT:BOOL=ON + # -DCURL_DISABLE_TELNET:BOOL=ON + # -DCURL_DISABLE_POP3:BOOL=ON + # -DCURL_DISABLE_IMAP:BOOL=ON + # -DCURL_DISABLE_SMB:BOOL=ON + # -DCURL_DISABLE_SMTP:BOOL=ON + # -DCURL_DISABLE_GOPHER:BOOL=ON + -DHTTP_ONLY=ON + + -DCMAKE_USE_GSSAPI:BOOL=OFF + -DCMAKE_USE_LIBSSH2:BOOL=OFF + -DUSE_RTMP:BOOL=OFF + -DUSE_NGHTTP2:BOOL=OFF + -DUSE_MBEDTLS:BOOL=OFF +) + +if (WIN32) + set(_curl_platform_flags ${_curl_platform_flags} -DCMAKE_USE_SCHANNEL=ON) +elseif (APPLE) + set(_curl_platform_flags + + ${_curl_platform_flags} + + -DCMAKE_USE_SECTRANSP:BOOL=ON + -DCMAKE_USE_OPENSSL:BOOL=OFF + + -DCURL_CA_PATH:STRING=none + ) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + set(_curl_platform_flags + + ${_curl_platform_flags} + + -DCMAKE_USE_OPENSSL:BOOL=ON + + -DCURL_CA_PATH:STRING=none + -DCURL_CA_BUNDLE:STRING=none + -DCURL_CA_FALLBACK:BOOL=ON + ) +endif () + +if (BUILD_SHARED_LIBS) + set(_curl_static OFF) +else() + set(_curl_static ON) +endif() + +prusaslicer_add_cmake_project(CURL + # GIT_REPOSITORY https://github.com/curl/curl.git + # GIT_TAG curl-7_75_0 + URL https://github.com/curl/curl/archive/refs/tags/curl-7_75_0.zip + URL_HASH SHA256=a63ae025bb0a14f119e73250f2c923f4bf89aa93b8d4fafa4a9f5353a96a765a + DEPENDS ${ZLIB_PKG} + # PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && + # ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/curl-mods.patch + CMAKE_ARGS + -DBUILD_TESTING:BOOL=OFF + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DCURL_STATICLIB=${_curl_static} + ${_curl_platform_flags} +) + +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + add_dependencies(dep_CURL dep_OpenSSL) +endif () + +if (MSVC) + add_debug_dep(dep_CURL) +endif () diff --git a/deps/Cereal/Cereal.cmake b/deps/Cereal/Cereal.cmake new file mode 100644 index 000000000..28912ff4f --- /dev/null +++ b/deps/Cereal/Cereal.cmake @@ -0,0 +1,6 @@ +prusaslicer_add_cmake_project(Cereal + URL "https://github.com/USCiLab/cereal/archive/v1.2.2.tar.gz" + URL_HASH SHA256=1921f26d2e1daf9132da3c432e2fd02093ecaedf846e65d7679ddf868c7289c4 + CMAKE_ARGS + -DJUST_INSTALL_CEREAL=on +) \ No newline at end of file diff --git a/deps/GMP/GMP.cmake b/deps/GMP/GMP.cmake index a7fe19355..6b0f97085 100644 --- a/deps/GMP/GMP.cmake +++ b/deps/GMP/GMP.cmake @@ -36,11 +36,18 @@ else () set(_gmp_build_tgt "") # let it guess endif() + set(_cross_compile_arg "") + if (CMAKE_CROSSCOMPILING) + # TOOLCHAIN_PREFIX should be defined in the toolchain file + set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX}) + endif () + ExternalProject_Add(dep_GMP - # URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 URL https://gmplib.org/download/gmp/gmp-6.2.1.tar.bz2 + URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP BUILD_IN_SOURCE ON - CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt} + CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt} BUILD_COMMAND make -j INSTALL_COMMAND make install ) diff --git a/deps/JPEG/JPEG.cmake b/deps/JPEG/JPEG.cmake new file mode 100644 index 000000000..4c8c0307e --- /dev/null +++ b/deps/JPEG/JPEG.cmake @@ -0,0 +1,8 @@ +prusaslicer_add_cmake_project(JPEG + URL https://github.com/libjpeg-turbo/libjpeg-turbo/archive/refs/tags/2.0.6.zip + URL_HASH SHA256=017bdc33ff3a72e11301c0feb4657cb27719d7f97fa67a78ed506c594218bbf1 + DEPENDS ${ZLIB_PKG} + CMAKE_ARGS + -DENABLE_SHARED=OFF + -DENABLE_STATIC=ON +) diff --git a/deps/MPFR/MPFR.cmake b/deps/MPFR/MPFR.cmake index ddbb178d8..c29bb39ad 100644 --- a/deps/MPFR/MPFR.cmake +++ b/deps/MPFR/MPFR.cmake @@ -18,10 +18,19 @@ if (MSVC) add_custom_target(dep_MPFR SOURCES ${_output}) else () + + set(_cross_compile_arg "") + if (CMAKE_CROSSCOMPILING) + # TOOLCHAIN_PREFIX should be defined in the toolchain file + set(_cross_compile_arg --host=${TOOLCHAIN_PREFIX}) + endif () + ExternalProject_Add(dep_MPFR URL http://ftp.vim.org/ftp/gnu/mpfr/mpfr-3.1.6.tar.bz2 https://www.mpfr.org/mpfr-3.1.6/mpfr-3.1.6.tar.bz2 # mirrors are allowed + URL_HASH SHA256=cf4f4b2d80abb79e820e78c8077b6725bbbb4e8f41896783c899087be0e94068 + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR BUILD_IN_SOURCE ON - CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt} + CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt} BUILD_COMMAND make -j INSTALL_COMMAND make install DEPENDS dep_GMP diff --git a/deps/NLopt/NLopt.cmake b/deps/NLopt/NLopt.cmake new file mode 100644 index 000000000..db638c897 --- /dev/null +++ b/deps/NLopt/NLopt.cmake @@ -0,0 +1,15 @@ +prusaslicer_add_cmake_project(NLopt + URL "https://github.com/stevengj/nlopt/archive/v2.5.0.tar.gz" + URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae + CMAKE_ARGS + -DNLOPT_PYTHON:BOOL=OFF + -DNLOPT_OCTAVE:BOOL=OFF + -DNLOPT_MATLAB:BOOL=OFF + -DNLOPT_GUILE:BOOL=OFF + -DNLOPT_SWIG:BOOL=OFF + -DNLOPT_TESTS:BOOL=OFF +) + +if (MSVC) + add_debug_dep(dep_NLopt) +endif () diff --git a/deps/OpenCSG/OpenCSG.cmake b/deps/OpenCSG/OpenCSG.cmake index fda74cd45..4d980fecd 100644 --- a/deps/OpenCSG/OpenCSG.cmake +++ b/deps/OpenCSG/OpenCSG.cmake @@ -1,7 +1,9 @@ prusaslicer_add_cmake_project(OpenCSG - GIT_REPOSITORY https://github.com/floriankirsch/OpenCSG.git - GIT_TAG 83e274457b46c9ad11a4ee599203250b1618f3b9 #v1.4.2 + # GIT_REPOSITORY https://github.com/floriankirsch/OpenCSG.git + # GIT_TAG 83e274457b46c9ad11a4ee599203250b1618f3b9 #v1.4.2 + URL https://github.com/floriankirsch/OpenCSG/archive/refs/tags/opencsg-1-4-2-release.zip + URL_HASH SHA256=51afe0db79af8386e2027d56d685177135581e0ee82ade9d7f2caff8deab5ec5 PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in ./CMakeLists.txt DEPENDS dep_GLEW ) diff --git a/deps/OpenEXR/OpenEXR.cmake b/deps/OpenEXR/OpenEXR.cmake new file mode 100644 index 000000000..046223fed --- /dev/null +++ b/deps/OpenEXR/OpenEXR.cmake @@ -0,0 +1,17 @@ +prusaslicer_add_cmake_project(OpenEXR + # GIT_REPOSITORY https://github.com/openexr/openexr.git + URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip + URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de + DEPENDS ${ZLIB_PKG} + GIT_TAG v2.5.5 + CMAKE_ARGS + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DBUILD_TESTING=OFF + -DPYILMBASE_ENABLE:BOOL=OFF + -DOPENEXR_VIEWERS_ENABLE:BOOL=OFF + -DOPENEXR_BUILD_UTILS:BOOL=OFF +) + +if (MSVC) + add_debug_dep(dep_OpenEXR) +endif () \ No newline at end of file diff --git a/deps/OpenSSL/OpenSSL.cmake b/deps/OpenSSL/OpenSSL.cmake new file mode 100644 index 000000000..347b30d05 --- /dev/null +++ b/deps/OpenSSL/OpenSSL.cmake @@ -0,0 +1,35 @@ + +include(ProcessorCount) +ProcessorCount(NPROC) + +set(_conf_cmd "./config") +set(_cross_arch "") +set(_cross_comp_prefix_line "") +if (CMAKE_CROSSCOMPILING) + set(_conf_cmd "./Configure") + set(_cross_comp_prefix_line "--cross-compile-prefix=${TOOLCHAIN_PREFIX}-") + + if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64") + set(_cross_arch "linux-aarch64") + elseif (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "armhf") # For raspbian + # TODO: verify + set(_cross_arch "linux-armv4") + endif () +endif () + +ExternalProject_Add(dep_OpenSSL + EXCLUDE_FROM_ALL ON + URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz" + URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d + DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL + BUILD_IN_SOURCE ON + CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch} + "--prefix=${DESTDIR}/usr/local" + ${_cross_comp_prefix_line} + no-shared + no-ssl3-method + no-dynamic-engine + -Wa,--noexecstack + BUILD_COMMAND make depend && make "-j${NPROC}" + INSTALL_COMMAND make install_sw +) \ No newline at end of file diff --git a/deps/OpenVDB/OpenVDB.cmake b/deps/OpenVDB/OpenVDB.cmake new file mode 100644 index 000000000..10dc2d916 --- /dev/null +++ b/deps/OpenVDB/OpenVDB.cmake @@ -0,0 +1,36 @@ +if(BUILD_SHARED_LIBS) + set(_build_shared ON) + set(_build_static OFF) +else() + set(_build_shared OFF) + set(_build_static ON) +endif() + +prusaslicer_add_cmake_project(OpenVDB + URL https://github.com/tamasmeszaros/openvdb/archive/refs/tags/v6.2.1-prusa3d.zip #v6.2.1 patched + URL_HASH SHA256=caf9f0c91976722883ff9cb32420ef142af22f7e625fc643b91c23d6e4172f62 + DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost + CMAKE_ARGS + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DOPENVDB_BUILD_PYTHON_MODULE=OFF + -DUSE_BLOSC=ON + -DOPENVDB_CORE_SHARED=${_build_shared} + -DOPENVDB_CORE_STATIC=${_build_static} + -DOPENVDB_ENABLE_RPATH:BOOL=OFF + -DTBB_STATIC=${_build_static} + -DOPENVDB_BUILD_VDB_PRINT=ON + -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON # Centos6 has old zlib +) + +if (MSVC) + if (${DEP_DEBUG}) + ExternalProject_Get_Property(dep_OpenVDB BINARY_DIR) + ExternalProject_Add_Step(dep_OpenVDB build_debug + DEPENDEES build + DEPENDERS install + COMMAND ${CMAKE_COMMAND} ../dep_OpenVDB -DOPENVDB_BUILD_VDB_PRINT=OFF + COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj + WORKING_DIRECTORY "${BINARY_DIR}" + ) + endif () +endif () \ No newline at end of file diff --git a/deps/PNG/PNG.cmake b/deps/PNG/PNG.cmake index e07afec6d..f97ebb4e0 100644 --- a/deps/PNG/PNG.cmake +++ b/deps/PNG/PNG.cmake @@ -5,10 +5,18 @@ else () set(_disable_neon_extension "") endif () +set(_patch_step "") +if (APPLE) + set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch) +endif () + prusaslicer_add_cmake_project(PNG - GIT_REPOSITORY https://github.com/glennrp/libpng.git - GIT_TAG v1.6.35 + # GIT_REPOSITORY https://github.com/glennrp/libpng.git + # GIT_TAG v1.6.35 + URL https://github.com/glennrp/libpng/archive/refs/tags/v1.6.35.zip + URL_HASH SHA256=3d22d46c566b1761a0e15ea397589b3a5f36ac09b7c785382e6470156c04247f DEPENDS ${ZLIB_PKG} + "${_patch_step}" CMAKE_ARGS -DPNG_SHARED=OFF -DPNG_STATIC=ON diff --git a/deps/PNG/PNG.patch b/deps/PNG/PNG.patch new file mode 100644 index 000000000..3e6a70d51 --- /dev/null +++ b/deps/PNG/PNG.patch @@ -0,0 +1,26 @@ +Common subdirectories: ../libpng-1.6.35-orig/arm and ./arm +Common subdirectories: ../libpng-1.6.35-orig/contrib and ./contrib +Common subdirectories: ../libpng-1.6.35-orig/intel and ./intel +Common subdirectories: ../libpng-1.6.35-orig/mips and ./mips +Only in ./: PNG.patch +diff -u ../libpng-1.6.35-orig/pngrutil.c ./pngrutil.c +--- ../libpng-1.6.35-orig/pngrutil.c 2018-07-15 20:58:00.000000000 +0200 ++++ ./pngrutil.c 2021-03-24 15:59:38.687108444 +0100 +@@ -422,13 +422,6 @@ + png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED; + } + +-#if ZLIB_VERNUM >= 0x1290 && \ +- defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32) +- if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON) +- /* Turn off validation of the ADLER32 checksum in IDAT chunks */ +- ret = inflateValidate(&png_ptr->zstream, 0); +-#endif +- + if (ret == Z_OK) + png_ptr->zowner = owner; + +Common subdirectories: ../libpng-1.6.35-orig/powerpc and ./powerpc +Common subdirectories: ../libpng-1.6.35-orig/projects and ./projects +Common subdirectories: ../libpng-1.6.35-orig/scripts and ./scripts +Common subdirectories: ../libpng-1.6.35-orig/tests and ./tests diff --git a/deps/Qhull/Qhull.cmake b/deps/Qhull/Qhull.cmake new file mode 100644 index 000000000..fedec550c --- /dev/null +++ b/deps/Qhull/Qhull.cmake @@ -0,0 +1,11 @@ +include(GNUInstallDirs) +prusaslicer_add_cmake_project(Qhull + URL "https://github.com/qhull/qhull/archive/v8.0.1.zip" + URL_HASH SHA256=5287f5edd6a0372588f5d6640799086a4033d89d19711023ef8229dd9301d69b + CMAKE_ARGS + -DINCLUDE_INSTALL_DIR=${CMAKE_INSTALL_INCLUDEDIR} +) + +if (MSVC) + add_debug_dep(dep_Qhull) +endif () \ No newline at end of file diff --git a/deps/TBB/TBB.cmake b/deps/TBB/TBB.cmake new file mode 100644 index 000000000..7315716e0 --- /dev/null +++ b/deps/TBB/TBB.cmake @@ -0,0 +1,17 @@ +prusaslicer_add_cmake_project( + TBB + URL "https://github.com/wjakob/tbb/archive/a0dc9bf76d0120f917b641ed095360448cabc85b.tar.gz" + URL_HASH SHA256=0545cb6033bd1873fcae3ea304def720a380a88292726943ae3b9b207f322efe + CMAKE_ARGS + -DTBB_BUILD_SHARED=OFF + -DTBB_BUILD_TESTS=OFF + -DTBB_BUILD_TESTS=OFF + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + -DCMAKE_DEBUG_POSTFIX=_debug +) + +if (MSVC) + add_debug_dep(dep_TBB) +endif () + + diff --git a/deps/TIFF/TIFF.cmake b/deps/TIFF/TIFF.cmake new file mode 100644 index 000000000..f92dd0811 --- /dev/null +++ b/deps/TIFF/TIFF.cmake @@ -0,0 +1,13 @@ +find_package(OpenGL QUIET REQUIRED) + +prusaslicer_add_cmake_project(TIFF + URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.zip + URL_HASH SHA256=c56edfacef0a60c0de3e6489194fcb2f24c03dbb550a8a7de5938642d045bd32 + DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG + CMAKE_ARGS + -Dlzma:BOOL=OFF + -Dwebp:BOOL=OFF + -Djbig:BOOL=OFF + -Dzstd:BOOL=OFF + -Dpixarlog:BOOL=OFF +) diff --git a/deps/ZLIB/0001-Respect-BUILD_SHARED_LIBS.patch b/deps/ZLIB/0001-Respect-BUILD_SHARED_LIBS.patch index e65ec0e65..f176ce287 100644 --- a/deps/ZLIB/0001-Respect-BUILD_SHARED_LIBS.patch +++ b/deps/ZLIB/0001-Respect-BUILD_SHARED_LIBS.patch @@ -1,17 +1,8 @@ -From 0c64e33bc2e4e7c011f5a64f5d9c7571a434cc86 Mon Sep 17 00:00:00 2001 -From: tamasmeszaros -Date: Sat, 16 Nov 2019 13:43:17 +0100 -Subject: [PATCH] Respect BUILD_SHARED_LIBS - ---- - CMakeLists.txt | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0fe939d..01dfea1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -183,10 +183,12 @@ if(MINGW) +Common subdirectories: ../zlib-1.2.11/amiga and ./amiga +diff -u ../zlib-1.2.11/CMakeLists.txt ./CMakeLists.txt +--- ../zlib-1.2.11/CMakeLists.txt 2017-01-15 09:29:40.000000000 +0100 ++++ ./CMakeLists.txt 2021-03-24 15:24:48.190291072 +0100 +@@ -183,10 +183,12 @@ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) endif(MINGW) @@ -28,7 +19,7 @@ index 0fe939d..01dfea1 100644 if(NOT CYGWIN) # This property causes shared libraries on Linux to have the full version -@@ -201,7 +203,7 @@ endif() +@@ -201,7 +203,7 @@ if(UNIX) # On unix-like platforms the library is almost always called libz @@ -37,7 +28,7 @@ index 0fe939d..01dfea1 100644 if(NOT APPLE) set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") endif() -@@ -211,7 +213,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) +@@ -211,7 +213,7 @@ endif() if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) @@ -46,6 +37,15 @@ index 0fe939d..01dfea1 100644 RUNTIME DESTINATION "${INSTALL_BIN_DIR}" ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) --- -2.16.2.windows.1 - +Common subdirectories: ../zlib-1.2.11/contrib and ./contrib +Common subdirectories: ../zlib-1.2.11/doc and ./doc +Common subdirectories: ../zlib-1.2.11/examples and ./examples +Common subdirectories: ../zlib-1.2.11/msdos and ./msdos +Common subdirectories: ../zlib-1.2.11/nintendods and ./nintendods +Common subdirectories: ../zlib-1.2.11/old and ./old +Common subdirectories: ../zlib-1.2.11/os400 and ./os400 +Common subdirectories: ../zlib-1.2.11/qnx and ./qnx +Common subdirectories: ../zlib-1.2.11/test and ./test +Common subdirectories: ../zlib-1.2.11/watcom and ./watcom +Common subdirectories: ../zlib-1.2.11/win32 and ./win32 +Only in ./: ZLIB.patch diff --git a/deps/ZLIB/ZLIB.cmake b/deps/ZLIB/ZLIB.cmake index 574f5b134..916f3318b 100644 --- a/deps/ZLIB/ZLIB.cmake +++ b/deps/ZLIB/ZLIB.cmake @@ -1,8 +1,9 @@ prusaslicer_add_cmake_project(ZLIB - GIT_REPOSITORY https://github.com/madler/zlib.git - GIT_TAG v1.2.11 - PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && - ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-Respect-BUILD_SHARED_LIBS.patch + # GIT_REPOSITORY https://github.com/madler/zlib.git + # GIT_TAG v1.2.11 + URL https://github.com/madler/zlib/archive/refs/tags/v1.2.11.zip + URL_HASH SHA256=f5cc4ab910db99b2bdbba39ebbdc225ffc2aa04b4057bc2817f1b94b6978cfc3 + PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-Respect-BUILD_SHARED_LIBS.patch CMAKE_ARGS -DSKIP_INSTALL_FILES=ON # Prevent installation of man pages et al. -DCMAKE_POSITION_INDEPENDENT_CODE=ON diff --git a/deps/deps-linux.cmake b/deps/deps-linux.cmake index c81d6785d..fbe7b711b 100644 --- a/deps/deps-linux.cmake +++ b/deps/deps-linux.cmake @@ -7,98 +7,4 @@ include("deps-unix-common.cmake") # find_package(PNG QUIET) # if (NOT PNG_FOUND) # message(WARNING "No PNG dev package found in system, building static library. You should install the system package.") -# endif () - -#TODO UDEV - -ExternalProject_Add(dep_boost - EXCLUDE_FROM_ALL 1 - URL "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz" - URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND ./bootstrap.sh - --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time - "--prefix=${DESTDIR}/usr/local" - BUILD_COMMAND ./b2 - -j ${NPROC} - --reconfigure - link=static - variant=release - threading=multi - boost.locale.icu=off - --disable-icu - cflags=-fPIC - cxxflags=-fPIC - install - INSTALL_COMMAND "" # b2 does that already -) - -ExternalProject_Add(dep_libopenssl - EXCLUDE_FROM_ALL 1 - URL "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0l.tar.gz" - URL_HASH SHA256=e2acf0cf58d9bff2b42f2dc0aee79340c8ffe2c5e45d3ca4533dd5d4f5775b1d - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND ./config - "--prefix=${DESTDIR}/usr/local" - "--libdir=lib" - 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 - - # CA root certificate paths will be set for openssl at runtime. - --without-ca-bundle - --without-ca-path - --with-ca-fallback # to look for the ssl backend's ca store - - --disable-ldap - --disable-ldaps - --disable-manual - --disable-rtsp - --disable-dict - --disable-telnet - --disable-pop3 - --disable-imap - --disable-smb - --disable-smtp - --disable-gopher - --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}" -) -add_dependencies(dep_openvdb dep_boost) - +# endif () \ No newline at end of file diff --git a/deps/deps-macos.cmake b/deps/deps-macos.cmake index de77dafa8..42afc623d 100644 --- a/deps/deps-macos.cmake +++ b/deps/deps-macos.cmake @@ -16,76 +16,76 @@ set(DEP_CMAKE_OPTS include("deps-unix-common.cmake") -ExternalProject_Add(dep_boost - EXCLUDE_FROM_ALL 1 - URL "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz" - URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND ./bootstrap.sh - --with-toolset=clang - --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time - "--prefix=${DESTDIR}/usr/local" - BUILD_COMMAND ./b2 - -j ${NPROC} - --reconfigure - toolset=clang - link=static - variant=release - threading=multi - boost.locale.icu=off - --disable-icu - "cflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" - "cxxflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" - "mflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" - "mmflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" - install - INSTALL_COMMAND "" # b2 does that already -) +# ExternalProject_Add(dep_boost +# EXCLUDE_FROM_ALL 1 +# URL "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.gz" +# URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a +# BUILD_IN_SOURCE 1 +# CONFIGURE_COMMAND ./bootstrap.sh +# --with-toolset=clang +# --with-libraries=system,iostreams,filesystem,thread,log,locale,regex,date_time +# "--prefix=${DESTDIR}/usr/local" +# BUILD_COMMAND ./b2 +# -j ${NPROC} +# --reconfigure +# toolset=clang +# link=static +# variant=release +# threading=multi +# boost.locale.icu=off +# --disable-icu +# "cflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" +# "cxxflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" +# "mflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" +# "mmflags=-fPIC -mmacosx-version-min=${DEP_OSX_TARGET}" +# install +# INSTALL_COMMAND "" # b2 does that already +# ) -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 ./configure - --enable-static - --disable-shared - "--with-ssl=${DESTDIR}/usr/local" - --with-pic - --enable-ipv6 - --enable-versioned-symbols - --enable-threaded-resolver - --with-darwinssl - --without-ssl # disables OpenSSL - --disable-ldap - --disable-ldaps - --disable-manual - --disable-rtsp - --disable-dict - --disable-telnet - --disable-pop3 - --disable-imap - --disable-smb - --disable-smtp - --disable-gopher - --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}" -) -add_dependencies(dep_openvdb dep_boost) +# 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 ./configure +# --enable-static +# --disable-shared +# "--with-ssl=${DESTDIR}/usr/local" +# --with-pic +# --enable-ipv6 +# --enable-versioned-symbols +# --enable-threaded-resolver +# --with-darwinssl +# --without-ssl # disables OpenSSL +# --disable-ldap +# --disable-ldaps +# --disable-manual +# --disable-rtsp +# --disable-dict +# --disable-telnet +# --disable-pop3 +# --disable-imap +# --disable-smb +# --disable-smtp +# --disable-gopher +# --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}" +# ) +# add_dependencies(dep_openvdb dep_boost) \ No newline at end of file diff --git a/deps/deps-mingw.cmake b/deps/deps-mingw.cmake index cae7fc371..b86554f64 100644 --- a/deps/deps-mingw.cmake +++ b/deps/deps-mingw.cmake @@ -6,57 +6,3 @@ find_package(Git REQUIRED) # TODO make sure to build tbb with -flifetime-dse=1 include("deps-unix-common.cmake") - -ExternalProject_Add(dep_boost - EXCLUDE_FROM_ALL 1 - URL "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz" - URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a - 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 - --with-date_time - "--prefix=${DESTDIR}/usr/local" - "address-model=${DEPS_BITS}" - "toolset=${DEP_BOOST_TOOLSET}" - link=static - define=BOOST_USE_WINAPI_VERSION=0x0502 - variant=release - threading=multi - boost.locale.icu=off - "${DEP_BOOST_DEBUG}" release install - INSTALL_COMMAND "" # b2 does that already -) - -ExternalProject_Add(dep_libcurl - EXCLUDE_FROM_ALL 1 - URL "https://curl.haxx.se/download/curl-7.58.0.tar.gz" - URL_HASH SHA256=cc245bf9a1a42a45df491501d97d5593392a03f7b4f07b952793518d97666115 - CMAKE_ARGS - -DBUILD_SHARED_LIBS=OFF - -DBUILD_TESTING=OFF - -DCURL_STATICLIB=ON - -DCURL_STATIC_CRT=ON - -DENABLE_THREADED_RESOLVER=ON - -DCURL_DISABLE_FTP=ON - -DCURL_DISABLE_LDAP=ON - -DCURL_DISABLE_LDAPS=ON - -DCURL_DISABLE_TELNET=ON - -DCURL_DISABLE_DICT=ON - -DCURL_DISABLE_FILE=ON - -DCURL_DISABLE_TFTP=ON - -DCURL_DISABLE_RTSP=ON - -DCURL_DISABLE_POP3=ON - -DCURL_DISABLE_IMAP=ON - -DCURL_DISABLE_SMTP=ON - -DCURL_DISABLE_GOPHER=ON - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - ${DEP_CMAKE_OPTS} -) - diff --git a/deps/deps-unix-common.cmake b/deps/deps-unix-common.cmake index 46c9f8864..d715e81a1 100644 --- a/deps/deps-unix-common.cmake +++ b/deps/deps-unix-common.cmake @@ -17,113 +17,3 @@ endif () # if (NOT EXPAT_FOUND) # message(WARNING "No EXPAT dev package found in system, building static library. Consider installing the system package.") # endif () - -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_CXX_FLAGS=${TBB_MINGW_WORKAROUND} - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - ${DEP_CMAKE_OPTS} -) - -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 ${DEP_CMAKE_OPTS} -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local -) - -ExternalProject_Add(dep_cereal - EXCLUDE_FROM_ALL 1 - URL "https://github.com/USCiLab/cereal/archive/v1.2.2.tar.gz" -# URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae - CMAKE_ARGS - -DJUST_INSTALL_CEREAL=on - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - ${DEP_CMAKE_OPTS} -) - -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_ARGS - -DBUILD_SHARED_LIBS=OFF - -DNLOPT_PYTHON=OFF - -DNLOPT_OCTAVE=OFF - -DNLOPT_MATLAB=OFF - -DNLOPT_GUILE=OFF - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - ${DEP_CMAKE_OPTS} -) - -ExternalProject_Add(dep_qhull - EXCLUDE_FROM_ALL 1 - #URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz" - #URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0 - GIT_REPOSITORY https://github.com/qhull/qhull.git - GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch - CMAKE_ARGS - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - ${DEP_CMAKE_OPTS} -) - -ExternalProject_Add(dep_blosc - EXCLUDE_FROM_ALL 1 - GIT_REPOSITORY https://github.com/Blosc/c-blosc.git - GIT_TAG e63775855294b50820ef44d1b157f4de1cc38d3e #v1.17.0 - DEPENDS - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DCMAKE_DEBUG_POSTFIX=d - -DBUILD_SHARED=OFF - -DBUILD_STATIC=ON - -DBUILD_TESTS=OFF - -DBUILD_BENCHMARKS=OFF - -DPREFER_EXTERNAL_ZLIB=ON - PATCH_COMMAND ${GIT_EXECUTABLE} reset --hard && git clean -df && - ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/blosc-mods.patch -) - -ExternalProject_Add(dep_openexr - EXCLUDE_FROM_ALL 1 - GIT_REPOSITORY https://github.com/openexr/openexr.git - GIT_TAG eae0e337c9f5117e78114fd05f7a415819df413a #v2.4.0 - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DBUILD_TESTING=OFF - -DPYILMBASE_ENABLE:BOOL=OFF - -DOPENEXR_VIEWERS_ENABLE:BOOL=OFF - -DOPENEXR_BUILD_UTILS:BOOL=OFF -) - -ExternalProject_Add(dep_openvdb - EXCLUDE_FROM_ALL 1 - GIT_REPOSITORY https://github.com/AcademySoftwareFoundation/openvdb.git - GIT_TAG aebaf8d95be5e57fd33949281ec357db4a576c2e #v6.2.1 - DEPENDS dep_blosc dep_openexr dep_tbb - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - -DCMAKE_DEBUG_POSTFIX=d - -DCMAKE_PREFIX_PATH=${DESTDIR}/usr/local - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DOPENVDB_BUILD_PYTHON_MODULE=OFF - -DUSE_BLOSC=ON - -DOPENVDB_CORE_SHARED=OFF - -DOPENVDB_CORE_STATIC=ON - -DTBB_STATIC=ON - -DOPENVDB_BUILD_VDB_PRINT=ON - -DDISABLE_DEPENDENCY_VERSION_CHECKS=ON - PATCH_COMMAND PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && - ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/openvdb-mods.patch -) diff --git a/deps/deps-windows.cmake b/deps/deps-windows.cmake index fc9f55f5f..7288cfe6f 100644 --- a/deps/deps-windows.cmake +++ b/deps/deps-windows.cmake @@ -53,154 +53,6 @@ if (${DEP_DEBUG}) endif () endmacro() -ExternalProject_Add(dep_boost - EXCLUDE_FROM_ALL 1 - URL "https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz" - URL_HASH SHA256=aeb26f80e80945e82ee93e5939baebdca47b9dee80a07d3144be1e1a6a66dd6a - BUILD_IN_SOURCE 1 - CONFIGURE_COMMAND bootstrap.bat - BUILD_COMMAND b2.exe - -j "${NPROC}" - --with-system - --with-iostreams - --with-filesystem - --with-thread - --with-log - --with-locale - --with-regex - --with-date_time - "--prefix=${DESTDIR}/usr/local" - "address-model=${DEPS_BITS}" - "toolset=${DEP_BOOST_TOOLSET}" - link=static - variant=release - threading=multi - boost.locale.icu=off - --disable-icu - "${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_GENERATOR_PLATFORM "${DEP_PLATFORM}" - CMAKE_ARGS - -DCMAKE_DEBUG_POSTFIX=_debug - -DTBB_BUILD_SHARED=OFF - -DTBB_BUILD_TESTS=OFF - "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" - BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj - INSTALL_COMMAND "" -) - -add_debug_dep(dep_tbb) - -# 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_GENERATOR_PLATFORM "${DEP_PLATFORM}" -# CMAKE_ARGS -# -DBUILD_GMOCK=OFF -# -Dgtest_force_shared_crt=ON -# -DCMAKE_POSITION_INDEPENDENT_CODE=ON -# "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" -# BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj -# INSTALL_COMMAND "" -# ) - -# add_debug_dep(dep_gtest) - -ExternalProject_Add(dep_cereal - EXCLUDE_FROM_ALL 1 - URL "https://github.com/USCiLab/cereal/archive/v1.2.2.tar.gz" -# URL_HASH SHA256=c6dd7a5701fff8ad5ebb45a3dc8e757e61d52658de3918e38bab233e7fd3b4ae - CMAKE_GENERATOR "${DEP_MSVC_GEN}" - CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" - CMAKE_ARGS - -DJUST_INSTALL_CEREAL=on - "-DCMAKE_INSTALL_PREFIX:PATH=${DESTDIR}\\usr\\local" - BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj - INSTALL_COMMAND "" -) - -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_GENERATOR_PLATFORM "${DEP_PLATFORM}" - CMAKE_ARGS - -DBUILD_SHARED_LIBS=OFF - -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 /m /P:Configuration=Release INSTALL.vcxproj - INSTALL_COMMAND "" -) - -add_debug_dep(dep_nlopt) - -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=${DEP_VS_VER}" 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=${DEP_VS_VER}" 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 () - -ExternalProject_Add(dep_qhull - EXCLUDE_FROM_ALL 1 - #URL "https://github.com/qhull/qhull/archive/v7.3.2.tar.gz" - #URL_HASH SHA256=619c8a954880d545194bc03359404ef36a1abd2dde03678089459757fd790cb0 - GIT_REPOSITORY https://github.com/qhull/qhull.git - GIT_TAG 7afedcc73666e46a9f1d74632412ebecf53b1b30 # v7.3.2 plus the mac build patch - CMAKE_GENERATOR "${DEP_MSVC_GEN}" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DCMAKE_DEBUG_POSTFIX=d - BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj - INSTALL_COMMAND "" -) - -add_debug_dep(dep_qhull) - if (${DEPS_BITS} EQUAL 32) set(DEP_WXWIDGETS_TARGET "") set(DEP_WXWIDGETS_LIBDIR "vc_lib") @@ -210,90 +62,3 @@ else () endif () find_package(Git REQUIRED) - -ExternalProject_Add(dep_blosc - EXCLUDE_FROM_ALL 1 - #URL https://github.com/Blosc/c-blosc/archive/v1.17.0.zip - #URL_HASH SHA256=7463a1df566704f212263312717ab2c36b45d45cba6cd0dccebf91b2cc4b4da9 - GIT_REPOSITORY https://github.com/Blosc/c-blosc.git - GIT_TAG e63775855294b50820ef44d1b157f4de1cc38d3e #v1.17.0 - CMAKE_GENERATOR "${DEP_MSVC_GEN}" - CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DCMAKE_DEBUG_POSTFIX=d - -DBUILD_SHARED=OFF - -DBUILD_STATIC=ON - -DBUILD_TESTS=OFF - -DBUILD_BENCHMARKS=OFF - -DPREFER_EXTERNAL_ZLIB=ON - -DBLOSC_IS_SUBPROJECT:BOOL=ON - -DBLOSC_INSTALL:BOOL=ON - PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && - ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/blosc-mods.patch - BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj - INSTALL_COMMAND "" -) - -add_debug_dep(dep_blosc) - -ExternalProject_Add(dep_openexr - EXCLUDE_FROM_ALL 1 - GIT_REPOSITORY https://github.com/openexr/openexr.git - GIT_TAG eae0e337c9f5117e78114fd05f7a415819df413a #v2.4.0 - CMAKE_GENERATOR "${DEP_MSVC_GEN}" - CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DBUILD_TESTING=OFF - -DPYILMBASE_ENABLE:BOOL=OFF - -DOPENEXR_VIEWERS_ENABLE:BOOL=OFF - -DOPENEXR_BUILD_UTILS:BOOL=OFF - BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj - INSTALL_COMMAND "" -) - -add_debug_dep(dep_openexr) - -ExternalProject_Add(dep_openvdb - EXCLUDE_FROM_ALL 1 - #URL https://github.com/AcademySoftwareFoundation/openvdb/archive/v6.2.1.zip - #URL_HASH SHA256=dc337399dce8e1c9f21f20e97b1ce7e4933cb0a63bb3b8b734d8fcc464aa0c48 - GIT_REPOSITORY https://github.com/AcademySoftwareFoundation/openvdb.git - GIT_TAG aebaf8d95be5e57fd33949281ec357db4a576c2e #v6.2.1 - DEPENDS dep_blosc dep_openexr dep_tbb dep_boost - CMAKE_GENERATOR "${DEP_MSVC_GEN}" - CMAKE_GENERATOR_PLATFORM "${DEP_PLATFORM}" - CMAKE_ARGS - -DCMAKE_INSTALL_PREFIX=${DESTDIR}/usr/local - -DCMAKE_DEBUG_POSTFIX=d - -DCMAKE_PREFIX_PATH=${DESTDIR}/usr/local - -DBUILD_SHARED_LIBS=OFF - -DCMAKE_POSITION_INDEPENDENT_CODE=ON - -DOPENVDB_BUILD_PYTHON_MODULE=OFF - -DUSE_BLOSC=ON - -DOPENVDB_CORE_SHARED=OFF - -DOPENVDB_CORE_STATIC=ON - -DTBB_STATIC=ON - -DOPENVDB_BUILD_VDB_PRINT=ON - BUILD_COMMAND msbuild /m /P:Configuration=Release INSTALL.vcxproj - PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && - ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_SOURCE_DIR}/openvdb-mods.patch - INSTALL_COMMAND "" -) - -if (${DEP_DEBUG}) - ExternalProject_Get_Property(dep_openvdb BINARY_DIR) - ExternalProject_Add_Step(dep_openvdb build_debug - DEPENDEES build - DEPENDERS install - COMMAND ${CMAKE_COMMAND} ../dep_openvdb -DOPENVDB_BUILD_VDB_PRINT=OFF - COMMAND msbuild /m /P:Configuration=Debug INSTALL.vcxproj - WORKING_DIRECTORY "${BINARY_DIR}" - ) -endif () - diff --git a/deps/openvdb-mods.patch b/deps/openvdb-mods.patch deleted file mode 100644 index d80d0ffde..000000000 --- a/deps/openvdb-mods.patch +++ /dev/null @@ -1,1908 +0,0 @@ -From d359098d9989ac7dbd149611d6ac941529fb4157 Mon Sep 17 00:00:00 2001 -From: tamasmeszaros -Date: Thu, 23 Jan 2020 17:17:36 +0100 -Subject: [PATCH] openvdb-mods - ---- - CMakeLists.txt | 3 - - cmake/CheckAtomic.cmake | 106 ++++++ - cmake/FindBlosc.cmake | 218 ------------ - cmake/FindCppUnit.cmake | 4 +- - cmake/FindIlmBase.cmake | 337 ------------------ - cmake/FindOpenEXR.cmake | 329 ------------------ - cmake/FindOpenVDB.cmake | 19 +- - cmake/FindTBB.cmake | 599 ++++++++++++++++---------------- - openvdb/CMakeLists.txt | 16 +- - openvdb/Grid.cc | 3 + - openvdb/PlatformConfig.h | 9 +- - openvdb/cmd/CMakeLists.txt | 4 +- - openvdb/unittest/CMakeLists.txt | 3 +- - openvdb/unittest/TestFile.cc | 2 +- - 14 files changed, 442 insertions(+), 1210 deletions(-) - create mode 100644 cmake/CheckAtomic.cmake - delete mode 100644 cmake/FindBlosc.cmake - delete mode 100644 cmake/FindIlmBase.cmake - delete mode 100644 cmake/FindOpenEXR.cmake - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 580b353..6d364c1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -267,12 +267,9 @@ endif() - - if(OPENVDB_INSTALL_CMAKE_MODULES) - set(OPENVDB_CMAKE_MODULES -- cmake/FindBlosc.cmake - cmake/FindCppUnit.cmake - cmake/FindJemalloc.cmake -- cmake/FindIlmBase.cmake - cmake/FindLog4cplus.cmake -- cmake/FindOpenEXR.cmake - cmake/FindOpenVDB.cmake - cmake/FindTBB.cmake - cmake/OpenVDBGLFW3Setup.cmake -diff --git a/cmake/CheckAtomic.cmake b/cmake/CheckAtomic.cmake -new file mode 100644 -index 0000000..c045e30 ---- /dev/null -+++ b/cmake/CheckAtomic.cmake -@@ -0,0 +1,106 @@ -+# atomic builtins are required for threading support. -+ -+INCLUDE(CheckCXXSourceCompiles) -+INCLUDE(CheckLibraryExists) -+ -+# Sometimes linking against libatomic is required for atomic ops, if -+# the platform doesn't support lock-free atomics. -+ -+function(check_working_cxx_atomics varname) -+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) -+ set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -std=c++11") -+ CHECK_CXX_SOURCE_COMPILES(" -+#include -+std::atomic x; -+int main() { -+ return x; -+} -+" ${varname}) -+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) -+endfunction(check_working_cxx_atomics) -+ -+function(check_working_cxx_atomics64 varname) -+ set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS}) -+ set(CMAKE_REQUIRED_FLAGS "-std=c++11 ${CMAKE_REQUIRED_FLAGS}") -+ CHECK_CXX_SOURCE_COMPILES(" -+#include -+#include -+std::atomic x (0); -+int main() { -+ uint64_t i = x.load(std::memory_order_relaxed); -+ return 0; -+} -+" ${varname}) -+ set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS}) -+endfunction(check_working_cxx_atomics64) -+ -+ -+# This isn't necessary on MSVC, so avoid command-line switch annoyance -+# by only running on GCC-like hosts. -+if (LLVM_COMPILER_IS_GCC_COMPATIBLE) -+ # First check if atomics work without the library. -+ check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITHOUT_LIB) -+ # If not, check if the library exists, and atomics work with it. -+ if(NOT HAVE_CXX_ATOMICS_WITHOUT_LIB) -+ check_library_exists(atomic __atomic_fetch_add_4 "" HAVE_LIBATOMIC) -+ if( HAVE_LIBATOMIC ) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") -+ check_working_cxx_atomics(HAVE_CXX_ATOMICS_WITH_LIB) -+ if (NOT HAVE_CXX_ATOMICS_WITH_LIB) -+ message(FATAL_ERROR "Host compiler must support std::atomic!") -+ endif() -+ else() -+ message(FATAL_ERROR "Host compiler appears to require libatomic, but cannot find it.") -+ endif() -+ endif() -+endif() -+ -+# Check for 64 bit atomic operations. -+if(MSVC) -+ set(HAVE_CXX_ATOMICS64_WITHOUT_LIB True) -+else() -+ check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITHOUT_LIB) -+endif() -+ -+# If not, check if the library exists, and atomics work with it. -+if(NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB) -+ check_library_exists(atomic __atomic_load_8 "" HAVE_CXX_LIBATOMICS64) -+ if(HAVE_CXX_LIBATOMICS64) -+ list(APPEND CMAKE_REQUIRED_LIBRARIES "atomic") -+ check_working_cxx_atomics64(HAVE_CXX_ATOMICS64_WITH_LIB) -+ if (NOT HAVE_CXX_ATOMICS64_WITH_LIB) -+ message(FATAL_ERROR "Host compiler must support 64-bit std::atomic!") -+ endif() -+ else() -+ message(FATAL_ERROR "Host compiler appears to require libatomic for 64-bit operations, but cannot find it.") -+ endif() -+endif() -+ -+## TODO: This define is only used for the legacy atomic operations in -+## llvm's Atomic.h, which should be replaced. Other code simply -+## assumes C++11 works. -+CHECK_CXX_SOURCE_COMPILES(" -+#ifdef _MSC_VER -+#include -+#endif -+int main() { -+#ifdef _MSC_VER -+ volatile LONG val = 1; -+ MemoryBarrier(); -+ InterlockedCompareExchange(&val, 0, 1); -+ InterlockedIncrement(&val); -+ InterlockedDecrement(&val); -+#else -+ volatile unsigned long val = 1; -+ __sync_synchronize(); -+ __sync_val_compare_and_swap(&val, 1, 0); -+ __sync_add_and_fetch(&val, 1); -+ __sync_sub_and_fetch(&val, 1); -+#endif -+ return 0; -+ } -+" LLVM_HAS_ATOMICS) -+ -+if( NOT LLVM_HAS_ATOMICS ) -+ message(STATUS "Warning: LLVM will be built thread-unsafe because atomic builtins are missing") -+endif() -\ No newline at end of file -diff --git a/cmake/FindBlosc.cmake b/cmake/FindBlosc.cmake -deleted file mode 100644 -index 5aacfdd..0000000 ---- a/cmake/FindBlosc.cmake -+++ /dev/null -@@ -1,218 +0,0 @@ --# Copyright (c) DreamWorks Animation LLC --# --# All rights reserved. This software is distributed under the --# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ ) --# --# Redistributions of source code must retain the above copyright --# and license notice and the following restrictions and disclaimer. --# --# * Neither the name of DreamWorks Animation nor the names of --# its contributors may be used to endorse or promote products derived --# from this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE --# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00. --# --#[=======================================================================[.rst: -- --FindBlosc ----------- -- --Find Blosc include dirs and libraries -- --Use this module by invoking find_package with the form:: -- -- find_package(Blosc -- [version] [EXACT] # Minimum or EXACT version e.g. 1.5.0 -- [REQUIRED] # Fail with error if Blosc is not found -- ) -- --IMPORTED Targets --^^^^^^^^^^^^^^^^ -- --``Blosc::blosc`` -- This module defines IMPORTED target Blosc::Blosc, if Blosc has been found. -- --Result Variables --^^^^^^^^^^^^^^^^ -- --This will define the following variables: -- --``Blosc_FOUND`` -- True if the system has the Blosc library. --``Blosc_VERSION`` -- The version of the Blosc library which was found. --``Blosc_INCLUDE_DIRS`` -- Include directories needed to use Blosc. --``Blosc_LIBRARIES`` -- Libraries needed to link to Blosc. --``Blosc_LIBRARY_DIRS`` -- Blosc library directories. -- --Cache Variables --^^^^^^^^^^^^^^^ -- --The following cache variables may also be set: -- --``Blosc_INCLUDE_DIR`` -- The directory containing ``blosc.h``. --``Blosc_LIBRARY`` -- The path to the Blosc library. -- --Hints --^^^^^ -- --Instead of explicitly setting the cache variables, the following variables --may be provided to tell this module where to look. -- --``BLOSC_ROOT`` -- Preferred installation prefix. --``BLOSC_INCLUDEDIR`` -- Preferred include directory e.g. /include --``BLOSC_LIBRARYDIR`` -- Preferred library directory e.g. /lib --``SYSTEM_LIBRARY_PATHS`` -- Paths appended to all include and lib searches. -- --#]=======================================================================] -- --mark_as_advanced( -- Blosc_INCLUDE_DIR -- Blosc_LIBRARY --) -- --# Append BLOSC_ROOT or $ENV{BLOSC_ROOT} if set (prioritize the direct cmake var) --set(_BLOSC_ROOT_SEARCH_DIR "") -- --if(BLOSC_ROOT) -- list(APPEND _BLOSC_ROOT_SEARCH_DIR ${BLOSC_ROOT}) --else() -- set(_ENV_BLOSC_ROOT $ENV{BLOSC_ROOT}) -- if(_ENV_BLOSC_ROOT) -- list(APPEND _BLOSC_ROOT_SEARCH_DIR ${_ENV_BLOSC_ROOT}) -- endif() --endif() -- --# Additionally try and use pkconfig to find blosc -- --find_package(PkgConfig) --pkg_check_modules(PC_Blosc QUIET blosc) -- --# ------------------------------------------------------------------------ --# Search for blosc include DIR --# ------------------------------------------------------------------------ -- --set(_BLOSC_INCLUDE_SEARCH_DIRS "") --list(APPEND _BLOSC_INCLUDE_SEARCH_DIRS -- ${BLOSC_INCLUDEDIR} -- ${_BLOSC_ROOT_SEARCH_DIR} -- ${PC_Blosc_INCLUDE_DIRS} -- ${SYSTEM_LIBRARY_PATHS} --) -- --# Look for a standard blosc header file. --find_path(Blosc_INCLUDE_DIR blosc.h -- NO_DEFAULT_PATH -- PATHS ${_BLOSC_INCLUDE_SEARCH_DIRS} -- PATH_SUFFIXES include --) -- --if(EXISTS "${Blosc_INCLUDE_DIR}/blosc.h") -- file(STRINGS "${Blosc_INCLUDE_DIR}/blosc.h" -- _blosc_version_major_string REGEX "#define BLOSC_VERSION_MAJOR +[0-9]+ " -- ) -- string(REGEX REPLACE "#define BLOSC_VERSION_MAJOR +([0-9]+).*$" "\\1" -- _blosc_version_major_string "${_blosc_version_major_string}" -- ) -- string(STRIP "${_blosc_version_major_string}" Blosc_VERSION_MAJOR) -- -- file(STRINGS "${Blosc_INCLUDE_DIR}/blosc.h" -- _blosc_version_minor_string REGEX "#define BLOSC_VERSION_MINOR +[0-9]+ " -- ) -- string(REGEX REPLACE "#define BLOSC_VERSION_MINOR +([0-9]+).*$" "\\1" -- _blosc_version_minor_string "${_blosc_version_minor_string}" -- ) -- string(STRIP "${_blosc_version_minor_string}" Blosc_VERSION_MINOR) -- -- unset(_blosc_version_major_string) -- unset(_blosc_version_minor_string) -- -- set(Blosc_VERSION ${Blosc_VERSION_MAJOR}.${Blosc_VERSION_MINOR}) --endif() -- --# ------------------------------------------------------------------------ --# Search for blosc lib DIR --# ------------------------------------------------------------------------ -- --set(_BLOSC_LIBRARYDIR_SEARCH_DIRS "") --list(APPEND _BLOSC_LIBRARYDIR_SEARCH_DIRS -- ${BLOSC_LIBRARYDIR} -- ${_BLOSC_ROOT_SEARCH_DIR} -- ${PC_Blosc_LIBRARY_DIRS} -- ${SYSTEM_LIBRARY_PATHS} --) -- --# Static library setup --if(UNIX AND BLOSC_USE_STATIC_LIBS) -- set(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") --endif() -- --set(BLOSC_PATH_SUFFIXES -- lib64 -- lib --) -- --find_library(Blosc_LIBRARY blosc -- NO_DEFAULT_PATH -- PATHS ${_BLOSC_LIBRARYDIR_SEARCH_DIRS} -- PATH_SUFFIXES ${BLOSC_PATH_SUFFIXES} --) -- --if(UNIX AND BLOSC_USE_STATIC_LIBS) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) -- unset(_BLOSC_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) --endif() -- --# ------------------------------------------------------------------------ --# Cache and set Blosc_FOUND --# ------------------------------------------------------------------------ -- --include(FindPackageHandleStandardArgs) --find_package_handle_standard_args(Blosc -- FOUND_VAR Blosc_FOUND -- REQUIRED_VARS -- Blosc_LIBRARY -- Blosc_INCLUDE_DIR -- VERSION_VAR Blosc_VERSION --) -- --if(Blosc_FOUND) -- set(Blosc_LIBRARIES ${Blosc_LIBRARY}) -- set(Blosc_INCLUDE_DIRS ${Blosc_INCLUDE_DIR}) -- set(Blosc_DEFINITIONS ${PC_Blosc_CFLAGS_OTHER}) -- -- get_filename_component(Blosc_LIBRARY_DIRS ${Blosc_LIBRARY} DIRECTORY) -- -- if(NOT TARGET Blosc::blosc) -- add_library(Blosc::blosc UNKNOWN IMPORTED) -- set_target_properties(Blosc::blosc PROPERTIES -- IMPORTED_LOCATION "${Blosc_LIBRARIES}" -- INTERFACE_COMPILE_DEFINITIONS "${Blosc_DEFINITIONS}" -- INTERFACE_INCLUDE_DIRECTORIES "${Blosc_INCLUDE_DIRS}" -- ) -- endif() --elseif(Blosc_FIND_REQUIRED) -- message(FATAL_ERROR "Unable to find Blosc") --endif() -diff --git a/cmake/FindCppUnit.cmake b/cmake/FindCppUnit.cmake -index e2beb93..a891624 100644 ---- a/cmake/FindCppUnit.cmake -+++ b/cmake/FindCppUnit.cmake -@@ -125,7 +125,7 @@ list(APPEND _CPPUNIT_INCLUDE_SEARCH_DIRS - - # Look for a standard cppunit header file. - find_path(CppUnit_INCLUDE_DIR cppunit/Portability.h -- NO_DEFAULT_PATH -+ # NO_DEFAULT_PATH - PATHS ${_CPPUNIT_INCLUDE_SEARCH_DIRS} - PATH_SUFFIXES include - ) -@@ -177,7 +177,7 @@ set(CPPUNIT_PATH_SUFFIXES - ) - - find_library(CppUnit_LIBRARY cppunit -- NO_DEFAULT_PATH -+ # NO_DEFAULT_PATH - PATHS ${_CPPUNIT_LIBRARYDIR_SEARCH_DIRS} - PATH_SUFFIXES ${CPPUNIT_PATH_SUFFIXES} - ) -diff --git a/cmake/FindIlmBase.cmake b/cmake/FindIlmBase.cmake -deleted file mode 100644 -index 9dbc252..0000000 ---- a/cmake/FindIlmBase.cmake -+++ /dev/null -@@ -1,337 +0,0 @@ --# Copyright (c) DreamWorks Animation LLC --# --# All rights reserved. This software is distributed under the --# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ ) --# --# Redistributions of source code must retain the above copyright --# and license notice and the following restrictions and disclaimer. --# --# * Neither the name of DreamWorks Animation nor the names of --# its contributors may be used to endorse or promote products derived --# from this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE --# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00. --# --#[=======================================================================[.rst: -- --FindIlmBase ------------- -- --Find IlmBase include dirs and libraries -- --Use this module by invoking find_package with the form:: -- -- find_package(IlmBase -- [version] [EXACT] # Minimum or EXACT version -- [REQUIRED] # Fail with error if IlmBase is not found -- [COMPONENTS ...] # IlmBase libraries by their canonical name -- # e.g. "Half" for "libHalf" -- ) -- --IMPORTED Targets --^^^^^^^^^^^^^^^^ -- --``IlmBase::Half`` -- The Half library target. --``IlmBase::Iex`` -- The Iex library target. --``IlmBase::IexMath`` -- The IexMath library target. --``IlmBase::IlmThread`` -- The IlmThread library target. --``IlmBase::Imath`` -- The Imath library target. -- --Result Variables --^^^^^^^^^^^^^^^^ -- --This will define the following variables: -- --``IlmBase_FOUND`` -- True if the system has the IlmBase library. --``IlmBase_VERSION`` -- The version of the IlmBase library which was found. --``IlmBase_INCLUDE_DIRS`` -- Include directories needed to use IlmBase. --``IlmBase_LIBRARIES`` -- Libraries needed to link to IlmBase. --``IlmBase_LIBRARY_DIRS`` -- IlmBase library directories. --``IlmBase_{COMPONENT}_FOUND`` -- True if the system has the named IlmBase component. -- --Cache Variables --^^^^^^^^^^^^^^^ -- --The following cache variables may also be set: -- --``IlmBase_INCLUDE_DIR`` -- The directory containing ``IlmBase/config-auto.h``. --``IlmBase_{COMPONENT}_LIBRARY`` -- Individual component libraries for IlmBase --``IlmBase_{COMPONENT}_DLL`` -- Individual component dlls for IlmBase on Windows. -- --Hints --^^^^^ -- --Instead of explicitly setting the cache variables, the following variables --may be provided to tell this module where to look. -- --``ILMBASE_ROOT`` -- Preferred installation prefix. --``ILMBASE_INCLUDEDIR`` -- Preferred include directory e.g. /include --``ILMBASE_LIBRARYDIR`` -- Preferred library directory e.g. /lib --``SYSTEM_LIBRARY_PATHS`` -- Paths appended to all include and lib searches. -- --#]=======================================================================] -- --# Support new if() IN_LIST operator --if(POLICY CMP0057) -- cmake_policy(SET CMP0057 NEW) --endif() -- --mark_as_advanced( -- IlmBase_INCLUDE_DIR -- IlmBase_LIBRARY --) -- --set(_ILMBASE_COMPONENT_LIST -- Half -- Iex -- IexMath -- IlmThread -- Imath --) -- --if(IlmBase_FIND_COMPONENTS) -- set(ILMBASE_COMPONENTS_PROVIDED TRUE) -- set(_IGNORED_COMPONENTS "") -- foreach(COMPONENT ${IlmBase_FIND_COMPONENTS}) -- if(NOT ${COMPONENT} IN_LIST _ILMBASE_COMPONENT_LIST) -- list(APPEND _IGNORED_COMPONENTS ${COMPONENT}) -- endif() -- endforeach() -- -- if(_IGNORED_COMPONENTS) -- message(STATUS "Ignoring unknown components of IlmBase:") -- foreach(COMPONENT ${_IGNORED_COMPONENTS}) -- message(STATUS " ${COMPONENT}") -- endforeach() -- list(REMOVE_ITEM IlmBase_FIND_COMPONENTS ${_IGNORED_COMPONENTS}) -- endif() --else() -- set(ILMBASE_COMPONENTS_PROVIDED FALSE) -- set(IlmBase_FIND_COMPONENTS ${_ILMBASE_COMPONENT_LIST}) --endif() -- --# Append ILMBASE_ROOT or $ENV{ILMBASE_ROOT} if set (prioritize the direct cmake var) --set(_ILMBASE_ROOT_SEARCH_DIR "") -- --if(ILMBASE_ROOT) -- list(APPEND _ILMBASE_ROOT_SEARCH_DIR ${ILMBASE_ROOT}) --else() -- set(_ENV_ILMBASE_ROOT $ENV{ILMBASE_ROOT}) -- if(_ENV_ILMBASE_ROOT) -- list(APPEND _ILMBASE_ROOT_SEARCH_DIR ${_ENV_ILMBASE_ROOT}) -- endif() --endif() -- --# Additionally try and use pkconfig to find IlmBase -- --find_package(PkgConfig) --pkg_check_modules(PC_IlmBase QUIET IlmBase) -- --# ------------------------------------------------------------------------ --# Search for IlmBase include DIR --# ------------------------------------------------------------------------ -- --set(_ILMBASE_INCLUDE_SEARCH_DIRS "") --list(APPEND _ILMBASE_INCLUDE_SEARCH_DIRS -- ${ILMBASE_INCLUDEDIR} -- ${_ILMBASE_ROOT_SEARCH_DIR} -- ${PC_IlmBase_INCLUDEDIR} -- ${SYSTEM_LIBRARY_PATHS} --) -- --# Look for a standard IlmBase header file. --find_path(IlmBase_INCLUDE_DIR IlmBaseConfig.h -- NO_DEFAULT_PATH -- PATHS ${_ILMBASE_INCLUDE_SEARCH_DIRS} -- PATH_SUFFIXES include/OpenEXR OpenEXR --) -- --if(EXISTS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h") -- # Get the ILMBASE version information from the config header -- file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h" -- _ilmbase_version_major_string REGEX "#define ILMBASE_VERSION_MAJOR " -- ) -- string(REGEX REPLACE "#define ILMBASE_VERSION_MAJOR" "" -- _ilmbase_version_major_string "${_ilmbase_version_major_string}" -- ) -- string(STRIP "${_ilmbase_version_major_string}" IlmBase_VERSION_MAJOR) -- -- file(STRINGS "${IlmBase_INCLUDE_DIR}/IlmBaseConfig.h" -- _ilmbase_version_minor_string REGEX "#define ILMBASE_VERSION_MINOR " -- ) -- string(REGEX REPLACE "#define ILMBASE_VERSION_MINOR" "" -- _ilmbase_version_minor_string "${_ilmbase_version_minor_string}" -- ) -- string(STRIP "${_ilmbase_version_minor_string}" IlmBase_VERSION_MINOR) -- -- unset(_ilmbase_version_major_string) -- unset(_ilmbase_version_minor_string) -- -- set(IlmBase_VERSION ${IlmBase_VERSION_MAJOR}.${IlmBase_VERSION_MINOR}) --endif() -- --# ------------------------------------------------------------------------ --# Search for ILMBASE lib DIR --# ------------------------------------------------------------------------ -- --set(_ILMBASE_LIBRARYDIR_SEARCH_DIRS "") -- --# Append to _ILMBASE_LIBRARYDIR_SEARCH_DIRS in priority order -- --list(APPEND _ILMBASE_LIBRARYDIR_SEARCH_DIRS -- ${ILMBASE_LIBRARYDIR} -- ${_ILMBASE_ROOT_SEARCH_DIR} -- ${PC_IlmBase_LIBDIR} -- ${SYSTEM_LIBRARY_PATHS} --) -- --# Build suffix directories -- --set(ILMBASE_PATH_SUFFIXES -- lib64 -- lib --) -- --if(UNIX) -- list(INSERT ILMBASE_PATH_SUFFIXES 0 lib/x86_64-linux-gnu) --endif() -- --set(_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- --# library suffix handling --if(WIN32) -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.lib" -- ) --else() -- if(ILMBASE_USE_STATIC_LIBS) -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.a" -- ) -- else() -- if(APPLE) -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.dylib" -- ) -- else() -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${IlmBase_VERSION_MAJOR}_${IlmBase_VERSION_MINOR}.so" -- ) -- endif() -- endif() --endif() -- --set(IlmBase_LIB_COMPONENTS "") -- --foreach(COMPONENT ${IlmBase_FIND_COMPONENTS}) -- find_library(IlmBase_${COMPONENT}_LIBRARY ${COMPONENT} -- NO_DEFAULT_PATH -- PATHS ${_ILMBASE_LIBRARYDIR_SEARCH_DIRS} -- PATH_SUFFIXES ${ILMBASE_PATH_SUFFIXES} -- ) -- list(APPEND IlmBase_LIB_COMPONENTS ${IlmBase_${COMPONENT}_LIBRARY}) -- -- if(WIN32 AND NOT ILMBASE_USE_STATIC_LIBS) -- set(_ILMBASE_TMP ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll") -- find_library(IlmBase_${COMPONENT}_DLL ${COMPONENT} -- NO_DEFAULT_PATH -- PATHS ${_ILMBASE_LIBRARYDIR_SEARCH_DIRS} -- PATH_SUFFIXES bin -- ) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ILMBASE_TMP}) -- unset(_ILMBASE_TMP) -- endif() -- -- if(IlmBase_${COMPONENT}_LIBRARY) -- set(IlmBase_${COMPONENT}_FOUND TRUE) -- else() -- set(IlmBase_${COMPONENT}_FOUND FALSE) -- endif() --endforeach() -- --# reset lib suffix -- --set(CMAKE_FIND_LIBRARY_SUFFIXES ${_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) --unset(_ILMBASE_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) -- --# ------------------------------------------------------------------------ --# Cache and set ILMBASE_FOUND --# ------------------------------------------------------------------------ -- --include(FindPackageHandleStandardArgs) --find_package_handle_standard_args(IlmBase -- FOUND_VAR IlmBase_FOUND -- REQUIRED_VARS -- IlmBase_INCLUDE_DIR -- IlmBase_LIB_COMPONENTS -- VERSION_VAR IlmBase_VERSION -- HANDLE_COMPONENTS --) -- --if(IlmBase_FOUND) -- set(IlmBase_LIBRARIES ${IlmBase_LIB_COMPONENTS}) -- -- # We have to add both include and include/OpenEXR to the include -- # path in case OpenEXR and IlmBase are installed separately -- -- set(IlmBase_INCLUDE_DIRS) -- list(APPEND IlmBase_INCLUDE_DIRS -- ${IlmBase_INCLUDE_DIR}/../ -- ${IlmBase_INCLUDE_DIR} -- ) -- set(IlmBase_DEFINITIONS ${PC_IlmBase_CFLAGS_OTHER}) -- -- set(IlmBase_LIBRARY_DIRS "") -- foreach(LIB ${IlmBase_LIB_COMPONENTS}) -- get_filename_component(_ILMBASE_LIBDIR ${LIB} DIRECTORY) -- list(APPEND IlmBase_LIBRARY_DIRS ${_ILMBASE_LIBDIR}) -- endforeach() -- list(REMOVE_DUPLICATES IlmBase_LIBRARY_DIRS) -- -- # Configure imported targets -- -- foreach(COMPONENT ${IlmBase_FIND_COMPONENTS}) -- if(NOT TARGET IlmBase::${COMPONENT}) -- add_library(IlmBase::${COMPONENT} UNKNOWN IMPORTED) -- set_target_properties(IlmBase::${COMPONENT} PROPERTIES -- IMPORTED_LOCATION "${IlmBase_${COMPONENT}_LIBRARY}" -- INTERFACE_COMPILE_OPTIONS "${IlmBase_DEFINITIONS}" -- INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}" -- ) -- endif() -- endforeach() -- --elseif(IlmBase_FIND_REQUIRED) -- message(FATAL_ERROR "Unable to find IlmBase") --endif() -diff --git a/cmake/FindOpenEXR.cmake b/cmake/FindOpenEXR.cmake -deleted file mode 100644 -index 339c1a2..0000000 ---- a/cmake/FindOpenEXR.cmake -+++ /dev/null -@@ -1,329 +0,0 @@ --# Copyright (c) DreamWorks Animation LLC --# --# All rights reserved. This software is distributed under the --# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ ) --# --# Redistributions of source code must retain the above copyright --# and license notice and the following restrictions and disclaimer. --# --# * Neither the name of DreamWorks Animation nor the names of --# its contributors may be used to endorse or promote products derived --# from this software without specific prior written permission. --# --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE --# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00. --# --#[=======================================================================[.rst: -- --FindOpenEXR ------------- -- --Find OpenEXR include dirs and libraries -- --Use this module by invoking find_package with the form:: -- -- find_package(OpenEXR -- [version] [EXACT] # Minimum or EXACT version -- [REQUIRED] # Fail with error if OpenEXR is not found -- [COMPONENTS ...] # OpenEXR libraries by their canonical name -- # e.g. "IlmImf" for "libIlmImf" -- ) -- --IMPORTED Targets --^^^^^^^^^^^^^^^^ -- --``OpenEXR::IlmImf`` -- The IlmImf library target. --``OpenEXR::IlmImfUtil`` -- The IlmImfUtil library target. -- --Result Variables --^^^^^^^^^^^^^^^^ -- --This will define the following variables: -- --``OpenEXR_FOUND`` -- True if the system has the OpenEXR library. --``OpenEXR_VERSION`` -- The version of the OpenEXR library which was found. --``OpenEXR_INCLUDE_DIRS`` -- Include directories needed to use OpenEXR. --``OpenEXR_LIBRARIES`` -- Libraries needed to link to OpenEXR. --``OpenEXR_LIBRARY_DIRS`` -- OpenEXR library directories. --``OpenEXR_DEFINITIONS`` -- Definitions to use when compiling code that uses OpenEXR. --``OpenEXR_{COMPONENT}_FOUND`` -- True if the system has the named OpenEXR component. -- --Cache Variables --^^^^^^^^^^^^^^^ -- --The following cache variables may also be set: -- --``OpenEXR_INCLUDE_DIR`` -- The directory containing ``OpenEXR/config-auto.h``. --``OpenEXR_{COMPONENT}_LIBRARY`` -- Individual component libraries for OpenEXR --``OpenEXR_{COMPONENT}_DLL`` -- Individual component dlls for OpenEXR on Windows. -- --Hints --^^^^^ -- --Instead of explicitly setting the cache variables, the following variables --may be provided to tell this module where to look. -- --``OPENEXR_ROOT`` -- Preferred installation prefix. --``OPENEXR_INCLUDEDIR`` -- Preferred include directory e.g. /include --``OPENEXR_LIBRARYDIR`` -- Preferred library directory e.g. /lib --``SYSTEM_LIBRARY_PATHS`` -- Paths appended to all include and lib searches. -- --#]=======================================================================] -- --# Support new if() IN_LIST operator --if(POLICY CMP0057) -- cmake_policy(SET CMP0057 NEW) --endif() -- --mark_as_advanced( -- OpenEXR_INCLUDE_DIR -- OpenEXR_LIBRARY --) -- --set(_OPENEXR_COMPONENT_LIST -- IlmImf -- IlmImfUtil --) -- --if(OpenEXR_FIND_COMPONENTS) -- set(OPENEXR_COMPONENTS_PROVIDED TRUE) -- set(_IGNORED_COMPONENTS "") -- foreach(COMPONENT ${OpenEXR_FIND_COMPONENTS}) -- if(NOT ${COMPONENT} IN_LIST _OPENEXR_COMPONENT_LIST) -- list(APPEND _IGNORED_COMPONENTS ${COMPONENT}) -- endif() -- endforeach() -- -- if(_IGNORED_COMPONENTS) -- message(STATUS "Ignoring unknown components of OpenEXR:") -- foreach(COMPONENT ${_IGNORED_COMPONENTS}) -- message(STATUS " ${COMPONENT}") -- endforeach() -- list(REMOVE_ITEM OpenEXR_FIND_COMPONENTS ${_IGNORED_COMPONENTS}) -- endif() --else() -- set(OPENEXR_COMPONENTS_PROVIDED FALSE) -- set(OpenEXR_FIND_COMPONENTS ${_OPENEXR_COMPONENT_LIST}) --endif() -- --# Append OPENEXR_ROOT or $ENV{OPENEXR_ROOT} if set (prioritize the direct cmake var) --set(_OPENEXR_ROOT_SEARCH_DIR "") -- --if(OPENEXR_ROOT) -- list(APPEND _OPENEXR_ROOT_SEARCH_DIR ${OPENEXR_ROOT}) --else() -- set(_ENV_OPENEXR_ROOT $ENV{OPENEXR_ROOT}) -- if(_ENV_OPENEXR_ROOT) -- list(APPEND _OPENEXR_ROOT_SEARCH_DIR ${_ENV_OPENEXR_ROOT}) -- endif() --endif() -- --# Additionally try and use pkconfig to find OpenEXR -- --find_package(PkgConfig) --pkg_check_modules(PC_OpenEXR QUIET OpenEXR) -- --# ------------------------------------------------------------------------ --# Search for OpenEXR include DIR --# ------------------------------------------------------------------------ -- --set(_OPENEXR_INCLUDE_SEARCH_DIRS "") --list(APPEND _OPENEXR_INCLUDE_SEARCH_DIRS -- ${OPENEXR_INCLUDEDIR} -- ${_OPENEXR_ROOT_SEARCH_DIR} -- ${PC_OpenEXR_INCLUDEDIR} -- ${SYSTEM_LIBRARY_PATHS} --) -- --# Look for a standard OpenEXR header file. --find_path(OpenEXR_INCLUDE_DIR OpenEXRConfig.h -- NO_DEFAULT_PATH -- PATHS ${_OPENEXR_INCLUDE_SEARCH_DIRS} -- PATH_SUFFIXES include/OpenEXR OpenEXR --) -- --if(EXISTS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h") -- # Get the EXR version information from the config header -- file(STRINGS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h" -- _openexr_version_major_string REGEX "#define OPENEXR_VERSION_MAJOR " -- ) -- string(REGEX REPLACE "#define OPENEXR_VERSION_MAJOR" "" -- _openexr_version_major_string "${_openexr_version_major_string}" -- ) -- string(STRIP "${_openexr_version_major_string}" OpenEXR_VERSION_MAJOR) -- -- file(STRINGS "${OpenEXR_INCLUDE_DIR}/OpenEXRConfig.h" -- _openexr_version_minor_string REGEX "#define OPENEXR_VERSION_MINOR " -- ) -- string(REGEX REPLACE "#define OPENEXR_VERSION_MINOR" "" -- _openexr_version_minor_string "${_openexr_version_minor_string}" -- ) -- string(STRIP "${_openexr_version_minor_string}" OpenEXR_VERSION_MINOR) -- -- unset(_openexr_version_major_string) -- unset(_openexr_version_minor_string) -- -- set(OpenEXR_VERSION ${OpenEXR_VERSION_MAJOR}.${OpenEXR_VERSION_MINOR}) --endif() -- --# ------------------------------------------------------------------------ --# Search for OPENEXR lib DIR --# ------------------------------------------------------------------------ -- --set(_OPENEXR_LIBRARYDIR_SEARCH_DIRS "") -- --# Append to _OPENEXR_LIBRARYDIR_SEARCH_DIRS in priority order -- --list(APPEND _OPENEXR_LIBRARYDIR_SEARCH_DIRS -- ${OPENEXR_LIBRARYDIR} -- ${_OPENEXR_ROOT_SEARCH_DIR} -- ${PC_OpenEXR_LIBDIR} -- ${SYSTEM_LIBRARY_PATHS} --) -- --# Build suffix directories -- --set(OPENEXR_PATH_SUFFIXES -- lib64 -- lib --) -- --if(UNIX ) -- list(INSERT OPENEXR_PATH_SUFFIXES 0 lib/x86_64-linux-gnu) --endif() -- --set(_OPENEXR_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- --# library suffix handling --if(WIN32) -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.lib" -- ) --else() -- if(OPENEXR_USE_STATIC_LIBS) -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.a" -- ) -- else() -- if(APPLE) -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.dylib" -- ) -- else() -- list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES -- "-${OpenEXR_VERSION_MAJOR}_${OpenEXR_VERSION_MINOR}.so" -- ) -- endif() -- endif() --endif() -- --set(OpenEXR_LIB_COMPONENTS "") -- --foreach(COMPONENT ${OpenEXR_FIND_COMPONENTS}) -- find_library(OpenEXR_${COMPONENT}_LIBRARY ${COMPONENT} -- NO_DEFAULT_PATH -- PATHS ${_OPENEXR_LIBRARYDIR_SEARCH_DIRS} -- PATH_SUFFIXES ${OPENEXR_PATH_SUFFIXES} -- ) -- list(APPEND OpenEXR_LIB_COMPONENTS ${OpenEXR_${COMPONENT}_LIBRARY}) -- -- if(WIN32 AND NOT OPENEXR_USE_STATIC_LIBS) -- set(_OPENEXR_TMP ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ".dll") -- find_library(OpenEXR_${COMPONENT}_DLL ${COMPONENT} -- NO_DEFAULT_PATH -- PATHS ${_OPENEXR_LIBRARYDIR_SEARCH_DIRS} -- PATH_SUFFIXES bin -- ) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${_OPENEXR_TMP}) -- unset(_OPENEXR_TMP) -- endif() -- -- if(OpenEXR_${COMPONENT}_LIBRARY) -- set(OpenEXR_${COMPONENT}_FOUND TRUE) -- else() -- set(OpenEXR_${COMPONENT}_FOUND FALSE) -- endif() --endforeach() -- --# reset lib suffix -- --set(CMAKE_FIND_LIBRARY_SUFFIXES ${_OPENEXR_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) --unset(_OPENEXR_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) -- --# ------------------------------------------------------------------------ --# Cache and set OPENEXR_FOUND --# ------------------------------------------------------------------------ -- --include(FindPackageHandleStandardArgs) --find_package_handle_standard_args(OpenEXR -- FOUND_VAR OpenEXR_FOUND -- REQUIRED_VARS -- OpenEXR_INCLUDE_DIR -- OpenEXR_LIB_COMPONENTS -- VERSION_VAR OpenEXR_VERSION -- HANDLE_COMPONENTS --) -- --if(OpenEXR_FOUND) -- set(OpenEXR_LIBRARIES ${OpenEXR_LIB_COMPONENTS}) -- -- # We have to add both include and include/OpenEXR to the include -- # path in case OpenEXR and IlmBase are installed separately -- -- set(OpenEXR_INCLUDE_DIRS) -- list(APPEND OpenEXR_INCLUDE_DIRS -- ${OpenEXR_INCLUDE_DIR}/../ -- ${OpenEXR_INCLUDE_DIR} -- ) -- set(OpenEXR_DEFINITIONS ${PC_OpenEXR_CFLAGS_OTHER}) -- -- set(OpenEXR_LIBRARY_DIRS "") -- foreach(LIB ${OpenEXR_LIB_COMPONENTS}) -- get_filename_component(_OPENEXR_LIBDIR ${LIB} DIRECTORY) -- list(APPEND OpenEXR_LIBRARY_DIRS ${_OPENEXR_LIBDIR}) -- endforeach() -- list(REMOVE_DUPLICATES OpenEXR_LIBRARY_DIRS) -- -- # Configure imported target -- -- foreach(COMPONENT ${OpenEXR_FIND_COMPONENTS}) -- if(NOT TARGET OpenEXR::${COMPONENT}) -- add_library(OpenEXR::${COMPONENT} UNKNOWN IMPORTED) -- set_target_properties(OpenEXR::${COMPONENT} PROPERTIES -- IMPORTED_LOCATION "${OpenEXR_${COMPONENT}_LIBRARY}" -- INTERFACE_COMPILE_OPTIONS "${OpenEXR_DEFINITIONS}" -- INTERFACE_INCLUDE_DIRECTORIES "${OpenEXR_INCLUDE_DIRS}" -- ) -- endif() -- endforeach() --elseif(OpenEXR_FIND_REQUIRED) -- message(FATAL_ERROR "Unable to find OpenEXR") --endif() -diff --git a/cmake/FindOpenVDB.cmake b/cmake/FindOpenVDB.cmake -index 63a2eda..d9f6d07 100644 ---- a/cmake/FindOpenVDB.cmake -+++ b/cmake/FindOpenVDB.cmake -@@ -244,7 +244,7 @@ set(OpenVDB_LIB_COMPONENTS "") - - foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS}) - set(LIB_NAME ${COMPONENT}) -- find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME} -+ find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME} lib${LIB_NAME} - NO_DEFAULT_PATH - PATHS ${_OPENVDB_LIBRARYDIR_SEARCH_DIRS} - PATH_SUFFIXES ${OPENVDB_PATH_SUFFIXES} -@@ -282,16 +282,13 @@ find_package_handle_standard_args(OpenVDB - # ------------------------------------------------------------------------ - - # Set the ABI number the library was built against. Uses vdb_print -+find_program(OPENVDB_PRINT vdb_print -+ PATHS ${_OPENVDB_INSTALL}/bin ${OpenVDB_INCLUDE_DIR} -+ NO_DEFAULT_PATH) - - if(_OPENVDB_INSTALL) - OPENVDB_ABI_VERSION_FROM_PRINT( -- "${_OPENVDB_INSTALL}/bin/vdb_print" -- ABI OpenVDB_ABI -- ) --else() -- # Try and find vdb_print from the include path -- OPENVDB_ABI_VERSION_FROM_PRINT( -- "${OpenVDB_INCLUDE_DIR}/../bin/vdb_print" -+ "${OPENVDB_PRINT}" - ABI OpenVDB_ABI - ) - endif() -@@ -472,6 +469,12 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS}) - INTERFACE_LINK_LIBRARIES "${_OPENVDB_VISIBLE_DEPENDENCIES}" # visible deps (headers) - INTERFACE_COMPILE_FEATURES cxx_std_11 - ) -+ -+ if (OPENVDB_USE_STATIC_LIBS) -+ set_target_properties(OpenVDB::${COMPONENT} PROPERTIES -+ INTERFACE_COMPILE_DEFINITIONS "OPENVDB_STATICLIB;OPENVDB_OPENEXR_STATICLIB" -+ ) -+ endif() - endif() - endforeach() - -diff --git a/cmake/FindTBB.cmake b/cmake/FindTBB.cmake -index bdf9c81..06093a4 100644 ---- a/cmake/FindTBB.cmake -+++ b/cmake/FindTBB.cmake -@@ -1,333 +1,332 @@ --# Copyright (c) DreamWorks Animation LLC -+# The MIT License (MIT) - # --# All rights reserved. This software is distributed under the --# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ ) -+# Copyright (c) 2015 Justus Calvin - # --# Redistributions of source code must retain the above copyright --# and license notice and the following restrictions and disclaimer. -+# Permission is hereby granted, free of charge, to any person obtaining a copy -+# of this software and associated documentation files (the "Software"), to deal -+# in the Software without restriction, including without limitation the rights -+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -+# copies of the Software, and to permit persons to whom the Software is -+# furnished to do so, subject to the following conditions: - # --# * Neither the name of DreamWorks Animation nor the names of --# its contributors may be used to endorse or promote products derived --# from this software without specific prior written permission. -+# The above copyright notice and this permission notice shall be included in all -+# copies or substantial portions of the Software. - # --# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY INDIRECT, INCIDENTAL, --# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --# IN NO EVENT SHALL THE COPYRIGHT HOLDERS' AND CONTRIBUTORS' AGGREGATE --# LIABILITY FOR ALL CLAIMS REGARDLESS OF THEIR BASIS EXCEED US$250.00. -+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+# SOFTWARE. -+ - # --#[=======================================================================[.rst: -- --FindTBB --------- -- --Find Tbb include dirs and libraries -- --Use this module by invoking find_package with the form:: -- -- find_package(TBB -- [version] [EXACT] # Minimum or EXACT version -- [REQUIRED] # Fail with error if Tbb is not found -- [COMPONENTS ...] # Tbb libraries by their canonical name -- # e.g. "tbb" for "libtbb" -- ) -- --IMPORTED Targets --^^^^^^^^^^^^^^^^ -- --``TBB::tbb`` -- The tbb library target. --``TBB::tbbmalloc`` -- The tbbmalloc library target. --``TBB::tbbmalloc_proxy`` -- The tbbmalloc_proxy library target. -- --Result Variables --^^^^^^^^^^^^^^^^ -- --This will define the following variables: -- --``Tbb_FOUND`` -- True if the system has the Tbb library. --``Tbb_VERSION`` -- The version of the Tbb library which was found. --``Tbb_INCLUDE_DIRS`` -- Include directories needed to use Tbb. --``Tbb_LIBRARIES`` -- Libraries needed to link to Tbb. --``Tbb_LIBRARY_DIRS`` -- Tbb library directories. --``TBB_{COMPONENT}_FOUND`` -- True if the system has the named TBB component. -- --Cache Variables --^^^^^^^^^^^^^^^ -- --The following cache variables may also be set: -- --``Tbb_INCLUDE_DIR`` -- The directory containing ``tbb/tbb_stddef.h``. --``Tbb_{COMPONENT}_LIBRARY`` -- Individual component libraries for Tbb -- --Hints --^^^^^ -- --Instead of explicitly setting the cache variables, the following variables --may be provided to tell this module where to look. -- --``TBB_ROOT`` -- Preferred installation prefix. --``TBB_INCLUDEDIR`` -- Preferred include directory e.g. /include --``TBB_LIBRARYDIR`` -- Preferred library directory e.g. /lib --``SYSTEM_LIBRARY_PATHS`` -- Paths appended to all include and lib searches. -- --#]=======================================================================] -- --# Support new if() IN_LIST operator --if(POLICY CMP0057) -- cmake_policy(SET CMP0057 NEW) --endif() -+# FindTBB -+# ------- -+# -+# Find TBB include directories and libraries. -+# -+# Usage: -+# -+# find_package(TBB [major[.minor]] [EXACT] -+# [QUIET] [REQUIRED] -+# [[COMPONENTS] [components...]] -+# [OPTIONAL_COMPONENTS components...]) -+# -+# where the allowed components are tbbmalloc and tbb_preview. Users may modify -+# the behavior of this module with the following variables: -+# -+# * TBB_ROOT_DIR - The base directory the of TBB installation. -+# * TBB_INCLUDE_DIR - The directory that contains the TBB headers files. -+# * TBB_LIBRARY - The directory that contains the TBB library files. -+# * TBB__LIBRARY - The path of the TBB the corresponding TBB library. -+# These libraries, if specified, override the -+# corresponding library search results, where -+# may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug, -+# tbb_preview, or tbb_preview_debug. -+# * TBB_USE_DEBUG_BUILD - The debug version of tbb libraries, if present, will -+# be used instead of the release version. -+# * TBB_STATIC - Static linking of libraries with a _static suffix. -+# For example, on Windows a tbb_static.lib will be searched for -+# instead of tbb.lib. -+# -+# Users may modify the behavior of this module with the following environment -+# variables: -+# -+# * TBB_INSTALL_DIR -+# * TBBROOT -+# * LIBRARY_PATH -+# -+# This module will set the following variables: -+# -+# * TBB_FOUND - Set to false, or undefined, if we haven’t found, or -+# don’t want to use TBB. -+# * TBB__FOUND - If False, optional part of TBB sytem is -+# not available. -+# * TBB_VERSION - The full version string -+# * TBB_VERSION_MAJOR - The major version -+# * TBB_VERSION_MINOR - The minor version -+# * TBB_INTERFACE_VERSION - The interface version number defined in -+# tbb/tbb_stddef.h. -+# * TBB__LIBRARY_RELEASE - The path of the TBB release version of -+# , where may be tbb, tbb_debug, -+# tbbmalloc, tbbmalloc_debug, tbb_preview, or -+# tbb_preview_debug. -+# * TBB__LIBRARY_DEGUG - The path of the TBB release version of -+# , where may be tbb, tbb_debug, -+# tbbmalloc, tbbmalloc_debug, tbb_preview, or -+# tbb_preview_debug. -+# -+# The following varibles should be used to build and link with TBB: -+# -+# * TBB_INCLUDE_DIRS - The include directory for TBB. -+# * TBB_LIBRARIES - The libraries to link against to use TBB. -+# * TBB_LIBRARIES_RELEASE - The release libraries to link against to use TBB. -+# * TBB_LIBRARIES_DEBUG - The debug libraries to link against to use TBB. -+# * TBB_DEFINITIONS - Definitions to use when compiling code that uses -+# TBB. -+# * TBB_DEFINITIONS_RELEASE - Definitions to use when compiling release code that -+# uses TBB. -+# * TBB_DEFINITIONS_DEBUG - Definitions to use when compiling debug code that -+# uses TBB. -+# -+# This module will also create the "tbb" target that may be used when building -+# executables and libraries. - --mark_as_advanced( -- Tbb_INCLUDE_DIR -- Tbb_LIBRARY --) -- --set(_TBB_COMPONENT_LIST -- tbb -- tbbmalloc -- tbbmalloc_proxy --) -- --if(TBB_FIND_COMPONENTS) -- set(_TBB_COMPONENTS_PROVIDED TRUE) -- set(_IGNORED_COMPONENTS "") -- foreach(COMPONENT ${TBB_FIND_COMPONENTS}) -- if(NOT ${COMPONENT} IN_LIST _TBB_COMPONENT_LIST) -- list(APPEND _IGNORED_COMPONENTS ${COMPONENT}) -- endif() -- endforeach() -+unset(TBB_FOUND CACHE) -+unset(TBB_INCLUDE_DIRS CACHE) -+unset(TBB_LIBRARIES) -+unset(TBB_LIBRARIES_DEBUG) -+unset(TBB_LIBRARIES_RELEASE) - -- if(_IGNORED_COMPONENTS) -- message(STATUS "Ignoring unknown components of TBB:") -- foreach(COMPONENT ${_IGNORED_COMPONENTS}) -- message(STATUS " ${COMPONENT}") -- endforeach() -- list(REMOVE_ITEM TBB_FIND_COMPONENTS ${_IGNORED_COMPONENTS}) -- endif() --else() -- set(_TBB_COMPONENTS_PROVIDED FALSE) -- set(TBB_FIND_COMPONENTS ${_TBB_COMPONENT_LIST}) --endif() -+include(FindPackageHandleStandardArgs) - --# Append TBB_ROOT or $ENV{TBB_ROOT} if set (prioritize the direct cmake var) --set(_TBB_ROOT_SEARCH_DIR "") -+find_package(Threads QUIET REQUIRED) - --if(TBB_ROOT) -- list(APPEND _TBB_ROOT_SEARCH_DIR ${TBB_ROOT}) --else() -- set(_ENV_TBB_ROOT $ENV{TBB_ROOT}) -- if(_ENV_TBB_ROOT) -- list(APPEND _TBB_ROOT_SEARCH_DIR ${_ENV_TBB_ROOT}) -- endif() --endif() -+if(NOT TBB_FOUND) - --# Additionally try and use pkconfig to find Tbb -- --find_package(PkgConfig) --pkg_check_modules(PC_Tbb QUIET tbb) -- --# ------------------------------------------------------------------------ --# Search for tbb include DIR --# ------------------------------------------------------------------------ -- --set(_TBB_INCLUDE_SEARCH_DIRS "") --list(APPEND _TBB_INCLUDE_SEARCH_DIRS -- ${TBB_INCLUDEDIR} -- ${_TBB_ROOT_SEARCH_DIR} -- ${PC_Tbb_INCLUDE_DIRS} -- ${SYSTEM_LIBRARY_PATHS} --) -- --# Look for a standard tbb header file. --find_path(Tbb_INCLUDE_DIR tbb/tbb_stddef.h -- NO_DEFAULT_PATH -- PATHS ${_TBB_INCLUDE_SEARCH_DIRS} -- PATH_SUFFIXES include --) -- --if(EXISTS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h") -- file(STRINGS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h" -- _tbb_version_major_string REGEX "#define TBB_VERSION_MAJOR " -- ) -- string(REGEX REPLACE "#define TBB_VERSION_MAJOR" "" -- _tbb_version_major_string "${_tbb_version_major_string}" -- ) -- string(STRIP "${_tbb_version_major_string}" Tbb_VERSION_MAJOR) -- -- file(STRINGS "${Tbb_INCLUDE_DIR}/tbb/tbb_stddef.h" -- _tbb_version_minor_string REGEX "#define TBB_VERSION_MINOR " -- ) -- string(REGEX REPLACE "#define TBB_VERSION_MINOR" "" -- _tbb_version_minor_string "${_tbb_version_minor_string}" -- ) -- string(STRIP "${_tbb_version_minor_string}" Tbb_VERSION_MINOR) -- -- unset(_tbb_version_major_string) -- unset(_tbb_version_minor_string) -- -- set(Tbb_VERSION ${Tbb_VERSION_MAJOR}.${Tbb_VERSION_MINOR}) --endif() -+ ################################## -+ # Check the build type -+ ################################## -+ -+ if(NOT DEFINED TBB_USE_DEBUG_BUILD) -+ if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug)") -+ set(TBB_BUILD_TYPE DEBUG) -+ else() -+ set(TBB_BUILD_TYPE RELEASE) -+ endif() -+ elseif(TBB_USE_DEBUG_BUILD) -+ set(TBB_BUILD_TYPE DEBUG) -+ else() -+ set(TBB_BUILD_TYPE RELEASE) -+ endif() - --# ------------------------------------------------------------------------ --# Search for TBB lib DIR --# ------------------------------------------------------------------------ -+ ################################## -+ # Set the TBB search directories -+ ################################## - --set(_TBB_LIBRARYDIR_SEARCH_DIRS "") -+ # Define search paths based on user input and environment variables -+ set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT}) - --# Append to _TBB_LIBRARYDIR_SEARCH_DIRS in priority order -+ # Define the search directories based on the current platform -+ if(CMAKE_SYSTEM_NAME STREQUAL "Windows") -+ set(TBB_DEFAULT_SEARCH_DIR "C:/Program Files/Intel/TBB" -+ "C:/Program Files (x86)/Intel/TBB") - --set(_TBB_LIBRARYDIR_SEARCH_DIRS "") --list(APPEND _TBB_LIBRARYDIR_SEARCH_DIRS -- ${TBB_LIBRARYDIR} -- ${_TBB_ROOT_SEARCH_DIR} -- ${PC_Tbb_LIBRARY_DIRS} -- ${SYSTEM_LIBRARY_PATHS} --) -+ # Set the target architecture -+ if(CMAKE_SIZEOF_VOID_P EQUAL 8) -+ set(TBB_ARCHITECTURE "intel64") -+ else() -+ set(TBB_ARCHITECTURE "ia32") -+ endif() - --set(TBB_PATH_SUFFIXES -- lib64 -- lib --) -+ # Set the TBB search library path search suffix based on the version of VC -+ if(WINDOWS_STORE) -+ set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11_ui") -+ elseif(MSVC14) -+ set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc14") -+ elseif(MSVC12) -+ set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc12") -+ elseif(MSVC11) -+ set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11") -+ elseif(MSVC10) -+ set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc10") -+ endif() - --# platform branching -+ # Add the library path search suffix for the VC independent version of TBB -+ list(APPEND TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc_mt") - --if(UNIX) -- list(INSERT TBB_PATH_SUFFIXES 0 lib/x86_64-linux-gnu) --endif() -+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") -+ # OS X -+ set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") - --if(APPLE) -- if(TBB_FOR_CLANG) -- list(INSERT TBB_PATH_SUFFIXES 0 lib/libc++) -- endif() --elseif(WIN32) -- if(MSVC10) -- set(TBB_VC_DIR vc10) -- elseif(MSVC11) -- set(TBB_VC_DIR vc11) -- elseif(MSVC12) -- set(TBB_VC_DIR vc12) -- endif() -- list(INSERT TBB_PATH_SUFFIXES 0 lib/intel64/${TBB_VC_DIR}) --else() -- if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU) -- if(TBB_MATCH_COMPILER_VERSION) -- string(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${CMAKE_CXX_COMPILER_VERSION}) -- list(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR) -- list(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR) -- list(INSERT TBB_PATH_SUFFIXES 0 lib/intel64/gcc${GCC_MAJOR}.${GCC_MINOR}) -+ # TODO: Check to see which C++ library is being used by the compiler. -+ if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0) -+ # The default C++ library on OS X 10.9 and later is libc++ -+ set(TBB_LIB_PATH_SUFFIX "lib/libc++" "lib") - else() -- list(INSERT TBB_PATH_SUFFIXES 0 lib/intel64/gcc4.4) -+ set(TBB_LIB_PATH_SUFFIX "lib") -+ endif() -+ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") -+ # Linux -+ set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") -+ -+ # TODO: Check compiler version to see the suffix should be /gcc4.1 or -+ # /gcc4.1. For now, assume that the compiler is more recent than -+ # gcc 4.4.x or later. -+ if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") -+ set(TBB_LIB_PATH_SUFFIX "lib/intel64/gcc4.4") -+ elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") -+ set(TBB_LIB_PATH_SUFFIX "lib/ia32/gcc4.4") - endif() - endif() --endif() -- --if(UNIX AND TBB_USE_STATIC_LIBS) -- set(_TBB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") --endif() - --set(Tbb_LIB_COMPONENTS "") -- --foreach(COMPONENT ${TBB_FIND_COMPONENTS}) -- find_library(Tbb_${COMPONENT}_LIBRARY ${COMPONENT} -- NO_DEFAULT_PATH -- PATHS ${_TBB_LIBRARYDIR_SEARCH_DIRS} -- PATH_SUFFIXES ${TBB_PATH_SUFFIXES} -- ) -- -- # On Unix, TBB sometimes uses linker scripts instead of symlinks, so parse the linker script -- # and correct the library name if so -- if(UNIX AND EXISTS ${Tbb_${COMPONENT}_LIBRARY}) -- # Ignore files where the first four bytes equals the ELF magic number -- file(READ ${Tbb_${COMPONENT}_LIBRARY} Tbb_${COMPONENT}_HEX OFFSET 0 LIMIT 4 HEX) -- if(NOT ${Tbb_${COMPONENT}_HEX} STREQUAL "7f454c46") -- # Read the first 1024 bytes of the library and match against an "INPUT (file)" regex -- file(READ ${Tbb_${COMPONENT}_LIBRARY} Tbb_${COMPONENT}_ASCII OFFSET 0 LIMIT 1024) -- if("${Tbb_${COMPONENT}_ASCII}" MATCHES "INPUT \\(([^(]+)\\)") -- # Extract the directory and apply the matched text (in brackets) -- get_filename_component(Tbb_${COMPONENT}_DIR "${Tbb_${COMPONENT}_LIBRARY}" DIRECTORY) -- set(Tbb_${COMPONENT}_LIBRARY "${Tbb_${COMPONENT}_DIR}/${CMAKE_MATCH_1}") -- endif() -- endif() -+ ################################## -+ # Find the TBB include dir -+ ################################## -+ -+ find_path(TBB_INCLUDE_DIRS tbb/tbb.h -+ HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR} -+ PATHS ${TBB_DEFAULT_SEARCH_DIR} -+ PATH_SUFFIXES include) -+ -+ ################################## -+ # Set version strings -+ ################################## -+ -+ if(TBB_INCLUDE_DIRS) -+ file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) -+ string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" -+ TBB_VERSION_MAJOR "${_tbb_version_file}") -+ string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" -+ TBB_VERSION_MINOR "${_tbb_version_file}") -+ string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" -+ TBB_INTERFACE_VERSION "${_tbb_version_file}") -+ set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}") - endif() - -- list(APPEND Tbb_LIB_COMPONENTS ${Tbb_${COMPONENT}_LIBRARY}) -+ ################################## -+ # Find TBB components -+ ################################## - -- if(Tbb_${COMPONENT}_LIBRARY) -- set(TBB_${COMPONENT}_FOUND TRUE) -+ if(TBB_VERSION VERSION_LESS 4.3) -+ set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb) - else() -- set(TBB_${COMPONENT}_FOUND FALSE) -+ set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb) - endif() --endforeach() - --if(UNIX AND TBB_USE_STATIC_LIBS) -- set(CMAKE_FIND_LIBRARY_SUFFIXES ${_TBB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) -- unset(_TBB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) --endif() -+ if(TBB_STATIC) -+ set(TBB_STATIC_SUFFIX "_static") -+ endif() - --# ------------------------------------------------------------------------ --# Cache and set TBB_FOUND --# ------------------------------------------------------------------------ -+ # Find each component -+ foreach(_comp ${TBB_SEARCH_COMPOMPONENTS}) -+ if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};") -+ -+ unset(TBB_${_comp}_LIBRARY_DEBUG CACHE) -+ unset(TBB_${_comp}_LIBRARY_RELEASE CACHE) -+ -+ # Search for the libraries -+ find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}${TBB_STATIC_SUFFIX} -+ HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} -+ PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH -+ PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) -+ -+ find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}${TBB_STATIC_SUFFIX}_debug -+ HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} -+ PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH -+ PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) -+ -+ if(TBB_${_comp}_LIBRARY_DEBUG) -+ list(APPEND TBB_LIBRARIES_DEBUG "${TBB_${_comp}_LIBRARY_DEBUG}") -+ endif() -+ if(TBB_${_comp}_LIBRARY_RELEASE) -+ list(APPEND TBB_LIBRARIES_RELEASE "${TBB_${_comp}_LIBRARY_RELEASE}") -+ endif() -+ if(TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE} AND NOT TBB_${_comp}_LIBRARY) -+ set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE}}") -+ endif() -+ -+ if(TBB_${_comp}_LIBRARY AND EXISTS "${TBB_${_comp}_LIBRARY}") -+ set(TBB_${_comp}_FOUND TRUE) -+ else() -+ set(TBB_${_comp}_FOUND FALSE) -+ endif() -+ -+ # Mark internal variables as advanced -+ mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE) -+ mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG) -+ mark_as_advanced(TBB_${_comp}_LIBRARY) - --include(FindPackageHandleStandardArgs) --find_package_handle_standard_args(TBB -- FOUND_VAR TBB_FOUND -- REQUIRED_VARS -- Tbb_INCLUDE_DIR -- Tbb_LIB_COMPONENTS -- VERSION_VAR Tbb_VERSION -- HANDLE_COMPONENTS --) -- --if(TBB_FOUND) -- set(Tbb_LIBRARIES -- ${Tbb_LIB_COMPONENTS} -- ) -- set(Tbb_INCLUDE_DIRS ${Tbb_INCLUDE_DIR}) -- set(Tbb_DEFINITIONS ${PC_Tbb_CFLAGS_OTHER}) -- -- set(Tbb_LIBRARY_DIRS "") -- foreach(LIB ${Tbb_LIB_COMPONENTS}) -- get_filename_component(_TBB_LIBDIR ${LIB} DIRECTORY) -- list(APPEND Tbb_LIBRARY_DIRS ${_TBB_LIBDIR}) -- endforeach() -- list(REMOVE_DUPLICATES Tbb_LIBRARY_DIRS) -- -- # Configure imported targets -- -- foreach(COMPONENT ${TBB_FIND_COMPONENTS}) -- if(NOT TARGET TBB::${COMPONENT}) -- add_library(TBB::${COMPONENT} UNKNOWN IMPORTED) -- set_target_properties(TBB::${COMPONENT} PROPERTIES -- IMPORTED_LOCATION "${Tbb_${COMPONENT}_LIBRARY}" -- INTERFACE_COMPILE_OPTIONS "${Tbb_DEFINITIONS}" -- INTERFACE_INCLUDE_DIRECTORIES "${Tbb_INCLUDE_DIR}" -- ) - endif() - endforeach() --elseif(TBB_FIND_REQUIRED) -- message(FATAL_ERROR "Unable to find TBB") -+ -+ ################################## -+ # Set compile flags and libraries -+ ################################## -+ -+ set(TBB_DEFINITIONS_RELEASE "") -+ set(TBB_DEFINITIONS_DEBUG "TBB_USE_DEBUG=1") -+ -+ if(TBB_LIBRARIES_${TBB_BUILD_TYPE}) -+ set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}") -+ endif() -+ -+ if(NOT MSVC AND NOT TBB_LIBRARIES) -+ set(TBB_LIBRARIES ${TBB_LIBRARIES_RELEASE}) -+ endif() -+ -+ set(TBB_DEFINITIONS "") -+ if (MSVC AND TBB_STATIC) -+ set(TBB_DEFINITIONS __TBB_NO_IMPLICIT_LINKAGE) -+ endif () -+ -+ unset (TBB_STATIC_SUFFIX) -+ -+ find_package_handle_standard_args(TBB -+ REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES -+ FAIL_MESSAGE "TBB library cannot be found. Consider set TBBROOT environment variable." -+ HANDLE_COMPONENTS -+ VERSION_VAR TBB_VERSION) -+ -+ ################################## -+ # Create targets -+ ################################## -+ -+ if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND) -+ add_library(TBB::tbb UNKNOWN IMPORTED) -+ set_target_properties(TBB::tbb PROPERTIES -+ INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS}" -+ INTERFACE_LINK_LIBRARIES "Threads::Threads;${CMAKE_DL_LIBS}" -+ INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS} -+ IMPORTED_LOCATION ${TBB_LIBRARIES}) -+ if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG) -+ set_target_properties(TBB::tbb PROPERTIES -+ INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS};$<$,$>:${TBB_DEFINITIONS_DEBUG}>;$<$:${TBB_DEFINITIONS_RELEASE}>" -+ IMPORTED_LOCATION_DEBUG ${TBB_LIBRARIES_DEBUG} -+ IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_RELEASE} -+ IMPORTED_LOCATION_RELEASE ${TBB_LIBRARIES_RELEASE} -+ IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE} -+ ) -+ endif() -+ endif() -+ -+ mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES) -+ -+ unset(TBB_ARCHITECTURE) -+ unset(TBB_BUILD_TYPE) -+ unset(TBB_LIB_PATH_SUFFIX) -+ 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}") -+ message(STATUS " TBB_DEFINITIONS_DEBUG = ${TBB_DEFINITIONS_DEBUG}") -+ message(STATUS " TBB_LIBRARIES_DEBUG = ${TBB_LIBRARIES_DEBUG}") -+ message(STATUS " TBB_DEFINITIONS_RELEASE = ${TBB_DEFINITIONS_RELEASE}") -+ message(STATUS " TBB_LIBRARIES_RELEASE = ${TBB_LIBRARIES_RELEASE}") -+ endif() -+ - endif() -diff --git a/openvdb/CMakeLists.txt b/openvdb/CMakeLists.txt -index 89301bd..6a3c90c 100644 ---- a/openvdb/CMakeLists.txt -+++ b/openvdb/CMakeLists.txt -@@ -78,7 +78,7 @@ else() - endif() - - find_package(TBB ${MINIMUM_TBB_VERSION} REQUIRED COMPONENTS tbb) --if(${Tbb_VERSION} VERSION_LESS FUTURE_MINIMUM_TBB_VERSION) -+if(${TBB_VERSION} VERSION_LESS FUTURE_MINIMUM_TBB_VERSION) - message(DEPRECATION "Support for TBB versions < ${FUTURE_MINIMUM_TBB_VERSION} " - "is deprecated and will be removed.") - endif() -@@ -129,10 +129,13 @@ endif() - # include paths from shared installs (including houdini) may pull in the wrong - # headers - -+include (CheckAtomic) -+ - set(OPENVDB_CORE_DEPENDENT_LIBS - Boost::iostreams - Boost::system - IlmBase::Half -+ ${CMAKE_REQUIRED_LIBRARIES} - ) - - if(USE_EXR) -@@ -185,11 +188,6 @@ if(WIN32) - endif() - endif() - --# @todo Should be target definitions --if(WIN32) -- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL) --endif() -- - ##### Core library configuration - - set(OPENVDB_LIBRARY_SOURCE_FILES -@@ -374,10 +372,16 @@ set(OPENVDB_LIBRARY_UTIL_INCLUDE_FILES - - if(OPENVDB_CORE_SHARED) - add_library(openvdb_shared SHARED ${OPENVDB_LIBRARY_SOURCE_FILES}) -+ if(WIN32) -+ target_compile_definitions(openvdb_shared PUBLIC OPENVDB_DLL) -+ endif() - endif() - - if(OPENVDB_CORE_STATIC) - add_library(openvdb_static STATIC ${OPENVDB_LIBRARY_SOURCE_FILES}) -+ if(WIN32) -+ target_compile_definitions(openvdb_static PUBLIC OPENVDB_STATICLIB) -+ endif() - endif() - - # Alias either the shared or static library to the generic OpenVDB -diff --git a/openvdb/Grid.cc b/openvdb/Grid.cc -index 0015f81..cb6084a 100644 ---- a/openvdb/Grid.cc -+++ b/openvdb/Grid.cc -@@ -35,6 +35,9 @@ - #include - #include - -+// WTF??? Somehow from stdlib.h -+#undef min -+#undef max - - namespace openvdb { - OPENVDB_USE_VERSION_NAMESPACE -diff --git a/openvdb/PlatformConfig.h b/openvdb/PlatformConfig.h -index 20ad9a3..c2dd1ef 100644 ---- a/openvdb/PlatformConfig.h -+++ b/openvdb/PlatformConfig.h -@@ -44,9 +44,12 @@ - - // By default, assume that we're dynamically linking OpenEXR, unless - // OPENVDB_OPENEXR_STATICLIB is defined. -- #if !defined(OPENVDB_OPENEXR_STATICLIB) && !defined(OPENEXR_DLL) -- #define OPENEXR_DLL -- #endif -+ // Meszaros Tamas: Why? OpenEXR and its imported targets have OPENEXR_DLL -+ // in INTERFACE_COMPILE_DEFINITIONS if build with it. -+ // #if !defined(OPENVDB_OPENEXR_STATICLIB) && !defined(OPENEXR_DLL) -+ // #define OPENEXR_DLL -+ // static_assert(false, "This is bad: OPENEXR_DLL"); -+ // #endif - - #endif // _WIN32 - -diff --git a/openvdb/cmd/CMakeLists.txt b/openvdb/cmd/CMakeLists.txt -index 57fbec0..55b3850 100644 ---- a/openvdb/cmd/CMakeLists.txt -+++ b/openvdb/cmd/CMakeLists.txt -@@ -74,8 +74,9 @@ if(WIN32) - endif() - endif() - -+# @todo Should be target definitions - if(WIN32) -- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL) -+ add_definitions(-D_WIN32 -DNOMINMAX) - endif() - - # rpath handling -@@ -88,7 +89,6 @@ if(OPENVDB_ENABLE_RPATH) - ${IlmBase_LIBRARY_DIRS} - ${Log4cplus_LIBRARY_DIRS} - ${Blosc_LIBRARY_DIRS} -- ${Tbb_LIBRARY_DIRS} - ) - if(OPENVDB_BUILD_CORE) - list(APPEND RPATHS ${CMAKE_INSTALL_PREFIX}/lib) -diff --git a/openvdb/unittest/CMakeLists.txt b/openvdb/unittest/CMakeLists.txt -index c9e0c34..7e261c0 100644 ---- a/openvdb/unittest/CMakeLists.txt -+++ b/openvdb/unittest/CMakeLists.txt -@@ -71,8 +71,9 @@ if(WIN32) - link_directories(${Boost_LIBRARY_DIR}) - endif() - -+# @todo Should be target definitions - if(WIN32) -- add_definitions(-D_WIN32 -DNOMINMAX -DOPENVDB_DLL) -+ add_definitions(-D_WIN32 -DNOMINMAX) - endif() - - ##### VDB unit tests -diff --git a/openvdb/unittest/TestFile.cc b/openvdb/unittest/TestFile.cc -index df51830..0ab0c12 100644 ---- a/openvdb/unittest/TestFile.cc -+++ b/openvdb/unittest/TestFile.cc -@@ -2573,7 +2573,7 @@ TestFile::testBlosc() - outdata(new char[decompbufbytes]); - - for (int compcode = 0; compcode <= BLOSC_ZLIB; ++compcode) { -- char* compname = nullptr; -+ const char* compname = nullptr; - if (0 > blosc_compcode_to_compname(compcode, &compname)) continue; - /// @todo This changes the compressor setting globally. - if (blosc_set_compressor(compname) < 0) continue; --- -2.17.1 - diff --git a/deps/qhull-mods.patch b/deps/qhull-mods.patch deleted file mode 100644 index 70f7be6a7..000000000 --- a/deps/qhull-mods.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 7f55a56b3d112f4dffbf21b1722f400c64bf03b1 Mon Sep 17 00:00:00 2001 -From: tamasmeszaros -Date: Mon, 21 Oct 2019 16:52:04 +0200 -Subject: [PATCH] Fix the build on macOS - ---- - CMakeLists.txt | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 07d3da2..14df8e9 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -626,18 +626,18 @@ install(TARGETS ${qhull_TARGETS_INSTALL} EXPORT QhullTargets - include(CMakePackageConfigHelpers) - - write_basic_package_version_file( -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake" - VERSION ${qhull_VERSION} - COMPATIBILITY AnyNewerVersion - ) - - export(EXPORT QhullTargets -- FILE "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullTargets.cmake" -+ FILE "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullTargets.cmake" - NAMESPACE Qhull:: - ) - - configure_file(${PROJECT_SOURCE_DIR}/build/config.cmake.in -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake" - @ONLY - ) - -@@ -652,8 +652,8 @@ install(EXPORT QhullTargets - ) - install( - FILES -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfig.cmake" -- "${CMAKE_CURRENT_BINARY_DIR}/Qhull/QhullConfigVersion.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfig.cmake" -+ "${CMAKE_CURRENT_BINARY_DIR}/QhullExport/QhullConfigVersion.cmake" - DESTINATION - ${ConfigPackageLocation} - COMPONENT --- -2.17.1 - diff --git a/deps/wxWidgets/wxWidgets.cmake b/deps/wxWidgets/wxWidgets.cmake index 0c8eaca97..a7f5b12e7 100644 --- a/deps/wxWidgets/wxWidgets.cmake +++ b/deps/wxWidgets/wxWidgets.cmake @@ -1,6 +1,5 @@ set(_wx_git_tag v3.1.4-patched) -# set(_patch_command "") set(_wx_toolkit "") if(CMAKE_SYSTEM_NAME STREQUAL "Linux") set(_gtk_ver 2) @@ -11,10 +10,11 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux") endif() prusaslicer_add_cmake_project(wxWidgets - GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets" - GIT_TAG ${_wx_git_tag} - # PATCH_COMMAND "${_patch_command}" - DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} + # GIT_REPOSITORY "https://github.com/prusa3d/wxWidgets" + # GIT_TAG tm_cross_compile #${_wx_git_tag} + URL https://github.com/prusa3d/wxWidgets/archive/refs/heads/v3.1.4-patched.zip + URL_HASH SHA256=a1e145a083d173cf320c0bd8522c7ee5829052b49b68fe5268ac84f0c576b940 + DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG CMAKE_ARGS -DwxBUILD_PRECOMP=ON ${_wx_toolkit} @@ -28,9 +28,11 @@ prusaslicer_add_cmake_project(wxWidgets -DwxUSE_ZLIB=sys -DwxUSE_REGEX=builtin -DwxUSE_LIBXPM=builtin - -DwxUSE_LIBJPEG=builtin - -DwxUSE_LIBTIFF=builtin + -DwxUSE_LIBJPEG=sys + -DwxUSE_LIBTIFF=sys -DwxUSE_EXPAT=sys + -DwxUSE_LIBSDL=OFF + -DwxUSE_XTEST=OFF ) if (MSVC) diff --git a/deps/wxwidgets-pngprefix.h b/deps/wxwidgets-pngprefix.h deleted file mode 100644 index 67c70af80..000000000 --- a/deps/wxwidgets-pngprefix.h +++ /dev/null @@ -1,168 +0,0 @@ -// Patched in PrusaSlicer: 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 - - - - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f375e9c98..bbade8a97 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,26 +57,23 @@ if (SLIC3R_GUI) include(${wxWidgets_USE_FILE}) + find_package(JPEG QUIET) + find_package(TIFF QUIET) + string(REGEX MATCH "wxpng" WX_PNG_BUILTIN ${wxWidgets_LIBRARIES}) - if (NOT WX_PNG_BUILTIN) - find_package(JPEG QUIET) - if (PNG_FOUND) - list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX png) - list(APPEND wxWidgets_LIBRARIES ${PNG_LIBRARIES}) - endif () + if (PNG_FOUND AND NOT WX_PNG_BUILTIN) + list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX png) + list(APPEND wxWidgets_LIBRARIES ${PNG_LIBRARIES}) endif () string(REGEX MATCH "wxtiff" WX_TIFF_BUILTIN ${wxWidgets_LIBRARIES}) - if (NOT WX_TIFF_BUILTIN) - find_package(TIFF QUIET) - if (TIFF_FOUND) - list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX tiff) - list(APPEND wxWidgets_LIBRARIES ${TIFF_LIBRARIES}) - endif () + if (TIFF_FOUND AND NOT WX_TIFF_BUILTIN) + list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX tiff) + list(APPEND wxWidgets_LIBRARIES ${TIFF_LIBRARIES}) endif () string(REGEX MATCH "wxjpeg" WX_JPEG_BUILTIN ${wxWidgets_LIBRARIES}) - if (TIFF_FOUND AND NOT WX_JPEG_BUILTIN) + if (JPEG_FOUND AND NOT WX_JPEG_BUILTIN) list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX jpeg) list(APPEND wxWidgets_LIBRARIES ${JPEG_LIBRARIES}) endif () @@ -86,6 +83,7 @@ if (SLIC3R_GUI) list(FILTER wxWidgets_LIBRARIES EXCLUDE REGEX expat) list(APPEND wxWidgets_LIBRARIES ${EXPAT_LIBRARIES}) endif () + # This is an issue in the new wxWidgets cmake build, doesn't deal with librt find_library(LIBRT rt) if(LIBRT) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 9f97bebc0..dc720db48 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -542,7 +542,7 @@ void AppConfig::update_config_dir(const std::string &dir) void AppConfig::update_skein_dir(const std::string &dir) { - if (dir == sys_shapes_dir() || dir == custom_shapes_dir()) + if (is_shapes_dir(dir)) return; // do not save "shapes gallery" directory this->set("recent", "skein_directory", dir); } @@ -576,7 +576,7 @@ std::string AppConfig::get_last_output_dir(const std::string& alt, const bool re if (it2 != it->second.end() && it3 != it->second.end() && !it2->second.empty() && it3->second == "1") return it2->second; } - return alt; + return is_shapes_dir(alt) ? get_last_dir() : alt; } void AppConfig::update_last_output_dir(const std::string& dir, const bool removable) diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index bfe8427d0..83590d601 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -1,5 +1,5 @@ -project(libslic3r) cmake_minimum_required(VERSION 3.13) +project(libslic3r) include(PrecompiledHeader) diff --git a/src/libslic3r/SLA/Hollowing.cpp b/src/libslic3r/SLA/Hollowing.cpp index 770e52a35..55dae9430 100644 --- a/src/libslic3r/SLA/Hollowing.cpp +++ b/src/libslic3r/SLA/Hollowing.cpp @@ -112,7 +112,7 @@ InteriorPtr generate_interior(const TriangleMesh & mesh, const HollowingConfig &hc, const JobController & ctl) { - static const double MIN_OVERSAMPL = 3.; + static const double MIN_OVERSAMPL = 3.5; static const double MAX_OVERSAMPL = 8.; // I can't figure out how to increase the grid resolution through openvdb diff --git a/src/libslic3r/SLAPrint.hpp b/src/libslic3r/SLAPrint.hpp index e11926c7e..0cd80f20b 100644 --- a/src/libslic3r/SLAPrint.hpp +++ b/src/libslic3r/SLAPrint.hpp @@ -323,6 +323,7 @@ private: { support_tree_ptr = sla::SupportTree::create(*this, ctl); tree_mesh = TriangleMesh{support_tree_ptr->retrieve_mesh(sla::MeshType::Support)}; + tree_mesh.require_shared_vertices(); return support_tree_ptr; } diff --git a/src/libslic3r/TryCatchSignal.hpp b/src/libslic3r/TryCatchSignal.hpp index 69c50d8cd..19a53fd4a 100644 --- a/src/libslic3r/TryCatchSignal.hpp +++ b/src/libslic3r/TryCatchSignal.hpp @@ -10,9 +10,9 @@ using SignalT = decltype (SIGSEGV); template -void try_catch_signal(const SignalT (&/*sigs*/)[N], TryFn &&/*fn*/, CatchFn &&/*cfn*/) +void try_catch_signal(const SignalT (&/*sigs*/)[N], TryFn &&fn, CatchFn &&/*cfn*/) { - // TODO + fn(); } #endif diff --git a/src/libslic3r/Utils.hpp b/src/libslic3r/Utils.hpp index 211755bbb..81897553c 100644 --- a/src/libslic3r/Utils.hpp +++ b/src/libslic3r/Utils.hpp @@ -102,6 +102,7 @@ extern bool is_gcode_file(const std::string &path); extern bool is_img_file(const std::string& path); extern bool is_stl_file(const boost::filesystem::directory_entry& path); extern bool is_stl_file(const std::string& path); +extern bool is_shapes_dir(const std::string& dir); // File path / name / extension splitting utilities, working with UTF-8, // to be published to Perl. diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index 3e38a3e67..085db8705 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -776,6 +776,11 @@ bool is_stl_file(const std::string &path) return boost::iends_with(path, ".stl"); } +bool is_shapes_dir(const std::string& dir) +{ + return dir == sys_shapes_dir() || dir == custom_shapes_dir(); +} + } // namespace Slic3r #ifdef WIN32 diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 127a6417e..8bf8cd3d7 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -1606,25 +1606,17 @@ ConfigWizardIndex::ConfigWizardIndex(wxWindow *parent) , item_hover(NO_ITEM) , last_page((size_t)-1) { +#ifndef __WXOSX__ + SetDoubleBuffered(true);// SetDoubleBuffered exists on Win and Linux/GTK, but is missing on OSX +#endif //__WXOSX__ SetMinSize(bg.bmp().GetSize()); const wxSize size = GetTextExtent("m"); em_w = size.x; em_h = size.y; - // Add logo bitmap. - // This could be done in on_paint() along with the index labels, but I've found it tricky - // to get the bitmap rendered well on all platforms with transparent background. - // In some cases it didn't work at all. And so wxStaticBitmap is used here instead, - // because it has all the platform quirks figured out. - auto *sizer = new wxBoxSizer(wxVERTICAL); - logo = new wxStaticBitmap(this, wxID_ANY, bg.bmp()); - sizer->AddStretchSpacer(); - sizer->Add(logo); - SetSizer(sizer); - logo_height = logo->GetBitmap().GetHeight(); - Bind(wxEVT_PAINT, &ConfigWizardIndex::on_paint, this); + Bind(wxEVT_SIZE, [this](wxEvent& e) { e.Skip(); Refresh(); }); Bind(wxEVT_MOTION, &ConfigWizardIndex::on_mouse_move, this); Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent &evt) { @@ -1769,6 +1761,12 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt) y += yinc; index_width = std::max(index_width, (int)x + text_size.x); } + + //draw logo + if (int y = size.y - bg.GetBmpHeight(); y>=0) { + dc.DrawBitmap(bg.bmp(), 0, y, false); + index_width = std::max(index_width, bg.GetBmpWidth() + em_w / 2); + } if (GetMinSize().x < index_width) { CallAfter([this, index_width]() { @@ -1776,11 +1774,6 @@ void ConfigWizardIndex::on_paint(wxPaintEvent & evt) Refresh(); }); } - - if ((int)y + logo_height > size.GetHeight()) - logo->Hide(); - else - logo->Show(); } void ConfigWizardIndex::on_mouse_move(wxMouseEvent &evt) @@ -1806,7 +1799,6 @@ void ConfigWizardIndex::msw_rescale() bg.msw_rescale(); SetMinSize(bg.bmp().GetSize()); - logo->SetBitmap(bg.bmp()); bullet_black.msw_rescale(); bullet_blue.msw_rescale(); diff --git a/src/slic3r/GUI/ConfigWizard_private.hpp b/src/slic3r/GUI/ConfigWizard_private.hpp index ea39e04ab..6ca061941 100644 --- a/src/slic3r/GUI/ConfigWizard_private.hpp +++ b/src/slic3r/GUI/ConfigWizard_private.hpp @@ -512,15 +512,12 @@ private: ScalableBitmap bullet_black; ScalableBitmap bullet_blue; ScalableBitmap bullet_white; - wxStaticBitmap* logo; std::vector items; size_t item_active; ssize_t item_hover; size_t last_page; - int logo_height; - int item_height() const { return std::max(bullet_black.bmp().GetSize().GetHeight(), em_w) + em_w; } void on_paint(wxPaintEvent &evt); diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 73600e6de..0fd1930d5 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -3341,14 +3341,31 @@ void GCodeViewer::render_legend(float& legend_height) const if (show_estimated_time) { ImGui::Spacing(); std::string time_title = _u8L("Estimated printing times"); - switch (m_time_estimate_mode) - { - case PrintEstimatedStatistics::ETimeMode::Normal: { time_title += " [" + _u8L("Normal mode") + "]:"; break; } - case PrintEstimatedStatistics::ETimeMode::Stealth: { time_title += " [" + _u8L("Stealth mode") + "]:"; break; } - default: { assert(false); break; } + auto can_show_mode_button = [this](PrintEstimatedStatistics::ETimeMode mode) { + bool show = false; + if (m_print_statistics.modes.size() > 1 && m_print_statistics.modes[static_cast(mode)].roles_times.size() > 0) { + for (size_t i = 0; i < m_print_statistics.modes.size(); ++i) { + if (i != static_cast(mode) && + m_print_statistics.modes[i].time > 0.0f && + short_time(get_time_dhms(m_print_statistics.modes[static_cast(mode)].time)) != short_time(get_time_dhms(m_print_statistics.modes[i].time))) { + show = true; + break; + } + } + } + return show; + }; + + if (can_show_mode_button(m_time_estimate_mode)) { + switch (m_time_estimate_mode) + { + case PrintEstimatedStatistics::ETimeMode::Normal: { time_title += " [" + _u8L("Normal mode") + "]"; break; } + case PrintEstimatedStatistics::ETimeMode::Stealth: { time_title += " [" + _u8L("Stealth mode") + "]"; break; } + default: { assert(false); break; } + } } - imgui.title(time_title); + imgui.title(time_title + ":"); std::string first_str = _u8L("First layer"); std::string total_str = _u8L("Total"); @@ -3369,16 +3386,8 @@ void GCodeViewer::render_legend(float& legend_height) const ImGui::SameLine(max_len); imgui.text(short_time(get_time_dhms(time_mode.time))); - auto show_mode_button = [this, &imgui](const wxString& label, PrintEstimatedStatistics::ETimeMode mode) { - bool show = false; - for (size_t i = 0; i < m_print_statistics.modes.size(); ++i) { - if (i != static_cast(mode) && - short_time(get_time_dhms(m_print_statistics.modes[static_cast(mode)].time)) != short_time(get_time_dhms(m_print_statistics.modes[i].time))) { - show = true; - break; - } - } - if (show && m_print_statistics.modes[static_cast(mode)].roles_times.size() > 0) { + auto show_mode_button = [this, &imgui, can_show_mode_button](const wxString& label, PrintEstimatedStatistics::ETimeMode mode) { + if (can_show_mode_button(mode)) { if (imgui.button(label)) { *const_cast(&m_time_estimate_mode) = mode; wxGetApp().plater()->get_current_canvas3D()->set_as_dirty(); diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index 7ae6f5cb6..41307bad9 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -671,6 +671,7 @@ public: #if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER std::vector& get_custom_gcode_per_print_z() { return m_custom_gcode_per_print_z; } + size_t get_extruders_count() { return m_extruders_count; } #endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER private: diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index 609c903fa..b46778c39 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -636,6 +636,7 @@ public: void set_toolpaths_z_range(const std::array& range); #if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER std::vector& get_custom_gcode_per_print_z() { return m_gcode_viewer.get_custom_gcode_per_print_z(); } + size_t get_gcode_extruders_count() { return m_gcode_viewer.get_extruders_count(); } #endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER std::vector load_object(const ModelObject& model_object, int obj_idx, std::vector instance_idxs); diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 1b71e0d8c..a73ca880a 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1780,7 +1780,7 @@ void GUI_App::update_mode() for (auto tab : tabs_list) tab->update_mode(); - plater()->update_object_menu(); + plater()->update_menus(); plater()->canvas3D()->update_gizmos_on_off_state(); } diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index 6a945c061..86f3eae0a 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -953,6 +953,12 @@ void MenuFactory::init(wxWindow* parent) create_instance_menu(); } +void MenuFactory::update() +{ + update_default_menu(); + update_object_menu(); +} + wxMenu* MenuFactory::default_menu() { return &m_default_menu; @@ -1077,6 +1083,14 @@ void MenuFactory::update_object_menu() append_menu_items_add_volume(&m_object_menu); } +void MenuFactory::update_default_menu() +{ + const auto menu_item_id = m_default_menu.FindItem(_("Add Shape")); + if (menu_item_id != wxNOT_FOUND) + m_default_menu.Destroy(menu_item_id); + create_default_menu(); +} + void MenuFactory::msw_rescale() { for (MenuWithSeparators* menu : { &m_object_menu, &m_sla_object_menu, &m_part_menu, &m_default_menu }) diff --git a/src/slic3r/GUI/GUI_Factories.hpp b/src/slic3r/GUI/GUI_Factories.hpp index e8928d3ff..f47837d73 100644 --- a/src/slic3r/GUI/GUI_Factories.hpp +++ b/src/slic3r/GUI/GUI_Factories.hpp @@ -40,7 +40,9 @@ public: ~MenuFactory() = default; void init(wxWindow* parent); + void update(); void update_object_menu(); + void update_default_menu(); void msw_rescale(); void sys_color_changed(); diff --git a/src/slic3r/GUI/GUI_Preview.cpp b/src/slic3r/GUI/GUI_Preview.cpp index eeac517fd..3f4537af6 100644 --- a/src/slic3r/GUI/GUI_Preview.cpp +++ b/src/slic3r/GUI/GUI_Preview.cpp @@ -910,6 +910,7 @@ void Preview::load_print_as_fff(bool keep_z_range) GCodeViewer::EViewType gcode_view_type = m_canvas->get_gcode_view_preview_type(); bool gcode_preview_data_valid = !m_gcode_result->moves.empty(); + // Collect colors per extruder. std::vector colors; std::vector color_print_values = {}; @@ -934,9 +935,9 @@ void Preview::load_print_as_fff(bool keep_z_range) color_print_values.clear(); } - if (IsShown()) { - std::vector zs; + std::vector zs; + if (IsShown()) { m_canvas->set_selected_extruder(0); if (gcode_preview_data_valid) { // Load the real G-code preview. @@ -947,7 +948,12 @@ void Preview::load_print_as_fff(bool keep_z_range) Refresh(); zs = m_canvas->get_gcode_layers_zs(); m_loaded = true; - } else { + } +#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER + else if (wxGetApp().is_editor()) { +#else + else { +#endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER // Load the initial preview based on slices, not the final G-code. m_canvas->load_preview(colors, color_print_values); m_left_sizer->Hide(m_bottom_toolbar_panel); @@ -955,6 +961,33 @@ void Preview::load_print_as_fff(bool keep_z_range) Refresh(); zs = m_canvas->get_volumes_print_zs(true); } + +#if ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER + if (!zs.empty() && !m_keep_current_preview_type) { + unsigned int number_extruders = wxGetApp().is_editor() ? + (unsigned int)print->extruders().size() : + m_canvas->get_gcode_extruders_count(); + std::vector gcodes = wxGetApp().is_editor() ? + wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes : + m_canvas->get_custom_gcode_per_print_z(); + const wxString choice = !gcodes.empty() ? + _L("Color Print") : + (number_extruders > 1) ? _L("Tool") : _L("Feature type"); + + int type = m_choice_view_type->FindString(choice); + if (m_choice_view_type->GetSelection() != type) { + if (0 <= type && type < static_cast(GCodeViewer::EViewType::Count)) { + m_choice_view_type->SetSelection(type); + m_canvas->set_gcode_view_preview_type(static_cast(type)); + if (wxGetApp().is_gcode_viewer()) { + m_keep_current_preview_type = true; + refresh_print(); + } + } + } + } +#endif // ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER + if (zs.empty()) { // all layers filtered out hide_layers_slider(); @@ -963,9 +996,9 @@ void Preview::load_print_as_fff(bool keep_z_range) update_layers_slider(zs, keep_z_range); } - unsigned int number_extruders = (unsigned int)print->extruders().size(); - +#if !ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER if (!m_keep_current_preview_type) { + unsigned int number_extruders = (unsigned int)print->extruders().size(); const wxString choice = !wxGetApp().plater()->model().custom_gcode_per_print_z.gcodes.empty() ? _L("Color Print") : (number_extruders > 1) ? _L("Tool") : _L("Feature type"); @@ -978,6 +1011,7 @@ void Preview::load_print_as_fff(bool keep_z_range) } } } +#endif // !ENABLE_FIX_IMPORTING_COLOR_PRINT_VIEW_INTO_GCODEVIEWER } void Preview::load_print_as_sla() diff --git a/src/slic3r/GUI/ImGuiWrapper.cpp b/src/slic3r/GUI/ImGuiWrapper.cpp index c33ac3c0e..dbf89f025 100644 --- a/src/slic3r/GUI/ImGuiWrapper.cpp +++ b/src/slic3r/GUI/ImGuiWrapper.cpp @@ -1120,6 +1120,11 @@ void ImGuiWrapper::init_style() set_color(ImGuiCol_TabActive, COL_ORANGE_LIGHT); set_color(ImGuiCol_TabUnfocused, COL_GREY_DARK); set_color(ImGuiCol_TabUnfocusedActive, COL_GREY_LIGHT); + + // Scrollbars + set_color(ImGuiCol_ScrollbarGrab, COL_ORANGE_DARK); + set_color(ImGuiCol_ScrollbarGrabHovered, COL_ORANGE_LIGHT); + set_color(ImGuiCol_ScrollbarGrabActive, COL_ORANGE_LIGHT); } void ImGuiWrapper::render_draw_data(ImDrawData *draw_data) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index ca4815641..649ad88cf 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2653,8 +2653,10 @@ wxString Plater::priv::get_export_file(GUI::FileType file_type) default: break; } + std::string out_dir = (boost::filesystem::path(output_file).parent_path()).string(); + wxFileDialog dlg(q, dlg_title, - from_path(output_file.parent_path()), from_path(output_file.filename()), + is_shapes_dir(out_dir) ? from_u8(wxGetApp().app_config->get_last_dir()) : from_path(output_file.parent_path()), from_path(output_file.filename()), wildcard, wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK) @@ -3533,7 +3535,6 @@ void Plater::priv::fix_through_netfabb(const int obj_idx, const int vol_idx/* = } fix_model_by_win10_sdk_gui(*mo, vol_idx); - q->SetFocus(); sla::reproject_points_and_holes(mo); this->update(); this->object_list_changed(); @@ -6267,7 +6268,7 @@ void Plater::mirror(Axis axis) { p->mirror(axis); } void Plater::split_object() { p->split_object(); } void Plater::split_volume() { p->split_volume(); } void Plater::optimize_rotation() { p->m_ui_jobs.optimize_rotation();} -void Plater::update_object_menu() { p->menus.update_object_menu(); } +void Plater::update_menus() { p->menus.update(); } void Plater::show_action_buttons(const bool ready_to_slice) const { p->show_action_buttons(ready_to_slice); } void Plater::copy_selection_to_clipboard() diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index 351d9ed21..0b499725e 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -269,7 +269,7 @@ public: std::vector get_extruder_colors_from_plater_config(const GCodeProcessor::Result* const result = nullptr) const; std::vector get_colors_for_color_print(const GCodeProcessor::Result* const result = nullptr) const; - void update_object_menu(); + void update_menus(); void show_action_buttons(const bool is_ready_to_slice) const; wxString get_project_filename(const wxString& extension = wxEmptyString) const; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index f712615c5..a91b17dd3 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1173,6 +1173,10 @@ void Tab::activate_option(const std::string& opt_key, const wxString& category) if (!cur_item) return; + // We should to activate a tab with searched option, if it doesn't. + // And do it before finding of the cur_item to avoid a case when Tab isn't activated jet and all treeItems are invisible + wxGetApp().mainframe->select_tab(this); + while (cur_item) { auto title = m_treectrl->GetItemText(cur_item); if (page_title != title) { @@ -1184,8 +1188,6 @@ void Tab::activate_option(const std::string& opt_key, const wxString& category) break; } - // we should to activate a tab with searched option, if it doesn't. - wxGetApp().mainframe->select_tab(this); Field* field = get_field(opt_key); // focused selected field diff --git a/src/slic3r/Utils/FixModelByWin10.cpp b/src/slic3r/Utils/FixModelByWin10.cpp index 7a22c5138..cfe8b68b3 100644 --- a/src/slic3r/Utils/FixModelByWin10.cpp +++ b/src/slic3r/Utils/FixModelByWin10.cpp @@ -36,6 +36,8 @@ #include "../GUI/GUI.hpp" #include "../GUI/I18N.hpp" #include "../GUI/MsgDialog.hpp" +#include "../GUI/GUI_App.hpp" +#include "../GUI/Mainframe.hpp" #include #include @@ -341,7 +343,7 @@ void fix_model_by_win10_sdk_gui(ModelObject &model_object, int volume_idx) wxProgressDialog progress_dialog( _L("Model fixing"), _L("Exporting model") + "...", - 100, nullptr, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT); + 100, GUI::wxGetApp().mainframe, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT); // Executing the calculation in a background thread, so that the COM context could be created with its own threading model. // (It seems like wxWidgets initialize the COM contex as single threaded and we need a multi-threaded context). bool success = false;