From 9989c4858f4238fadbc1561c3a2d76d81d12e321 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 24 Jan 2020 10:12:37 +0100 Subject: [PATCH 1/3] Fix missing atomic check from FindOpenVDB It has to be re-checked and added as needed to the imported target link-line SPE-1073 --- cmake/modules/FindOpenVDB.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake index 3e9e5f082..b56a7c3cc 100644 --- a/cmake/modules/FindOpenVDB.cmake +++ b/cmake/modules/FindOpenVDB.cmake @@ -518,12 +518,19 @@ list(REMOVE_DUPLICATES OpenVDB_LIBRARY_DIRS) foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS}) if(NOT TARGET OpenVDB::${COMPONENT}) + if (${COMPONENT} STREQUAL openvdb) + include (${CMAKE_CURRENT_LIST_DIR}/CheckAtomic.cmake) + set(_LINK_LIBS _OPENVDB_VISIBLE_DEPENDENCIES ${CMAKE_REQUIRED_LIBRARIES}) + else () + set(_LINK_LIBS _OPENVDB_VISIBLE_DEPENDENCIES) + endif () + add_library(OpenVDB::${COMPONENT} UNKNOWN IMPORTED) set_target_properties(OpenVDB::${COMPONENT} PROPERTIES INTERFACE_COMPILE_OPTIONS "${OpenVDB_DEFINITIONS}" INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_INCLUDE_DIR}" IMPORTED_LINK_DEPENDENT_LIBRARIES "${_OPENVDB_HIDDEN_DEPENDENCIES}" # non visible deps - INTERFACE_LINK_LIBRARIES "${_OPENVDB_VISIBLE_DEPENDENCIES}" # visible deps (headers) + INTERFACE_LINK_LIBRARIES "${_LINK_LIBS}" # visible deps (headers) INTERFACE_COMPILE_FEATURES cxx_std_11 IMPORTED_LOCATION "${OpenVDB_${COMPONENT}_LIBRARY}" ) From e05d38bdd0c44067f8b3e8791988ac0fd90a318b Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 24 Jan 2020 12:35:26 +0100 Subject: [PATCH 2/3] Fix the previous fix --- cmake/modules/FindOpenVDB.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake index b56a7c3cc..48f0d6655 100644 --- a/cmake/modules/FindOpenVDB.cmake +++ b/cmake/modules/FindOpenVDB.cmake @@ -520,7 +520,7 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS}) if(NOT TARGET OpenVDB::${COMPONENT}) if (${COMPONENT} STREQUAL openvdb) include (${CMAKE_CURRENT_LIST_DIR}/CheckAtomic.cmake) - set(_LINK_LIBS _OPENVDB_VISIBLE_DEPENDENCIES ${CMAKE_REQUIRED_LIBRARIES}) + set(_LINK_LIBS ${_OPENVDB_VISIBLE_DEPENDENCIES} ${CMAKE_REQUIRED_LIBRARIES}) else () set(_LINK_LIBS _OPENVDB_VISIBLE_DEPENDENCIES) endif () From c6a2b694195a7faa5e03081ba01e388e40a0637a Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 24 Jan 2020 13:41:37 +0100 Subject: [PATCH 3/3] 32 bit MSVC workaround for CGAL --- src/libslic3r/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/CMakeLists.txt b/src/libslic3r/CMakeLists.txt index 6d5b3e5f5..0bad50abe 100644 --- a/src/libslic3r/CMakeLists.txt +++ b/src/libslic3r/CMakeLists.txt @@ -233,12 +233,17 @@ cmake_policy(SET CMP0011 NEW) find_package(CGAL REQUIRED) cmake_policy(POP) +set(_cgal_defines "") +if (MSVC AND "${CMAKE_SIZEOF_VOID_P}" STREQUAL "4") # 32 bit MSVC workaround + set(_cgal_defines CGAL_DO_NOT_USE_MPZF) +endif () + add_library(libslic3r_cgal OBJECT MeshBoolean.cpp MeshBoolean.hpp) target_include_directories(libslic3r_cgal PRIVATE ${CMAKE_CURRENT_BINARY_DIR} $ $) -target_compile_definitions(libslic3r_cgal PRIVATE +target_compile_definitions(libslic3r_cgal PRIVATE ${_cgal_defines} $) target_compile_options(libslic3r_cgal PRIVATE $)