From 7f604308d0484fdb3a41e0adb6239ab403466a86 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 15 Jul 2019 12:45:28 +0200 Subject: [PATCH 01/13] Update FindTBB.cmake --- Installation/cmake/modules/FindTBB.cmake | 802 +++++++++++------------ 1 file changed, 399 insertions(+), 403 deletions(-) diff --git a/Installation/cmake/modules/FindTBB.cmake b/Installation/cmake/modules/FindTBB.cmake index 0d9a135cd52..b1a3d884c65 100644 --- a/Installation/cmake/modules/FindTBB.cmake +++ b/Installation/cmake/modules/FindTBB.cmake @@ -1,425 +1,421 @@ -# Locate Intel Threading Building Blocks include paths and libraries -# FindTBB.cmake can be found at https://code.google.com/p/findtbb/ -# Written by Hannes Hofmann -# Improvements by Gino van den Bergen , -# Florian Uhlig , -# Jiri Marsik - -# The MIT License +# - 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) 2011 Hannes Hofmann +# 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 # -# 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: +# 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. # -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. +# 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 # -# 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. - -# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler. -# e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21" -# TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found -# in the TBB installation directory (TBB_INSTALL_DIR). +# 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 # -# GvdB: Mac OS X distribution places libraries directly in lib directory. # -# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER. -# TBB_ARCHITECTURE [ ia32 | em64t | itanium ] -# which architecture to use -# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9 -# which compiler to use (detected automatically on Windows) - -# This module respects -# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR} - -# This module defines -# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc. -# TBB_LIBRARY_DIRS, where to find TBB libraries -# TBB_INSTALL_DIR, the base TBB install directory. -# TBB_LIBRARIES, all the following TBB libraries (both release and debug versions, using "optimized" and "debug" CMake keywords). Note that if the debug versions are not found, the release versions will be used instead for the debug mode. -# TBB_RELEASE_LIBRARY, the TBB release library -# TBB_MALLOC_RELEASE_LIBRARY, the TBB release malloc library -# TBB_DEBUG_LIBRARY, the TBB debug library -# TBB_MALLOC_DEBUG_LIBRARY, the TBB debug malloc library -# TBB_FOUND, If false, don't try to use TBB. -# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h -# TBB_MALLOCPROXY_DEBUG_LIBRARY, the TBB debug malloc_proxy library (not included in TBB_LIBRARIES since it's optionnal) -# TBB_MALLOCPROXY_RELEASE_LIBRARY, the TBB release malloc_proxy library (not included in TBB_LIBRARIES since it's optionnal) - -include(CheckCXXSourceCompiles) - -# Usage: -# try_TBB_with_pthread( [additional linker args...]) -function(try_TBB_with_pthread result_var) - set(TBB_try_ts_source " - #include - int main() { - tbb::enumerable_thread_specific< - bool*, - tbb::cache_aligned_allocator, - tbb::ets_key_per_instance> grid; - } - ") - set(CMAKE_REQUIRED_LIBRARIES ${ALL_TBB_LIBRARIES} ${ARGN}) - set(CMAKE_REQUIRED_INCLUDES ${TBB_INCLUDE_DIR}) - check_cxx_source_compiles("${TBB_try_ts_source}" ${result_var}) - set(${result_var} ${${result_var}} PARENT_SCOPE) -endfunction(try_TBB_with_pthread) - -if (WIN32) - # has em64t/vc8 em64t/vc9 - # has ia32/vc7.1 ia32/vc8 ia32/vc9 - set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB") - set(_TBB_LIB_RELEASE_NAME "tbb") - set(_TBB_LIB_MALLOC_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc") - set(_TBB_LIB_MALLOCPROXY_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc_proxy") - set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_RELEASE_NAME}_debug") - set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_RELEASE_NAME}_debug") - set(_TBB_LIB_MALLOCPROXY_DEBUG_NAME "${_TBB_LIB_MALLOCPROXY_RELEASE_NAME}_debug") - if (MSVC71) - set (_TBB_COMPILER "vc7.1") - endif(MSVC71) - if (MSVC80) - set(_TBB_COMPILER "vc8") - endif(MSVC80) - if (MSVC90) - set(_TBB_COMPILER "vc9") - endif(MSVC90) - if(MSVC10) - set(_TBB_COMPILER "vc10") - endif(MSVC10) - if(MSVC11) - set(_TBB_COMPILER "vc11") - endif(MSVC11) - if(MSVC12) - set(_TBB_COMPILER "vc12") - endif(MSVC12) - #note there was no MSVC13 - if(MSVC14) - set(_TBB_COMPILER "vc14") - endif(MSVC14) - # Todo: add other Windows compilers such as ICL. - set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) -endif (WIN32) - -if (UNIX) - if (APPLE) - # MAC - set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions") - # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug - set(_TBB_LIB_RELEASE_NAME "tbb") - set(_TBB_LIB_MALLOC_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc") - #set(_TBB_LIB_MALLOCPROXY_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc_proxy") - set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_RELEASE_NAME}_debug") - set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_RELEASE_NAME}_debug") - #set(_TBB_LIB_MALLOCPROXY_DEBUG_NAME "${_TBB_LIB_MALLOCPROXY_RELEASE_NAME}_debug") - # default flavor on apple: ia32/cc4.0.1_os10.4.9 - # Jiri: There is no reason to presume there is only one flavor and - # that user's setting of variables should be ignored. - if(NOT TBB_COMPILER) - set(_TBB_COMPILER "cc4.0.1_os10.4.9") - elseif (NOT TBB_COMPILER) - set(_TBB_COMPILER ${TBB_COMPILER}) - endif(NOT TBB_COMPILER) - if(NOT TBB_ARCHITECTURE) - set(_TBB_ARCHITECTURE "ia32") - elseif(NOT TBB_ARCHITECTURE) - set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) - endif(NOT TBB_ARCHITECTURE) - else (APPLE) - # LINUX - set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include") - set(_TBB_LIB_RELEASE_NAME "tbb") - set(_TBB_LIB_MALLOC_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc") - set(_TBB_LIB_MALLOCPROXY_RELEASE_NAME "${_TBB_LIB_RELEASE_NAME}malloc_proxy") - set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_RELEASE_NAME}_debug") - set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_RELEASE_NAME}_debug") - set(_TBB_LIB_MALLOCPROXY_DEBUG_NAME "${_TBB_LIB_MALLOCPROXY_RELEASE_NAME}_debug") - # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21 - # has ia32/* - # has itanium/* - set(_TBB_COMPILER ${TBB_COMPILER}) - set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE}) - endif (APPLE) -endif (UNIX) - -if (CMAKE_SYSTEM MATCHES "SunOS.*") -# SUN -# not yet supported -# has em64t/cc3.4.3_kernel5.10 -# has ia32/* -endif (CMAKE_SYSTEM MATCHES "SunOS.*") +# 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 +# +# +# Modified by Robert Maynard from the original OGRE source +# +#------------------------------------------------------------------- +# 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/ +# +# The contents of this file are placed in the public domain. Feel +# free to make use of it in any way you like. +#------------------------------------------------------------------- +# +#============================================================================= +# Copyright 2010-2012 Kitware, Inc. +# Copyright 2012 Rolf Eike Beer +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# 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.) -#-- Clear the public variables -set (TBB_FOUND "NO") +#============================================================================= +# FindTBB helper functions and macros +# + +#==================================================== +# 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() + + #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() + + 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() + #unable to determine what this library is so just hope everything works + #and pass it unmodified. + set(${real_library} "${library}" PARENT_SCOPE) + endif() +endfunction() + +#=============================================== +# Do the final processing for the package find. +#=============================================== +macro(findpkg_finish PREFIX TARGET_NAME) + # skip if already processed during this run + if (NOT ${PREFIX}_FOUND) + 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 () + + 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 () + + #mark the following variables as internal variables + mark_as_advanced(${PREFIX}_INCLUDE_DIR + ${PREFIX}_LIBRARY + ${PREFIX}_LIBRARY_DEBUG + ${PREFIX}_LIBRARY_RELEASE) + endif () +endmacro() + +#=============================================== +# 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() + +#=============================================== +# 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() + +#=============================================== +# 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 install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR} -# first: use CMake variable TBB_INSTALL_DIR -if (TBB_INSTALL_DIR) - set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR}) -endif (TBB_INSTALL_DIR) -# second: use environment variable -if (NOT _TBB_INSTALL_DIR) - if (NOT "$ENV{TBBROOT}" STREQUAL "") - set (_TBB_INSTALL_DIR $ENV{TBBROOT}) - endif (NOT "$ENV{TBBROOT}" STREQUAL "") - if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "") - set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR}) - endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "") - # Intel recommends setting TBB21_INSTALL_DIR - if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "") - set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR}) - endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "") - if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "") - set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR}) - endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "") - if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "") - set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR}) - endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "") -endif (NOT _TBB_INSTALL_DIR) -# third: try to find path automatically -if (NOT _TBB_INSTALL_DIR) - if (_TBB_DEFAULT_INSTALL_DIR) - set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR}) - endif (_TBB_DEFAULT_INSTALL_DIR) -endif (NOT _TBB_INSTALL_DIR) -# sanity check -if (NOT _TBB_INSTALL_DIR) - message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}") -else (NOT _TBB_INSTALL_DIR) -# finally: set the cached CMake variable TBB_INSTALL_DIR -if (NOT TBB_INSTALL_DIR) - set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory") - mark_as_advanced(TBB_INSTALL_DIR) -endif (NOT TBB_INSTALL_DIR) +#============================================================================= +# Now to actually find TBB +# + +# Get path, convert backslashes as ${ENV_${var}} +getenv_path(TBB_ROOT) + +# initialize search paths +set(TBB_PREFIX_PATH ${TBB_ROOT} ${ENV_TBB_ROOT}) +set(TBB_INC_SEARCH_PATH "") +set(TBB_LIB_SEARCH_PATH "") -#-- A macro to rewrite the paths of the library. This is necessary, because -# find_library() always found the em64t/vc9 version of the TBB libs -macro(TBB_CORRECT_LIB_DIR var_name) -# if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t") - string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) -# endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t") - string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}}) - string(REGEX REPLACE "vc[0-9]+(\.[0-9]+)?" "${_TBB_COMPILER}" ${var_name} ${${var_name}}) -endmacro(TBB_CORRECT_LIB_DIR var_content) +# 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 () + + # 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 () + + +# 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 EQUAL 1900) + set(COMPILER_PREFIX "vc14") + endif () + + # 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 () + +# 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) + + 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 () + + 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.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 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 () + +# 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 () + +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 () + +# 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 () + +set(TBB_LIBRARY_NAMES tbb) +get_debug_names(TBB_LIBRARY_NAMES) -#-- Look for include directory and set ${TBB_INCLUDE_DIR} -set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include) -# Jiri: tbbvars now sets the CPATH environment variable to the directory -# containing the headers. -# LR: search first with NO_DEFAULT_PATH... find_path(TBB_INCLUDE_DIR - tbb/task_scheduler_init.h - PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH - NO_DEFAULT_PATH -) -if(NOT TBB_INCLUDE_DIR) -# LR: ... and then search again with NO_DEFAULT_PATH if nothing was found in -# hinted paths - find_path(TBB_INCLUDE_DIR - tbb/task_scheduler_init.h - PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH - ) -endif() -mark_as_advanced(TBB_INCLUDE_DIR) + NAMES tbb/tbb.h + PATHS ${TBB_INC_SEARCH_PATH}) +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) -#-- Look for libraries -# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh] -if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") - set (_TBB_LIBRARY_DIR - ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM} - ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib - ) -endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "") -# Jiri: This block isn't mutually exclusive with the previous one -# (hence no else), instead I test if the user really specified -# the variables in question. -if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "")) - # HH: deprecated - message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).") - # Jiri: It doesn't hurt to look in more places, so I store the hints from - # ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER - # variables and search them both. - set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR}) -endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL "")) - -# GvdB: Mac OS X distribution places libraries directly in lib directory. -list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib) - -# Jiri: No reason not to check the default paths. From recent versions, -# tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH -# variables, which now point to the directories of the lib files. -# It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS -# argument instead of the implicit PATHS as it isn't hard-coded -# but computed by system introspection. Searching the LIBRARY_PATH -# and LD_LIBRARY_PATH environment variables is now even more important -# that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates -# the use of TBB built from sources. -# LR: search first with NO_DEFAULT_PATH... -find_library(TBB_RELEASE_LIBRARY ${_TBB_LIB_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH) -find_library(TBB_MALLOC_RELEASE_LIBRARY ${_TBB_LIB_MALLOC_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH) -find_library(TBB_MALLOCPROXY_RELEASE_LIBRARY ${_TBB_LIB_MALLOCPROXY_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH) -if(NOT TBB_RELEASE_LIBRARY OR NOT TBB_MALLOC_RELEASE_LIBRARY OR NOT TBB_MALLOCPROXY_RELEASE_LIBRARY) -# LR: ... and then search again with NO_DEFAULT_PATH if nothing was found -# in hinted paths - find_library(TBB_RELEASE_LIBRARY ${_TBB_LIB_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) - find_library(TBB_MALLOC_RELEASE_LIBRARY ${_TBB_LIB_MALLOC_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) - find_library(TBB_MALLOCPROXY_RELEASE_LIBRARY ${_TBB_LIB_MALLOCPROXY_RELEASE_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) -endif() - -#Extract path from TBB_RELEASE_LIBRARY name -get_filename_component(TBB_RELEASE_LIBRARY_DIR ${TBB_RELEASE_LIBRARY} PATH) - -#TBB_CORRECT_LIB_DIR(TBB_RELEASE_LIBRARY) -#TBB_CORRECT_LIB_DIR(TBB_MALLOC_RELEASE_LIBRARY) -#TBB_CORRECT_LIB_DIR(TBB_MALLOCPROXY_RELEASE_LIBRARY) -mark_as_advanced(TBB_RELEASE_LIBRARY TBB_MALLOC_RELEASE_LIBRARY TBB_MALLOCPROXY_RELEASE_LIBRARY) - -#-- Look for debug libraries -# Jiri: Changed the same way as for the release libraries. -find_library(TBB_DEBUG_LIBRARY ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH) -find_library(TBB_MALLOC_DEBUG_LIBRARY ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH) -find_library(TBB_MALLOCPROXY_DEBUG_LIBRARY ${_TBB_LIB_MALLOCPROXY_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH NO_DEFAULT_PATH) -if(NOT TBB_DEBUG_LIBRARY OR NOT TBB_MALLOC_DEBUG_LIBRARY OR NOT TBB_MALLOCPROXY_DEBUG_LIBRARY) - find_library(TBB_DEBUG_LIBRARY ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) - find_library(TBB_MALLOC_DEBUG_LIBRARY ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) - find_library(TBB_MALLOCPROXY_DEBUG_LIBRARY ${_TBB_LIB_MALLOCPROXY_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR} - PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH) -endif() - -# Jiri: Self-built TBB stores the debug libraries in a separate directory. -# Extract path from TBB_DEBUG_LIBRARY name -get_filename_component(TBB_DEBUG_LIBRARY_DIR ${TBB_DEBUG_LIBRARY} PATH) - -#TBB_CORRECT_LIB_DIR(TBB_DEBUG_LIBRARY) -#TBB_CORRECT_LIB_DIR(TBB_MALLOC_DEBUG_LIBRARY) -#TBB_CORRECT_LIB_DIR(TBB_MALLOCPROXY_DEBUG_LIBRARY) -mark_as_advanced(TBB_DEBUG_LIBRARY TBB_MALLOC_DEBUG_LIBRARY TBB_MALLOCPROXY_DEBUG_LIBRARY) - -if (TBB_INCLUDE_DIR) - if (TBB_RELEASE_LIBRARY) - set (TBB_FOUND "YES") - - # NOTE: Removed because we don't want to link with the malloc_proxy by default - #if (NOT "${TBB_MALLOCPROXY_RELEASE_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_RELEASE_LIBRARY-NOTFOUND") - # mark_as_advanced(TBB_MALLOCPROXY_RELEASE_LIBRARY) - # set (_TBB_MALLOCPROXY optimized ${TBB_MALLOCPROXY_RELEASE_LIBRARY}) - #endif (NOT "${TBB_MALLOCPROXY_RELEASE_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_RELEASE_LIBRARY-NOTFOUND") - #if (NOT "${TBB_MALLOCPROXY_DEBUG_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_DEBUG_LIBRARY-NOTFOUND") - # mark_as_advanced(TBB_MALLOCPROXY_DEBUG_LIBRARY) - # set (_TBB_MALLOCPROXY ${_TBB_MALLOCPROXY} debug ${TBB_MALLOCPROXY_DEBUG_LIBRARY}) - #endif (NOT "${TBB_MALLOCPROXY_DEBUG_LIBRARY}" STREQUAL "TBB_MALLOCPROXY_DEBUG_LIBRARY-NOTFOUND") - - # TBB release library - set (ALL_TBB_LIBRARIES optimized ${TBB_RELEASE_LIBRARY}) - - # TBB debug library found? - if (TBB_DEBUG_LIBRARY) - list(APPEND ALL_TBB_LIBRARIES debug ${TBB_DEBUG_LIBRARY}) - else (TBB_DEBUG_LIBRARY) - # Otherwise, link with the release library even in debug mode - list(APPEND ALL_TBB_LIBRARIES debug ${TBB_RELEASE_LIBRARY}) - endif (TBB_DEBUG_LIBRARY) - - # TBB malloc - release - if (TBB_MALLOC_RELEASE_LIBRARY) - list(APPEND ALL_TBB_LIBRARIES optimized ${TBB_MALLOC_RELEASE_LIBRARY}) - - # TBB malloc - debug - if (TBB_MALLOC_DEBUG_LIBRARY) - list(APPEND ALL_TBB_LIBRARIES debug ${TBB_MALLOC_DEBUG_LIBRARY}) - else (TBB_MALLOC_DEBUG_LIBRARY) - list(APPEND ALL_TBB_LIBRARIES debug ${TBB_MALLOC_RELEASE_LIBRARY}) - endif (TBB_MALLOC_DEBUG_LIBRARY) - endif (TBB_MALLOC_RELEASE_LIBRARY) - - if(UNIX AND NOT APPLE) - # On Fedora, code using TBB might need -pthread - - # First check without pthread - try_TBB_with_pthread(TBB_without_pthread) - - if(NOT TBB_without_pthread) - # Then check with -pthread - try_TBB_with_pthread(TBB_with_pthread -pthread) - if(TBB_with_pthread) - list(APPEND ALL_TBB_LIBRARIES general -pthread) - endif(TBB_with_pthread) - endif(NOT TBB_without_pthread) - endif(UNIX AND NOT APPLE) - - set (TBB_LIBRARIES ${ALL_TBB_LIBRARIES} - CACHE PATH "TBB libraries" FORCE) - - # Include dirs - set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE) - - # Library dirs - if( "${TBB_DEBUG_LIBRARY_DIR}" STREQUAL "" OR "${TBB_RELEASE_LIBRARY_DIR}" STREQUAL "${TBB_DEBUG_LIBRARY_DIR}" ) - set (TBB_LIBRARY_DIRS - ${TBB_RELEASE_LIBRARY_DIR} - CACHE PATH "TBB library directories" FORCE) - else( "${TBB_DEBUG_LIBRARY_DIR}" STREQUAL "" OR "${TBB_RELEASE_LIBRARY_DIR}" STREQUAL "${TBB_DEBUG_LIBRARY_DIR}" ) - set (TBB_LIBRARY_DIRS - ${TBB_RELEASE_LIBRARY_DIR} ${TBB_DEBUG_LIBRARY_DIR} - CACHE PATH "TBB library directories" FORCE) - endif( "${TBB_DEBUG_LIBRARY_DIR}" STREQUAL "" OR "${TBB_RELEASE_LIBRARY_DIR}" STREQUAL "${TBB_DEBUG_LIBRARY_DIR}" ) - - message(STATUS "Found Intel TBB") - endif (TBB_RELEASE_LIBRARY) -endif (TBB_INCLUDE_DIR) +findpkg_finish(TBB tbb) +#if we haven't found TBB no point on going any further if (NOT TBB_FOUND) - if(NOT TBB_FIND_QUIETLY) - message("ERROR: Intel TBB NOT found! Please define the TBBROOT (or TBB_INSTALL_DIR) and/or TBB_ARCH_PLATFORM environment variables.") - message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}") - endif(NOT TBB_FIND_QUIETLY) - SET(TBB_INSTALL_DIR "TBB_INSTALL_DIR_NOT_FOUND" CACHE STRING "Intel TBB install directory") - # do only throw fatal, if this pkg is REQUIRED - if (TBB_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find TBB library.") - endif (TBB_FIND_REQUIRED) -endif (NOT TBB_FOUND) + return() +endif () -endif (NOT _TBB_INSTALL_DIR) +#============================================================================= +# Look for TBB's malloc package +set(TBB_MALLOC_LIBRARY_NAMES tbbmalloc) +get_debug_names(TBB_MALLOC_LIBRARY_NAMES) -if (TBB_FOUND) - set(TBB_INTERFACE_VERSION 0) - FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS) - STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}") - set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}") -endif (TBB_FOUND) +find_path(TBB_MALLOC_INCLUDE_DIR + NAMES tbb/tbb.h + PATHS ${TBB_INC_SEARCH_PATH}) -set(TBB_USE_FILE "UseTBB") -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake) -### ** Emacs settings ** -### Local Variables: -### cmake-tab-width: 4 -### End: +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) + + #only read the start of the file + file(STRINGS + "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h" + TBB_VERSION_CONTENTS + REGEX "VERSION") + + 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() From d200ad2748502b733595fbfa342a85aca58c441f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 16 Jul 2019 11:23:50 +0200 Subject: [PATCH 02/13] fix intersections_2 tests warning --- Intersections_2/test/Intersections_2/test_intersections_2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Intersections_2/test/Intersections_2/test_intersections_2.cpp b/Intersections_2/test/Intersections_2/test_intersections_2.cpp index e382469b83c..21daa47c5ba 100644 --- a/Intersections_2/test/Intersections_2/test_intersections_2.cpp +++ b/Intersections_2/test/Intersections_2/test_intersections_2.cpp @@ -554,7 +554,7 @@ struct Test { int main() { - Test< CGAL::Simple_cartesian::Type > >().run(); + Test< CGAL::Simple_cartesian::Type > >().run(); Test< CGAL::Cartesian >().run(); Test< CGAL::Homogeneous >().run(); Test< CGAL::Exact_predicates_inexact_constructions_kernel >().run(); From 1c7fe052d362f23d2b5556de5fd0b0d7101fb258 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 16 Jul 2019 11:30:06 +0200 Subject: [PATCH 03/13] fix warning in CGAL_ipelets --- CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h index 853eecf880d..0c96182266d 100644 --- a/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h +++ b/CGAL_ipelets/include/CGAL/CGAL_Ipelet_base_v7.h @@ -66,7 +66,7 @@ namespace CGAL{ ipe::TSelect get_selection_type() const { return get_IpePage()->primarySelection()==-1 ? ipe::EPrimarySelected : ipe::ESecondarySelected;} //ipe6 compatibility void transform_selected_objects_(const IpeMatrix& tfm) const { - for (int i=0;icount();++i) + for (int i=0;i(get_IpePage()->count());++i) if (get_IpePage()->select(i)!=ipe::ENotSelected) get_IpePage()->transform(i,tfm); } @@ -276,7 +276,7 @@ public: return Iso_rectangle_2(); } - for (int i=0;icount();++i){ + for (int i=0;i(get_IpePage()->count());++i){ if (get_IpePage()->select(i)==ipe::ENotSelected) continue; @@ -308,7 +308,7 @@ public: create_polygon_with_holes(bool delete_underlying_polygons=false) const { std::list SSPqu; - for (int i=0;icount();++i){ + for (int i=0;i(get_IpePage()->count());++i){ if (get_IpePage()->select(i)!=ipe::ENotSelected && get_IpePage()->object(i)->asPath()->shape().subPath(0)->closed() ){ ipe::SubPath* ssp=new ipe::Curve(*get_IpePage()->object(i)->asPath()->shape().subPath(0)->asCurve()); SSPqu.push_back(ssp); From d3d996d18e83b3d045847975ec47c759d786195c Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 16 Jul 2019 11:40:09 +0200 Subject: [PATCH 04/13] Fix warning in SDG --- .../test/Segment_Delaunay_graph_2/include/test_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_types.h b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_types.h index 630d7411361..98136c357d1 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_types.h +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/include/test_types.h @@ -167,7 +167,8 @@ bool test_sdg(InputStream&, const SDG&, const char* ifname, const char* ofname, start_testing("assignment operator"); sdg.insert(site_list.begin(), site_list.end()); - sdg = sdg; + Segment_Delaunay_graph_2 tmp; + tmp = sdg; sdg2 = sdg; assert( sdg.is_valid() ); From 014a29bc3ccd29a34ab27ee4a6ae4d9918408928 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 16 Jul 2019 12:06:26 +0200 Subject: [PATCH 05/13] Fix warning in Snap_rounding_2 --- Kernel_23/include/CGAL/determinant.h | 2 +- Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Kernel_23/include/CGAL/determinant.h b/Kernel_23/include/CGAL/determinant.h index c91ea8d32e5..097fc6e73de 100644 --- a/Kernel_23/include/CGAL/determinant.h +++ b/Kernel_23/include/CGAL/determinant.h @@ -39,7 +39,7 @@ determinant( const RT& a10, const RT& a11) { // First compute the det2x2 - const RT m01 = a00*a11 - a10*a01; + const RT m01 = (a00*a11 - a10*a01); return m01; } diff --git a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h index 3db1a9f4190..c9d33d80667 100644 --- a/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h +++ b/Snap_rounding_2/include/CGAL/Snap_rounding_kd_2.h @@ -591,7 +591,6 @@ public: iter->first->search(std::back_inserter(result), b); // create result - result_list.empty(); for( Point_with_hot_pixel_history_saved_iter my_point_iter = result.begin(); my_point_iter != result.end(); ++my_point_iter ) result_list.push_back(my_point_iter->object); From 82567685ad0490f9eb369eead28d02cb8a3b0c44 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 19 Jul 2019 09:34:12 +0200 Subject: [PATCH 06/13] Add include of CGAL_taret_use_TBB in the end of the new FindTBB --- Installation/cmake/modules/FindTBB.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Installation/cmake/modules/FindTBB.cmake b/Installation/cmake/modules/FindTBB.cmake index b1a3d884c65..5e7dc208df8 100644 --- a/Installation/cmake/modules/FindTBB.cmake +++ b/Installation/cmake/modules/FindTBB.cmake @@ -419,3 +419,6 @@ if(NOT TBB_VERSION) TBB_COMPATIBLE_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}") endif() + +set(TBB_USE_FILE "UseTBB") +include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake) From 41c7ac47dd0e4a6e062320fc14cb44e41710e1b3 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Mon, 22 Jul 2019 16:16:29 +0200 Subject: [PATCH 07/13] Try to fix error in archlinux-clang-release --- Kernel_23/include/CGAL/determinant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/include/CGAL/determinant.h b/Kernel_23/include/CGAL/determinant.h index 097fc6e73de..8d49da90232 100644 --- a/Kernel_23/include/CGAL/determinant.h +++ b/Kernel_23/include/CGAL/determinant.h @@ -39,7 +39,7 @@ determinant( const RT& a10, const RT& a11) { // First compute the det2x2 - const RT m01 = (a00*a11 - a10*a01); + const RT m01 = (RT)(a00*a11 - a10*a01); return m01; } From 538780d276851ea9af4937103c51277ace9e9f73 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 23 Jul 2019 09:40:10 +0200 Subject: [PATCH 08/13] Fix the fix --- Kernel_23/include/CGAL/determinant.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel_23/include/CGAL/determinant.h b/Kernel_23/include/CGAL/determinant.h index 8d49da90232..537907507fa 100644 --- a/Kernel_23/include/CGAL/determinant.h +++ b/Kernel_23/include/CGAL/determinant.h @@ -39,7 +39,7 @@ determinant( const RT& a10, const RT& a11) { // First compute the det2x2 - const RT m01 = (RT)(a00*a11 - a10*a01); + const RT m01 = RT(a00*a11 - a10*a01); return m01; } From 036b3efb9a876894338b32a491be9337875e61b7 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 23 Jul 2019 10:11:53 +0200 Subject: [PATCH 09/13] Actually fix the bug --- Kernel_23/include/CGAL/determinant.h | 2 +- .../include/CGAL/Segment_Delaunay_graph_site_2.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Kernel_23/include/CGAL/determinant.h b/Kernel_23/include/CGAL/determinant.h index 537907507fa..c91ea8d32e5 100644 --- a/Kernel_23/include/CGAL/determinant.h +++ b/Kernel_23/include/CGAL/determinant.h @@ -39,7 +39,7 @@ determinant( const RT& a10, const RT& a11) { // First compute the det2x2 - const RT m01 = RT(a00*a11 - a10*a01); + const RT m01 = a00*a11 - a10*a01; return m01; } diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h index 3cab50112f5..4c6a337f8a0 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_site_2.h @@ -289,8 +289,8 @@ protected: RT x3 = p3.x(), y3 = p3.y(); RT x4 = p4.x(), y4 = p4.y(); - RT D = determinant(x2 - x1, x4 - x3, y2 - y1, y4 - y3); - RT Dt = determinant(x3 - x1, x4 - x3, y3 - y1, y4 - y3); + RT D = determinant(x2 - x1, x4 - x3, y2 - y1, y4 - y3); + RT Dt = determinant(x3 - x1, x4 - x3, y3 - y1, y4 - y3); RT t = Dt / D; From 85ab4e9041b561e98c8b3b3352e595499a584d28 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Wed, 24 Jul 2019 08:49:34 +0200 Subject: [PATCH 10/13] Add missing inlines to PSP IO non-template functions --- .../include/CGAL/IO/read_las_points.h | 42 +++++++++---------- .../include/CGAL/IO/write_las_points.h | 36 ++++++++-------- .../include/CGAL/IO/write_ply_points.h | 24 +++++------ 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/IO/read_las_points.h b/Point_set_processing_3/include/CGAL/IO/read_las_points.h index c28d8d16a6d..279468a226e 100644 --- a/Point_set_processing_3/include/CGAL/IO/read_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/read_las_points.h @@ -160,47 +160,47 @@ namespace internal { namespace LAS { - void get_value(const LASpoint& r, double& v, LAS_property::X&) + inline void get_value(const LASpoint& r, double& v, LAS_property::X&) { v = r.get_x(); } - void get_value(const LASpoint& r, double& v, LAS_property::Y&) + inline void get_value(const LASpoint& r, double& v, LAS_property::Y&) { v = r.get_y(); } - void get_value(const LASpoint& r, double& v, LAS_property::Z&) + inline void get_value(const LASpoint& r, double& v, LAS_property::Z&) { v = r.get_z(); } - void get_value(const LASpoint& r, unsigned short& v, LAS_property::Intensity&) + inline void get_value(const LASpoint& r, unsigned short& v, LAS_property::Intensity&) { v = r.get_intensity(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Return_number&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Return_number&) { v = r.get_return_number(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Number_of_returns&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Number_of_returns&) { v = r.get_number_of_returns(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Scan_direction_flag&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Scan_direction_flag&) { v = r.get_scan_direction_flag(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Edge_of_flight_line&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Edge_of_flight_line&) { v = r.get_edge_of_flight_line(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Classification&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Classification&) { v = r.get_classification(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Synthetic_flag&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Synthetic_flag&) { v = r.get_synthetic_flag(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Keypoint_flag&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Keypoint_flag&) { v = r.get_keypoint_flag(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::Withheld_flag&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::Withheld_flag&) { v = r.get_withheld_flag(); } - void get_value(const LASpoint& r, float& v, LAS_property::Scan_angle&) + inline void get_value(const LASpoint& r, float& v, LAS_property::Scan_angle&) { v = r.get_scan_angle(); } - void get_value(const LASpoint& r, unsigned char& v, LAS_property::User_data&) + inline void get_value(const LASpoint& r, unsigned char& v, LAS_property::User_data&) { v = r.get_user_data(); } - void get_value(const LASpoint& r, unsigned short& v, LAS_property::Point_source_ID&) + inline void get_value(const LASpoint& r, unsigned short& v, LAS_property::Point_source_ID&) { v = r.get_point_source_ID(); } - void get_value(const LASpoint& r, unsigned int& v, LAS_property::Deleted_flag&) + inline void get_value(const LASpoint& r, unsigned int& v, LAS_property::Deleted_flag&) { v = r.get_deleted_flag(); } - void get_value(const LASpoint& r, double& v, LAS_property::GPS_time&) + inline void get_value(const LASpoint& r, double& v, LAS_property::GPS_time&) { v = r.get_gps_time(); } - void get_value(const LASpoint& r, unsigned short& v, LAS_property::R&) + inline void get_value(const LASpoint& r, unsigned short& v, LAS_property::R&) { v = r.get_R(); } - void get_value(const LASpoint& r, unsigned short& v, LAS_property::G&) + inline void get_value(const LASpoint& r, unsigned short& v, LAS_property::G&) { v = r.get_G(); } - void get_value(const LASpoint& r, unsigned short& v, LAS_property::B&) + inline void get_value(const LASpoint& r, unsigned short& v, LAS_property::B&) { v = r.get_B(); } - void get_value(const LASpoint& r, unsigned short& v, LAS_property::I&) + inline void get_value(const LASpoint& r, unsigned short& v, LAS_property::I&) { v = r.get_I(); } diff --git a/Point_set_processing_3/include/CGAL/IO/write_las_points.h b/Point_set_processing_3/include/CGAL/IO/write_las_points.h index 1d8e15cb85a..1354f91ac10 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_las_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_las_points.h @@ -92,41 +92,41 @@ namespace internal { namespace LAS { - void output_value(LASpoint& r, const unsigned short& v, LAS_property::Intensity&) + inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::Intensity&) { r.set_intensity(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Return_number&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Return_number&) { r.set_return_number(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Number_of_returns&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Number_of_returns&) { r.set_number_of_returns(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Scan_direction_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Scan_direction_flag&) { r.set_scan_direction_flag(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Edge_of_flight_line&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Edge_of_flight_line&) { r.set_edge_of_flight_line(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Classification&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Classification&) { r.set_classification(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Synthetic_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Synthetic_flag&) { r.set_synthetic_flag(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Keypoint_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Keypoint_flag&) { r.set_keypoint_flag(v); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::Withheld_flag&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::Withheld_flag&) { r.set_withheld_flag(v); } - void output_value(LASpoint& r, const float& v, LAS_property::Scan_angle&) + inline void output_value(LASpoint& r, const float& v, LAS_property::Scan_angle&) { r.set_scan_angle_rank(char(v)); } - void output_value(LASpoint& r, const unsigned char& v, LAS_property::User_data&) + inline void output_value(LASpoint& r, const unsigned char& v, LAS_property::User_data&) { r.set_user_data(v); } - void output_value(LASpoint& r, const unsigned short& v, LAS_property::Point_source_ID&) + inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::Point_source_ID&) { r.set_point_source_ID(v); } - void output_value(LASpoint& r, const unsigned int& v, LAS_property::Deleted_flag&) + inline void output_value(LASpoint& r, const unsigned int& v, LAS_property::Deleted_flag&) { r.set_deleted_flag(v); } - void output_value(LASpoint& r, const double& v, LAS_property::GPS_time&) + inline void output_value(LASpoint& r, const double& v, LAS_property::GPS_time&) { r.set_gps_time(v); } - void output_value(LASpoint& r, const unsigned short& v, LAS_property::R&) + inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::R&) { r.set_R(v); } - void output_value(LASpoint& r, const unsigned short& v, LAS_property::G&) + inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::G&) { r.set_G(v); } - void output_value(LASpoint& r, const unsigned short& v, LAS_property::B&) + inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::B&) { r.set_B(v); } - void output_value(LASpoint& r, const unsigned short& v, LAS_property::I&) + inline void output_value(LASpoint& r, const unsigned short& v, LAS_property::I&) { r.set_I(v); } template diff --git a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h index 6da878abb1b..2333980e2c2 100644 --- a/Point_set_processing_3/include/CGAL/IO/write_ply_points.h +++ b/Point_set_processing_3/include/CGAL/IO/write_ply_points.h @@ -115,15 +115,15 @@ namespace internal { stream << "undefined_type"; } - template <> void property_header_type (std::ostream& stream) { stream << "char"; } - template <> void property_header_type (std::ostream& stream) { stream << "char"; } - template <> void property_header_type (std::ostream& stream) { stream << "uchar"; } - template <> void property_header_type (std::ostream& stream) { stream << "short"; } - template <> void property_header_type (std::ostream& stream) { stream << "ushort"; } - template <> void property_header_type (std::ostream& stream) { stream << "int"; } - template <> void property_header_type (std::ostream& stream) { stream << "uint"; } - template <> void property_header_type (std::ostream& stream) { stream << "float"; } - template <> void property_header_type (std::ostream& stream) { stream << "double"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "char"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "char"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "uchar"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "short"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "ushort"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "int"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "uint"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "float"; } + template <> inline void property_header_type (std::ostream& stream) { stream << "double"; } template void property_header (std::ostream& stream, const PLY_property& prop) @@ -216,9 +216,9 @@ namespace internal { template T no_char_character (const T& t) { return t; } - int no_char_character (const char& t) { return int(t); } - int no_char_character (const signed char& t) { return int(t); } - int no_char_character (const unsigned char& t) { return int(t); } + inline int no_char_character (const char& t) { return int(t); } + inline int no_char_character (const signed char& t) { return int(t); } + inline int no_char_character (const unsigned char& t) { return int(t); } template Date: Wed, 24 Jul 2019 10:35:36 +0200 Subject: [PATCH 11/13] Fix our usage of TBB and A lot of parts of CGAL use `` in conjunction with TBB. I have added the `find_package(Threads)` in `CGAL_target_use_TBB.cmake` for convenience. I have also restored FindTBB.cmake as a pure copy of https://github.com/Kitware/VTK/blob/master/CMake/FindTBB.cmake with that version: > c7249fed2e73ce25fbbc53363d9caf4ab5cc9195 > Author: Cory Quammen > Date: Thu Feb 14 23:21:09 2019 -0500 > > FindTBB: handle basic linker scripts > > TBB binaries may define libtbb.so as a linker script of the form > > INPUT(libtbb.so.2) > > Make FindTBB find the real .so file libtbb.so points to in such cases. > > Approach borrowed from vtk-m/CMake/VTKmDeviceAdapters.cmake on > suggestion from Robert Maynard. > > --- Installation/cmake/modules/CGAL_Common.cmake | 3 ++- Installation/cmake/modules/CGAL_target_use_TBB.cmake | 6 ++++-- Installation/cmake/modules/FindTBB.cmake | 3 --- Installation/lib/cmake/CGAL/CGALConfig.cmake | 2 ++ 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index 9ade617f663..59f8190136d 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -61,5 +61,6 @@ if( NOT CGAL_COMMON_FILE_INCLUDED ) # set use-file for Eigen3 (needed to have default solvers) set(EIGEN3_USE_FILE "UseEigen3") - + set(TBB_USE_FILE "UseTBB") + include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake) endif() diff --git a/Installation/cmake/modules/CGAL_target_use_TBB.cmake b/Installation/cmake/modules/CGAL_target_use_TBB.cmake index 23e9acd72f1..631ece6a286 100644 --- a/Installation/cmake/modules/CGAL_target_use_TBB.cmake +++ b/Installation/cmake/modules/CGAL_target_use_TBB.cmake @@ -4,7 +4,9 @@ endif() set(CGAL_target_use_TBB_included TRUE) function(CGAL_target_use_TBB target) - target_include_directories ( ${target} SYSTEM PUBLIC ${TBB_INCLUDE_DIRS} ) - target_link_libraries( ${target} PUBLIC ${TBB_LIBRARIES} ) + if(NOT TARGET Threads::Threads) + find_package(Threads REQUIRED) + endif() + target_link_libraries( ${target} PUBLIC TBB::tbb TBB::tbbmalloc Threads::Threads) target_compile_options( ${target} PUBLIC -DNOMINMAX -DCGAL_LINKED_WITH_TBB ) endfunction() diff --git a/Installation/cmake/modules/FindTBB.cmake b/Installation/cmake/modules/FindTBB.cmake index 5e7dc208df8..b1a3d884c65 100644 --- a/Installation/cmake/modules/FindTBB.cmake +++ b/Installation/cmake/modules/FindTBB.cmake @@ -419,6 +419,3 @@ if(NOT TBB_VERSION) TBB_COMPATIBLE_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}") endif() - -set(TBB_USE_FILE "UseTBB") -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake) diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index c2b0aed549d..630117e24ad 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -140,6 +140,8 @@ include(${CGAL_MODULES_DIR}/CGAL_TweakFindBoost.cmake) cgal_setup_module_path() set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) +set(TBB_USE_FILE "UseTBB") +include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake) include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake") cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h" From fbf163d2445c3f88e16a1c6b24e21eb5ca696a5d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 25 Jul 2019 16:13:08 +0200 Subject: [PATCH 12/13] Fix when CGAL_USE_FILE is not included --- Installation/cmake/modules/CGALConfig_binary.cmake.in | 1 + Installation/cmake/modules/CGALConfig_install.cmake.in | 1 + Installation/cmake/modules/CGAL_Common.cmake | 1 - Installation/cmake/modules/CGAL_target_use_TBB.cmake | 2 ++ 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index bbf0330bd08..44e54f8e356 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -180,6 +180,7 @@ set(CGAL_DISABLE_GMP "@CGAL_DISABLE_GMP@") include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) include(${CGAL_MODULES_DIR}/CGAL_TweakFindBoost.cmake) +include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake) # Temporary? Change the CMAKE module path cgal_setup_module_path() diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index a259e6c451a..420e68b0bc5 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -155,6 +155,7 @@ set(CGAL_DISABLE_GMP "@CGAL_DISABLE_GMP@") include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) include(${CGAL_MODULES_DIR}/CGAL_TweakFindBoost.cmake) +include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake) # Temporary? Change the CMAKE module path cgal_setup_module_path() diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index 59f8190136d..51967d5f6d5 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -61,6 +61,5 @@ if( NOT CGAL_COMMON_FILE_INCLUDED ) # set use-file for Eigen3 (needed to have default solvers) set(EIGEN3_USE_FILE "UseEigen3") - set(TBB_USE_FILE "UseTBB") include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake) endif() diff --git a/Installation/cmake/modules/CGAL_target_use_TBB.cmake b/Installation/cmake/modules/CGAL_target_use_TBB.cmake index 631ece6a286..76c41c4ec25 100644 --- a/Installation/cmake/modules/CGAL_target_use_TBB.cmake +++ b/Installation/cmake/modules/CGAL_target_use_TBB.cmake @@ -3,6 +3,8 @@ if (CGAL_target_use_TBB_included) endif() set(CGAL_target_use_TBB_included TRUE) +set(TBB_USE_FILE "UseTBB") + function(CGAL_target_use_TBB target) if(NOT TARGET Threads::Threads) find_package(Threads REQUIRED) From 5d47146cd6835111144230c61fb2f396d3e83b68 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 25 Jul 2019 16:14:50 +0200 Subject: [PATCH 13/13] Fix in header-only --- Installation/lib/cmake/CGAL/CGALConfig.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index 630117e24ad..7ad720efdf5 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -140,8 +140,7 @@ include(${CGAL_MODULES_DIR}/CGAL_TweakFindBoost.cmake) cgal_setup_module_path() set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake) -set(TBB_USE_FILE "UseTBB") -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_target_use_TBB.cmake) +include(${CGAL_MODULES_DIR}/CGAL_target_use_TBB.cmake) include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake") cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h"