From 6c6e8be43df2ce4427bdd0b944d507add51767fd Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Fri, 2 Oct 2026 20:46:24 +0800 Subject: [PATCH] Fix debug build cmake errors (#14593) * Fix debug build after qhull upgrade We upgraded qhull from 8.0.1 to 8.0.2 in 504a5d3b704fba8c0fac410cf9702f7bcf611f95, which contains a commit qhull/qhull@16159c648c36d79effbd537c1375b20e63398ed8 `use same CMake target name for Debug and non-Debug`, so this target name check is no longer required * Fix issue like `IMPORTED_LOCATION not set for imported target "opencv_world" configuration "RelWithDebInfo".` when build Debug config --- CMakeLists.txt | 4 +++- deps_src/qhull/CMakeLists.txt | 6 +----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 821d7e40c2..c431bff558 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -823,7 +823,9 @@ if(SLIC3R_STATIC) set(TBB_STATIC 1) endif() set(TBB_DEBUG 1) -set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release "") +if ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo" OR MSVC) + set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release "") +endif() find_package(TBB REQUIRED) # include_directories(SYSTEM ${TBB_INCLUDE_DIRS}) # add_definitions(${TBB_DEFINITIONS}) diff --git a/deps_src/qhull/CMakeLists.txt b/deps_src/qhull/CMakeLists.txt index 9cead64e2c..82a7bf627e 100644 --- a/deps_src/qhull/CMakeLists.txt +++ b/deps_src/qhull/CMakeLists.txt @@ -19,11 +19,7 @@ if(Qhull_FOUND) message(STATUS "Using qhull from system.") if(SLIC3R_STATIC) slic3r_remap_configs("Qhull::qhullcpp;Qhull::qhullstatic_r" RelWithDebInfo Release) - if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - target_link_libraries(qhull INTERFACE Qhull::qhullcpp_d Qhull::qhullstatic_rd) - else() - target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhullstatic_r) - endif() + target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhullstatic_r) else() slic3r_remap_configs("Qhull::qhullcpp;Qhull::qhull_r" RelWithDebInfo Release) target_link_libraries(qhull INTERFACE Qhull::qhullcpp Qhull::qhull_r)