From 9989c4858f4238fadbc1561c3a2d76d81d12e321 Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Fri, 24 Jan 2020 10:12:37 +0100 Subject: [PATCH] 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}" )