From 4e27faa236ae3ac8eeb603e638ae3db5f6ee027f Mon Sep 17 00:00:00 2001 From: tamasmeszaros Date: Tue, 17 Dec 2019 16:53:45 +0100 Subject: [PATCH] Only consider openvdb debug if necessary. Add REQUIRED to openvdb --- CMakeLists.txt | 3 +-- cmake/modules/FindOpenVDB.cmake | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f489e46c4..26619e459 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -409,8 +409,7 @@ if(SLIC3R_STATIC) set(USE_BLOSC TRUE) endif() - -find_package(OpenVDB 5.0 COMPONENTS openvdb) +find_package(OpenVDB 5.0 REQUIRED COMPONENTS openvdb) if(OpenVDB_FOUND) slic3r_remap_configs(IlmBase::Half RelWithDebInfo Release) endif() diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake index e000b05dd..84b5f4116 100644 --- a/cmake/modules/FindOpenVDB.cmake +++ b/cmake/modules/FindOpenVDB.cmake @@ -235,7 +235,9 @@ foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS}) if (_is_multi) list(APPEND OpenVDB_LIB_COMPONENTS ${OpenVDB_${COMPONENT}_LIBRARY_RELEASE} ${OpenVDB_${COMPONENT}_LIBRARY_DEBUG}) - if(OpenVDB_${COMPONENT}_LIBRARY_RELEASE AND ${OpenVDB_${COMPONENT}_LIBRARY_DEBUG}) + list(FIND CMAKE_CONFIGURATION_TYPES "Debug" _has_debug) + + if(OpenVDB_${COMPONENT}_LIBRARY_RELEASE AND (_has_debug LESS 0 OR OpenVDB_${COMPONENT}_LIBRARY_DEBUG)) set(OpenVDB_${COMPONENT}_FOUND TRUE) else() set(OpenVDB_${COMPONENT}_FOUND FALSE)