From nobody Fri Nov 18 16:17:24 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NDMPc4bFjz4hnbM; Fri, 18 Nov 2022 16:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NDMPc48lkz42wC; Fri, 18 Nov 2022 16:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668788244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9TOLs4sfHE9r4KgjswHd9IsAUKkPTmVJgoGRI0A7Oq8=; b=bPKL2qtAyVMoC9dEFi8pEBnrIDGOyYc0xkGR5qad75UnLuRPtHJG4Al81LjHrZcAiHekms l+xURukuFkLorvyce8z8Ls7QklHHxQKAwQntT0xwg3HzGE/82jLjGRCBIr6ppBiiMW/DKP mdAE67e5rOyE6Cmh2YIQmpxQfYv00RrMxlUrC+z304O96I2sNSC1eAMdoZgHntpGs2vVRZ t3tKkRPIhkOyu9/Cyy7ILrPEHlgwr4MMVyQkcMVUSiN9MWfTd62nB1yRuk0iyu79iwGh2M Om+5mJLKW8BpcOIXuEjBsXLT6r300NDEsr++yr5QQM8uPGzUfDy5xtltC0oN1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668788244; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=9TOLs4sfHE9r4KgjswHd9IsAUKkPTmVJgoGRI0A7Oq8=; b=KVaDDbx9xjaa0fC7n80BlMmnnlshAVQ70HuWezyV1guuLCNWVeuZS3cAc/S7lXITGZ2QUr IwworBFVLCK4QE3elAvGWIrURvfzLHqhXY79+FfJ2VtuSYObhc88y6podY9npgk/CGT38c 6buEYS2uQjOJ/HGkd2+3k+Bbou7t9J480rl2tM7dgNoYfbKoPKns0DBKYjHHCcXgM1P60o 29d0cId0vElFsaA98wi+xEFxye7hFea6Q+TjZ4ya6Z/ahJldM7vqSIZxQt2dt+k4L5NDzh Rzrl4xYXuzbomHIll71+8DEXTMFwrRrLI7Xsr0TcKFeBjHxKeWFHLQ1SQh7O0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668788244; a=rsa-sha256; cv=none; b=s8xhOc9cqMfrIP9Df/xgRDVuJ0nyQsAKG1sddSiyVnpjZbDEicK2LqnNlgH87X1f+g11Y3 YaWLhucz6XVrbXTGTIGyouwHxoVORt7NVxOLAQzyETG6VjOIZW45iEGu7EOVsvADnIpo3e Q4f8Z0z0qvtPfrgpRc0hFe1Bk7qZcBcFWzvIj2cwbsK1klZRDys1McNn6S6uBZ9UfHsYPl 4XYSJZGbY4kFnGI/wzSgOw/TiPa8iDEpijit3KjLBTv7wirKJ7X+357du1qiIrPnaS0ScO vRLZy3Niq8bXAcVuG5ThCx6ay+VZrJDeaXxDmzG6ADVdvFREij798NdC0qmBCQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NDMPc387nz1RDb; Fri, 18 Nov 2022 16:17:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AIGHOUW044791; Fri, 18 Nov 2022 16:17:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AIGHO3X044790; Fri, 18 Nov 2022 16:17:24 GMT (envelope-from git) Date: Fri, 18 Nov 2022 16:17:24 GMT Message-Id: <202211181617.2AIGHO3X044790@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Fernando=20Apestegu=C3=ADa?= Subject: git: 3d8cf46cdbe3 - main - cad/PrusaSlicer: update to 2.5.0 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3d8cf46cdbe30af59931532b4c7c95bd44e801da Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/ports/commit/?id=3d8cf46cdbe30af59931532b4c7c95bd44e801da commit 3d8cf46cdbe30af59931532b4c7c95bd44e801da Author: teodorsigaev@gmail.com AuthorDate: 2022-11-17 21:57:32 +0000 Commit: Fernando Apesteguía CommitDate: 2022-11-18 16:13:31 +0000 cad/PrusaSlicer: update to 2.5.0 ChangeLog: https://www.freshports.org/cad/PrusaSlicer/ PR: 267772 Reported by: teodorsigaev@gmail.com (maintainer) --- cad/PrusaSlicer/Makefile | 10 +- cad/PrusaSlicer/distinfo | 6 +- cad/PrusaSlicer/files/patch-CMakeLists.txt | 34 +- .../files/patch-cmake_modules_FindOpenVDB.cmake | 21 +- .../files/patch-cmake_modules_FindTBB.cmake | 738 --------------------- cad/PrusaSlicer/files/patch-src_CMakeLists.txt | 6 +- .../files/patch-src_avrdude_libavrdude.h | 2 +- cad/PrusaSlicer/files/patch-src_avrdude_main.c | 2 +- .../files/patch-src_hidapi_CMakeLists.txt | 2 +- .../files/patch-src_hidapi_libusb_hid.c | 2 +- .../files/patch-src_hints_HintsToPot.cpp | 10 + .../files/patch-src_libslic3r_CMakeLists.txt | 4 +- .../files/patch-src_libslic3r_Platform.cpp | 4 +- .../files/patch-src_libslic3r_Platform.hpp | 18 +- .../files/patch-src_libslic3r_Print.cpp | 29 - .../files/patch-src_libslic3r_PrintBase.cpp | 11 - .../files/patch-src_libslic3r_PrintBase.hpp | 118 ---- .../files/patch-src_libslic3r_PrintObject.cpp | 10 - .../files/patch-src_libslic3r_SLAPrint.cpp | 47 -- .../files/patch-src_libslic3r_SLA_Concurrency.hpp | 20 - .../files/patch-src_libslic3r_SLA_SupportTree.cpp | 12 - .../files/patch-src_libslic3r_SupportMaterial.cpp | 10 - .../files/patch-src_libslic3r_Thread.cpp | 41 -- .../files/patch-src_libslic3r_pchheader.hpp | 15 - .../files/patch-src_libslic3r_utils.cpp | 22 - .../files/patch-src_occt__wrapper_CMakeLists.txt | 22 + .../files/patch-src_qhull_CMakeLists.txt | 8 +- .../files/patch-src_slic3r_CMakeLists.txt | 16 +- ...tch-src_slic3r_GUI_BackgroundSlicingProcess.cpp | 29 - ...tch-src_slic3r_GUI_BackgroundSlicingProcess.hpp | 11 - .../files/patch-src_slic3r_GUI_GUI__App.cpp | 19 + .../files/patch-src_slic3r_GUI_InstanceCheck.cpp | 4 +- .../files/patch-src_slic3r_GUI_InstanceCheck.hpp | 11 - .../patch-src_slic3r_GUI_Mouse3DController.cpp | 154 ----- .../patch-src_slic3r_GUI_Mouse3DController.hpp | 49 -- .../files/patch-src_slic3r_GUI_OpenGLManager.cpp | 4 +- .../patch-src_slic3r_GUI_RemovableDriveManager.cpp | 104 --- .../patch-src_slic3r_GUI_RemovableDriveManager.hpp | 23 - ...a.cpp => patch-tests_fff__print_test__data.cpp} | 11 +- cad/PrusaSlicer/pkg-plist | 7 + 40 files changed, 137 insertions(+), 1529 deletions(-) diff --git a/cad/PrusaSlicer/Makefile b/cad/PrusaSlicer/Makefile index 14b3929e38ca..8b94985334b7 100644 --- a/cad/PrusaSlicer/Makefile +++ b/cad/PrusaSlicer/Makefile @@ -1,7 +1,6 @@ PORTNAME= PrusaSlicer DISTVERSIONPREFIX=version_ -DISTVERSION= 2.3.3 -PORTREVISION= 9 +DISTVERSION= 2.5.0 CATEGORIES= cad MAINTAINER= teodorsigaev@gmail.com @@ -11,6 +10,9 @@ WWW= https://www.prusa3d.com/prusaslicer/ LICENSE= AGPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE +BUILD_DEPENDS= cereal>=1.3.0.10:devel/cereal \ + cgal>=5.0.2:math/cgal \ + opencascade>=7.7.0:cad/opencascade LIB_DEPENDS= libtbb.so:devel/onetbb \ libboost_log.so:devel/boost-libs \ libImath.so:math/Imath \ @@ -22,8 +24,6 @@ LIB_DEPENDS= libtbb.so:devel/onetbb \ libmpfr.so:math/mpfr \ libdbus-1.so:devel/dbus \ libpng.so:graphics/png -BUILD_DEPENDS= cereal>=1.3.0.10:devel/cereal \ - cgal>=5.0.2:math/cgal USES= cmake cpe desktop-file-utils eigen:3 gettext gl iconv pkgconfig CPE_VENDOR= prusa3d @@ -32,8 +32,8 @@ CMAKE_ARGS+= -DwxWidgets_CONFIG_EXECUTABLE="${WX_CONFIG}" \ -DSLIC3R_FHS=1 USE_GITHUB= yes GH_ACCOUNT= prusa3d -USE_WX= 3.2 USE_GL= gl glu glew +USE_WX= 3.2 PORTDATA= * diff --git a/cad/PrusaSlicer/distinfo b/cad/PrusaSlicer/distinfo index f25d7ad594d1..f6e560972d6b 100644 --- a/cad/PrusaSlicer/distinfo +++ b/cad/PrusaSlicer/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1628978092 -SHA256 (prusa3d-PrusaSlicer-version_2.3.3_GH0.tar.gz) = deda209505f740ac3d6f59cb2a960f4df908269ee09bd30cd4edb9fc472d29ac -SIZE (prusa3d-PrusaSlicer-version_2.3.3_GH0.tar.gz) = 40659538 +TIMESTAMP = 1668348926 +SHA256 (prusa3d-PrusaSlicer-version_2.5.0_GH0.tar.gz) = dbbf3e10c812d1dc7bae4bd6879e60f864d763b2738b099dd34b9636d0e5eb6a +SIZE (prusa3d-PrusaSlicer-version_2.5.0_GH0.tar.gz) = 48591956 diff --git a/cad/PrusaSlicer/files/patch-CMakeLists.txt b/cad/PrusaSlicer/files/patch-CMakeLists.txt index ad640b3d895b..ef5fab78c7e5 100644 --- a/cad/PrusaSlicer/files/patch-CMakeLists.txt +++ b/cad/PrusaSlicer/files/patch-CMakeLists.txt @@ -1,14 +1,14 @@ ---- CMakeLists.txt.orig 2021-04-16 11:41:00 UTC +--- CMakeLists.txt.orig 2022-09-06 07:09:19 UTC +++ CMakeLists.txt -@@ -3,6 +3,7 @@ project(PrusaSlicer) - +@@ -4,6 +4,7 @@ project(PrusaSlicer) include("version.inc") include(GNUInstallDirs) + include(CMakeDependentOption) +add_compile_options(-DNDEBUG) set(SLIC3R_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/resources") file(TO_NATIVE_PATH "${SLIC3R_RESOURCES_DIR}" SLIC3R_RESOURCES_DIR_WIN) -@@ -166,7 +167,7 @@ if (APPLE) +@@ -197,7 +198,7 @@ if (APPLE) endif () endif () @@ -17,14 +17,24 @@ find_package(PkgConfig REQUIRED) if (CMAKE_VERSION VERSION_LESS "3.1") -@@ -525,8 +526,8 @@ elseif (SLIC3R_FHS) - # CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share) - set(SLIC3R_FHS_RESOURCES "${CMAKE_INSTALL_FULL_DATAROOTDIR}/PrusaSlicer") - install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "${SLIC3R_FHS_RESOURCES}") -- install(FILES src/platform/unix/PrusaSlicer.desktop DESTINATION ${SLIC3R_FHS_RESOURCES}/applications) -- install(FILES src/platform/unix/PrusaGcodeviewer.desktop DESTINATION ${SLIC3R_FHS_RESOURCES}/applications) -+ install(FILES src/platform/unix/PrusaSlicer.desktop DESTINATION share/applications) -+ install(FILES src/platform/unix/PrusaGcodeviewer.desktop DESTINATION share/applications) +@@ -597,8 +598,8 @@ elseif (SLIC3R_FHS) + install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/ DESTINATION ${SLIC3R_FHS_RESOURCES} + PATTERN "*/udev" EXCLUDE + ) +- install(FILES src/platform/unix/PrusaSlicer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) +- install(FILES src/platform/unix/PrusaGcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) ++ install(FILES src/platform/unix/PrusaSlicer.desktop DESTINATION share/applications) ++ install(FILES src/platform/unix/PrusaGcodeviewer.desktop DESTINATION share/applications) + foreach(SIZE 32 128 192) + install(FILES ${SLIC3R_RESOURCES_DIR}/icons/PrusaSlicer_${SIZE}px.png + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME PrusaSlicer.png +@@ -607,7 +608,8 @@ elseif (SLIC3R_FHS) + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/${SIZE}x${SIZE}/apps RENAME PrusaSlicer-gcodeviewer.png + ) + endforeach() +- install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/udev/ DESTINATION lib/udev/rules.d) ++ #FreeBSD doesn't have a udev ++ #install(DIRECTORY ${SLIC3R_RESOURCES_DIR}/udev/ DESTINATION lib/udev/rules.d) else () install(FILES src/platform/unix/PrusaSlicer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) install(FILES src/platform/unix/PrusaGcodeviewer.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/resources/applications) diff --git a/cad/PrusaSlicer/files/patch-cmake_modules_FindOpenVDB.cmake b/cad/PrusaSlicer/files/patch-cmake_modules_FindOpenVDB.cmake index 34a84f656874..3a99d042e938 100644 --- a/cad/PrusaSlicer/files/patch-cmake_modules_FindOpenVDB.cmake +++ b/cad/PrusaSlicer/files/patch-cmake_modules_FindOpenVDB.cmake @@ -1,10 +1,10 @@ ---- cmake/modules/FindOpenVDB.cmake.orig 2021-01-11 13:01:51 UTC +--- cmake/modules/FindOpenVDB.cmake.orig 2022-09-06 07:09:19 UTC +++ cmake/modules/FindOpenVDB.cmake -@@ -326,24 +326,24 @@ macro(just_fail msg) +@@ -347,24 +347,24 @@ 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) +find_package(Imath QUIET COMPONENTS Half) @@ -23,23 +23,24 @@ + if(Imath_LIBRARY-NOTFOUND OR NOT Imath_INCLUDE_DIRS) + just_fail("Imath::Half can not be found!") endif() - +- - add_library(IlmBase::Half UNKNOWN IMPORTED) - set_target_properties(IlmBase::Half PROPERTIES - IMPORTED_LOCATION "${IlmHalf_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${IlmBase_INCLUDE_DIRS}") -elseif(NOT IlmBase_FOUND) - just_fail("IlmBase::Half can not be found!") ++ + add_library(Imath::Half UNKNOWN IMPORTED) + set_target_properties(Imath::Half PROPERTIES -+ IMPORTED_LOCATION "${Imath_LIBRARY}" -+ INTERFACE_INCLUDE_DIRECTORIES "${Imath_INCLUDE_DIRS}") ++ IMPORTED_LOCATION "${Imath_LIBRARY}" ++ INTERFACE_INCLUDE_DIRECTORIES "${Imath_INCLUDE_DIRS}") +elseif(NOT Imath_FOUND) + just_fail("Imath::Half can not be found!") endif() find_package(TBB ${_quiet} ${_required} COMPONENTS tbb) find_package(ZLIB ${_quiet} ${_required}) -@@ -430,7 +430,7 @@ if(OpenVDB_USES_LOG4CPLUS) +@@ -451,7 +451,7 @@ if(OpenVDB_USES_LOG4CPLUS) endif() if(OpenVDB_USES_ILM) @@ -48,7 +49,7 @@ endif() if(OpenVDB_USES_EXR) -@@ -442,7 +442,7 @@ if(UNIX) +@@ -463,7 +463,7 @@ if(UNIX) endif() # Set deps. Note that the order here is important. If we're building against @@ -57,7 +58,7 @@ # users chosen namespaced headers are correctly prioritized. Otherwise other # include paths from shared installs (including houdini) may pull in the wrong # headers -@@ -450,7 +450,7 @@ endif() +@@ -471,7 +471,7 @@ endif() set(_OPENVDB_VISIBLE_DEPENDENCIES Boost::iostreams Boost::system @@ -66,7 +67,7 @@ ) set(_OPENVDB_DEFINITIONS) -@@ -460,10 +460,10 @@ endif() +@@ -481,10 +481,10 @@ endif() if(OpenVDB_USES_EXR) list(APPEND _OPENVDB_VISIBLE_DEPENDENCIES diff --git a/cad/PrusaSlicer/files/patch-cmake_modules_FindTBB.cmake b/cad/PrusaSlicer/files/patch-cmake_modules_FindTBB.cmake deleted file mode 100644 index 4faa74ef3698..000000000000 --- a/cad/PrusaSlicer/files/patch-cmake_modules_FindTBB.cmake +++ /dev/null @@ -1,738 +0,0 @@ ---- cmake/modules/FindTBB.cmake.orig 2021-07-16 10:14:03 UTC -+++ cmake/modules/FindTBB.cmake -@@ -1,332 +1,456 @@ --# The MIT License (MIT) -+# - Find ThreadingBuildingBlocks include dirs and libraries -+# Use this module by invoking find_package with the form: -+# find_package(TBB -+# [REQUIRED] # Fail with error if TBB is not found -+# ) # -+# Once done, this will define - # --# Copyright (c) 2015 Justus Calvin --# --# 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: --# --# The above copyright notice and this permission notice shall be included in all --# copies or substantial portions of the Software. --# --# 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. -- -+# TBB_FOUND - system has TBB -+# TBB_INCLUDE_DIRS - the TBB include directories -+# TBB_LIBRARIES - TBB libraries to be lined, doesn't include malloc or -+# malloc proxy -+# TBB::tbb - imported target for the TBB library - # --# FindTBB --# ------- -+# TBB_VERSION_MAJOR - Major Product Version Number -+# TBB_VERSION_MINOR - Minor Product Version Number -+# TBB_INTERFACE_VERSION - Engineering Focused Version Number -+# TBB_COMPATIBLE_INTERFACE_VERSION - The oldest major interface version -+# still supported. This uses the engineering -+# focused interface version numbers. - # --# Find TBB include directories and libraries. -+# TBB_MALLOC_FOUND - system has TBB malloc library -+# TBB_MALLOC_INCLUDE_DIRS - the TBB malloc include directories -+# TBB_MALLOC_LIBRARIES - The TBB malloc libraries to be lined -+# TBB::malloc - imported target for the TBB malloc library - # --# Usage: -+# TBB_MALLOC_PROXY_FOUND - system has TBB malloc proxy library -+# TBB_MALLOC_PROXY_INCLUDE_DIRS = the TBB malloc proxy include directories -+# TBB_MALLOC_PROXY_LIBRARIES - The TBB malloc proxy libraries to be lined -+# TBB::malloc_proxy - imported target for the TBB malloc proxy library - # --# 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: -+# This module reads hints about search locations from variables: -+# ENV TBB_ARCH_PLATFORM - for eg. set it to "mic" for Xeon Phi builds -+# ENV TBB_ROOT or just TBB_ROOT - root directory of tbb installation -+# ENV TBB_BUILD_PREFIX - specifies the build prefix for user built tbb -+# libraries. Should be specified with ENV TBB_ROOT -+# and optionally... -+# ENV TBB_BUILD_DIR - if build directory is different than ${TBB_ROOT}/build - # --# * 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: -+# Modified by Robert Maynard from the original OGRE source - # --# * TBB_INSTALL_DIR --# * TBBROOT --# * LIBRARY_PATH -+#------------------------------------------------------------------- -+# This file is part of the CMake build system for OGRE -+# (Object-oriented Graphics Rendering Engine) -+# For the latest info, see http://www.ogre3d.org/ - # --# This module will set the following variables: -+# The contents of this file are placed in the public domain. Feel -+# free to make use of it in any way you like. -+#------------------------------------------------------------------- - # --# * 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. -+#============================================================================= -+# Copyright 2010-2012 Kitware, Inc. -+# Copyright 2012 Rolf Eike Beer - # --# The following varibles should be used to build and link with TBB: -+# Distributed under the OSI-approved BSD License (the "License"); -+# see accompanying file Copyright.txt for details. - # --# * 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 software is distributed WITHOUT ANY WARRANTY; without even the -+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -+# See the License for more information. -+#============================================================================= -+# (To distribute this file outside of CMake, substitute the full -+# License text for the above reference.) -+ -+ -+#============================================================================= -+# FindTBB helper functions and macros - # --# This module will also create the "tbb" target that may be used when building --# executables and libraries. - --unset(TBB_FOUND CACHE) --unset(TBB_INCLUDE_DIRS CACHE) --unset(TBB_LIBRARIES) --unset(TBB_LIBRARIES_DEBUG) --unset(TBB_LIBRARIES_RELEASE) -+# Use TBBConfig.cmake if possible. - --include(FindPackageHandleStandardArgs) -+set(_tbb_find_quiet) -+if (TBB_FIND_QUIETLY) -+ set(_tbb_find_quiet QUIET) -+endif () -+set(_tbb_find_components) -+set(_tbb_find_optional_components) -+foreach (_tbb_find_component IN LISTS TBB_FIND_COMPONENTS) -+ if (TBB_FIND_REQUIRED_${_tbb_find_component}) -+ list(APPEND _tbb_find_components "${_tbb_find_component}") -+ else () -+ list(APPEND _tbb_find_optional_components "${_tbb_find_component}") -+ endif () -+endforeach () -+unset(_tbb_find_component) -+find_package(TBB CONFIG ${_tbb_find_quiet} -+ COMPONENTS ${_tbb_find_components} -+ OPTIONAL_COMPONENTS ${_tbb_find_optional_components}) -+unset(_tbb_find_quiet) -+unset(_tbb_find_components) -+unset(_tbb_find_optional_components) -+if (TBB_FOUND) -+ return () -+endif () - --find_package(Threads QUIET REQUIRED) -+#==================================================== -+# Fix the library path in case it is a linker script -+#==================================================== -+function(tbb_extract_real_library library real_library) -+ if(NOT UNIX OR NOT EXISTS ${library}) -+ set(${real_library} "${library}" PARENT_SCOPE) -+ return() -+ endif() - --if(NOT TBB_FOUND) -+ #Read in the first 4 bytes and see if they are the ELF magic number -+ set(_elf_magic "7f454c46") -+ file(READ ${library} _hex_data OFFSET 0 LIMIT 4 HEX) -+ if(_hex_data STREQUAL _elf_magic) -+ #we have opened a elf binary so this is what -+ #we should link to -+ set(${real_library} "${library}" PARENT_SCOPE) -+ return() -+ 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) -+ file(READ ${library} _data OFFSET 0 LIMIT 1024) -+ if("${_data}" MATCHES "INPUT \\(([^(]+)\\)") -+ #extract out the .so name from REGEX MATCH command -+ set(_proper_so_name "${CMAKE_MATCH_1}") -+ -+ #construct path to the real .so which is presumed to be in the same directory -+ #as the input file -+ get_filename_component(_so_dir "${library}" DIRECTORY) -+ set(${real_library} "${_so_dir}/${_proper_so_name}" PARENT_SCOPE) - else() -- set(TBB_BUILD_TYPE RELEASE) -+ #unable to determine what this library is so just hope everything works -+ #and pass it unmodified. -+ set(${real_library} "${library}" PARENT_SCOPE) - endif() -- -- ################################## -- # Set the TBB search directories -- ################################## -- -- # Define search paths based on user input and environment variables -- set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT}) -- -- # 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") -+endfunction() - -- # Set the target architecture -- if(CMAKE_SIZEOF_VOID_P EQUAL 8) -- set(TBB_ARCHITECTURE "intel64") -- else() -- set(TBB_ARCHITECTURE "ia32") -- endif() -+#=============================================== -+# Do the final processing for the package find. -+#=============================================== -+macro(findpkg_finish PREFIX TARGET_NAME) -+ if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY) -+ set(${PREFIX}_FOUND TRUE) -+ set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR}) -+ set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY}) -+ else () -+ if (${PREFIX}_FIND_REQUIRED AND NOT ${PREFIX}_FIND_QUIETLY) -+ message(FATAL_ERROR "Required library ${PREFIX} not found.") -+ endif () -+ endif () - -- # 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() -+ if (NOT TARGET "TBB::${TARGET_NAME}") -+ if (${PREFIX}_LIBRARY_RELEASE) -+ tbb_extract_real_library(${${PREFIX}_LIBRARY_RELEASE} real_release) -+ endif () -+ if (${PREFIX}_LIBRARY_DEBUG) -+ tbb_extract_real_library(${${PREFIX}_LIBRARY_DEBUG} real_debug) -+ endif () -+ add_library(TBB::${TARGET_NAME} UNKNOWN IMPORTED) -+ set_target_properties(TBB::${TARGET_NAME} PROPERTIES -+ INTERFACE_INCLUDE_DIRECTORIES "${${PREFIX}_INCLUDE_DIR}") -+ if (${PREFIX}_LIBRARY_DEBUG AND ${PREFIX}_LIBRARY_RELEASE) -+ set_target_properties(TBB::${TARGET_NAME} PROPERTIES -+ IMPORTED_LOCATION "${real_release}" -+ IMPORTED_LOCATION_DEBUG "${real_debug}" -+ IMPORTED_LOCATION_RELEASE "${real_release}") -+ elseif (${PREFIX}_LIBRARY_RELEASE) -+ set_target_properties(TBB::${TARGET_NAME} PROPERTIES -+ IMPORTED_LOCATION "${real_release}") -+ elseif (${PREFIX}_LIBRARY_DEBUG) -+ set_target_properties(TBB::${TARGET_NAME} PROPERTIES -+ IMPORTED_LOCATION "${real_debug}") -+ endif () -+ endif () - -- # Add the library path search suffix for the VC independent version of TBB -- list(APPEND TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc_mt") -+ #mark the following variables as internal variables -+ mark_as_advanced(${PREFIX}_INCLUDE_DIR -+ ${PREFIX}_LIBRARY -+ ${PREFIX}_LIBRARY_DEBUG -+ ${PREFIX}_LIBRARY_RELEASE) -+endmacro() - -- elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") -- # OS X -- set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") -- -- # 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() -- 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() -- -- ################################## -- # 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) -+#=============================================== -+# Generate debug names from given release names -+#=============================================== -+macro(get_debug_names PREFIX) -+ foreach(i ${${PREFIX}}) -+ set(${PREFIX}_DEBUG ${${PREFIX}_DEBUG} ${i}d ${i}D ${i}_d ${i}_D ${i}_debug ${i}) -+ endforeach() -+endmacro() - -- ################################## -- # Set version strings -- ################################## -+#=============================================== -+# See if we have env vars to help us find tbb -+#=============================================== -+macro(getenv_path VAR) -+ set(ENV_${VAR} $ENV{${VAR}}) -+ # replace won't work if var is blank -+ if (ENV_${VAR}) -+ string( REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}} ) -+ endif () -+endmacro() - -- 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() -+#=============================================== -+# Couple a set of release AND debug libraries -+#=============================================== -+macro(make_library_set PREFIX) -+ if (${PREFIX}_RELEASE AND ${PREFIX}_DEBUG) -+ set(${PREFIX} optimized ${${PREFIX}_RELEASE} debug ${${PREFIX}_DEBUG}) -+ elseif (${PREFIX}_RELEASE) -+ set(${PREFIX} ${${PREFIX}_RELEASE}) -+ elseif (${PREFIX}_DEBUG) -+ set(${PREFIX} ${${PREFIX}_DEBUG}) -+ endif () -+endmacro() - -- ################################## -- # Find TBB components -- ################################## - -- if(TBB_VERSION VERSION_LESS 4.3) -- set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb) -- else() -- set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb) -- endif() -+#============================================================================= -+# Now to actually find TBB -+# - -- if(TBB_STATIC) -- set(TBB_STATIC_SUFFIX "_static") -- endif() -+# Get path, convert backslashes as ${ENV_${var}} -+getenv_path(TBB_ROOT) - -- # Find each component -- foreach(_comp ${TBB_SEARCH_COMPOMPONENTS}) -- if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};") -+# initialize search paths -+set(TBB_PREFIX_PATH ${TBB_ROOT} ${ENV_TBB_ROOT}) -+set(TBB_INC_SEARCH_PATH "") -+set(TBB_LIB_SEARCH_PATH "") - -- 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}) -+# If user built from sources -+set(TBB_BUILD_PREFIX $ENV{TBB_BUILD_PREFIX}) -+if (TBB_BUILD_PREFIX AND ENV_TBB_ROOT) -+ getenv_path(TBB_BUILD_DIR) -+ if (NOT ENV_TBB_BUILD_DIR) -+ set(ENV_TBB_BUILD_DIR ${ENV_TBB_ROOT}/build) -+ endif () - -- 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}) -+ # include directory under ${ENV_TBB_ROOT}/include -+ list(APPEND TBB_LIB_SEARCH_PATH -+ ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_release -+ ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_debug) -+endif () - -- 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() -+# For Windows, let's assume that the user might be using the precompiled -+# TBB packages from the main website. These use a rather awkward directory -+# structure (at least for automatically finding the right files) depending -+# on platform and compiler, but we'll do our best to accommodate it. -+# Not adding the same effort for the precompiled linux builds, though. Those -+# have different versions for CC compiler versions and linux kernels which -+# will never adequately match the user's setup, so there is no feasible way -+# to detect the "best" version to use. The user will have to manually -+# select the right files. (Chances are the distributions are shipping their -+# custom version of tbb, anyway, so the problem is probably nonexistent.) -+if (WIN32 AND MSVC) -+ set(COMPILER_PREFIX "vc7.1") -+ if (MSVC_VERSION EQUAL 1400) -+ set(COMPILER_PREFIX "vc8") -+ elseif(MSVC_VERSION EQUAL 1500) -+ set(COMPILER_PREFIX "vc9") -+ elseif(MSVC_VERSION EQUAL 1600) -+ set(COMPILER_PREFIX "vc10") -+ elseif(MSVC_VERSION EQUAL 1700) -+ set(COMPILER_PREFIX "vc11") -+ elseif(MSVC_VERSION EQUAL 1800) -+ set(COMPILER_PREFIX "vc12") -+ elseif(MSVC_VERSION GREATER_EQUAL 1900) -+ set(COMPILER_PREFIX "vc14") -+ 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) -+ # for each prefix path, add ia32/64\${COMPILER_PREFIX}\lib to the lib search path -+ foreach (dir IN LISTS TBB_PREFIX_PATH) -+ if (CMAKE_CL_64) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia64/${COMPILER_PREFIX}/lib) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia64/${COMPILER_PREFIX}) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${COMPILER_PREFIX}/lib) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${COMPILER_PREFIX}) -+ else () -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX}) -+ endif () -+ endforeach () -+endif () - -- endif() -- endforeach() -+# For OS X binary distribution, choose libc++ based libraries for Mavericks (10.9) -+# and above and AppleClang -+if (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND -+ NOT CMAKE_SYSTEM_VERSION VERSION_LESS 13.0) -+ set (USE_LIBCXX OFF) -+ cmake_policy(GET CMP0025 POLICY_VAR) - -- ################################## -- # Set compile flags and libraries -- ################################## -+ if (POLICY_VAR STREQUAL "NEW") -+ if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") -+ set (USE_LIBCXX ON) -+ endif () -+ else () -+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -+ set (USE_LIBCXX ON) -+ endif () -+ endif () - -- 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}}") -+ if (USE_LIBCXX) -+ foreach (dir IN LISTS TBB_PREFIX_PATH) -+ list (APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/libc++ ${dir}/libc++/lib) -+ endforeach () -+ endif () -+endif () -+ -+# check compiler ABI -+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") -+ set(COMPILER_PREFIX) -+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8) -+ list(APPEND COMPILER_PREFIX "gcc4.8") - endif() -- -- if(NOT MSVC AND NOT TBB_LIBRARIES) -- set(TBB_LIBRARIES ${TBB_LIBRARIES_RELEASE}) -+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7) -+ list(APPEND COMPILER_PREFIX "gcc4.7") - endif() -+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) -+ list(APPEND COMPILER_PREFIX "gcc4.4") -+ endif() -+ list(APPEND COMPILER_PREFIX "gcc4.1") -+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang") -+ set(COMPILER_PREFIX) -+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0) # Complete guess -+ list(APPEND COMPILER_PREFIX "gcc4.8") -+ endif() -+ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6) -+ list(APPEND COMPILER_PREFIX "gcc4.7") -+ endif() -+ list(APPEND COMPILER_PREFIX "gcc4.4") -+else() # Assume compatibility with 4.4 for other compilers -+ list(APPEND COMPILER_PREFIX "gcc4.4") -+endif () - -- set(TBB_DEFINITIONS "") -- if (MSVC AND TBB_STATIC) -- set(TBB_DEFINITIONS __TBB_NO_IMPLICIT_LINKAGE) -- endif () -+# if platform architecture is explicitly specified -+set(TBB_ARCH_PLATFORM $ENV{TBB_ARCH_PLATFORM}) -+if (TBB_ARCH_PLATFORM) -+ foreach (dir IN LISTS TBB_PREFIX_PATH) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${TBB_ARCH_PLATFORM}/lib) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/${TBB_ARCH_PLATFORM}) -+ endforeach () -+endif () - -- unset (TBB_STATIC_SUFFIX) -+foreach (dir IN LISTS TBB_PREFIX_PATH) -+ foreach (prefix IN LISTS COMPILER_PREFIX) -+ if (CMAKE_SIZEOF_VOID_P EQUAL 8) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${prefix}) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/lib) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${prefix}/lib) -+ else () -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${prefix}) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/lib) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${prefix}/lib) -+ endif () -+ endforeach() -+endforeach () - -- 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) -+# add general search paths -+foreach (dir IN LISTS TBB_PREFIX_PATH) -+ list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib ${dir}/Lib ${dir}/lib/tbb -+ ${dir}/Libs) -+ list(APPEND TBB_INC_SEARCH_PATH ${dir}/include ${dir}/Include -+ ${dir}/include/tbb) -+endforeach () - -- ################################## -- # Create targets -- ################################## -+set(TBB_LIBRARY_NAMES tbb) -+get_debug_names(TBB_LIBRARY_NAMES) - -- 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) -+find_path(TBB_INCLUDE_DIR -+ NAMES tbb/tbb.h -+ PATHS ${TBB_INC_SEARCH_PATH}) - -- unset(TBB_ARCHITECTURE) -- unset(TBB_BUILD_TYPE) -- unset(TBB_LIB_PATH_SUFFIX) -- unset(TBB_DEFAULT_SEARCH_DIR) -+find_library(TBB_LIBRARY_RELEASE -+ NAMES ${TBB_LIBRARY_NAMES} -+ PATHS ${TBB_LIB_SEARCH_PATH}) -+find_library(TBB_LIBRARY_DEBUG -+ NAMES ${TBB_LIBRARY_NAMES_DEBUG} -+ PATHS ${TBB_LIB_SEARCH_PATH}) -+make_library_set(TBB_LIBRARY) - -- 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}") -+findpkg_finish(TBB tbb) -+ -+#if we haven't found TBB no point on going any further -+if (NOT TBB_FOUND) -+ return() -+endif () -+ -+#============================================================================= -+# Look for TBB's malloc package -+set(TBB_MALLOC_LIBRARY_NAMES tbbmalloc) -+get_debug_names(TBB_MALLOC_LIBRARY_NAMES) -+ -+find_path(TBB_MALLOC_INCLUDE_DIR -+ NAMES tbb/tbb.h -+ PATHS ${TBB_INC_SEARCH_PATH}) -+ -+find_library(TBB_MALLOC_LIBRARY_RELEASE -+ NAMES ${TBB_MALLOC_LIBRARY_NAMES} -+ PATHS ${TBB_LIB_SEARCH_PATH}) -+find_library(TBB_MALLOC_LIBRARY_DEBUG -+ NAMES ${TBB_MALLOC_LIBRARY_NAMES_DEBUG} -+ PATHS ${TBB_LIB_SEARCH_PATH}) -+make_library_set(TBB_MALLOC_LIBRARY) -+ -+findpkg_finish(TBB_MALLOC tbbmalloc) -+ -+#============================================================================= -+# Look for TBB's malloc proxy package -+set(TBB_MALLOC_PROXY_LIBRARY_NAMES tbbmalloc_proxy) -+get_debug_names(TBB_MALLOC_PROXY_LIBRARY_NAMES) -+ -+find_path(TBB_MALLOC_PROXY_INCLUDE_DIR -+ NAMES tbb/tbbmalloc_proxy.h -+ PATHS ${TBB_INC_SEARCH_PATH}) -+ -+find_library(TBB_MALLOC_PROXY_LIBRARY_RELEASE -+ NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES} -+ PATHS ${TBB_LIB_SEARCH_PATH}) -+find_library(TBB_MALLOC_PROXY_LIBRARY_DEBUG -+ NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES_DEBUG} -+ PATHS ${TBB_LIB_SEARCH_PATH}) -+make_library_set(TBB_MALLOC_PROXY_LIBRARY) -+ -+findpkg_finish(TBB_MALLOC_PROXY tbbmalloc_proxy) -+ -+ -+#============================================================================= -+#parse all the version numbers from tbb -+if(NOT TBB_VERSION) -+ if (EXISTS "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h") -+ file(STRINGS -+ "${TBB_INCLUDE_DIR}/oneapi/tbb/version.h" -+ TBB_VERSION_CONTENTS -+ REGEX "VERSION") -+ else() -+ #only read the start of the file -+ file(STRINGS -+ "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" -+ TBB_VERSION_CONTENTS -+ REGEX "VERSION") - endif() -+ -+ string(REGEX REPLACE -+ ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" -+ TBB_VERSION_MAJOR "${TBB_VERSION_CONTENTS}") -+ -+ string(REGEX REPLACE -+ ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" -+ TBB_VERSION_MINOR "${TBB_VERSION_CONTENTS}") -+ -+ string(REGEX REPLACE -+ ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" -+ TBB_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}") -+ -+ string(REGEX REPLACE -+ ".*#define TBB_COMPATIBLE_INTERFACE_VERSION ([0-9]+).*" "\\1" -+ TBB_COMPATIBLE_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}") - - endif() diff --git a/cad/PrusaSlicer/files/patch-src_CMakeLists.txt b/cad/PrusaSlicer/files/patch-src_CMakeLists.txt *** 1122 LINES SKIPPED ***