From 2ab4e9e18045c3fd7d57ee6c5f060320eab2aa04 Mon Sep 17 00:00:00 2001 From: reciprocal Date: Thu, 16 May 2024 16:29:06 +0200 Subject: [PATCH] 0033319: Coding - Static linking fails with unresolved symbols due to linking order and missing transitive dependencies The absence of target_link_libraries calls for static libraries caused CMake to fail in modeling the link dependencies correctly. This fix ensures that CMake correctly exports the dependencies in OpenCASCADEConfig.cmake and resolves downstream linking errors for projects that link against static OpenCASCADE libraries. --- adm/cmake/occt_toolkit.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adm/cmake/occt_toolkit.cmake b/adm/cmake/occt_toolkit.cmake index c9399159f1..ead767a844 100644 --- a/adm/cmake/occt_toolkit.cmake +++ b/adm/cmake/occt_toolkit.cmake @@ -479,8 +479,8 @@ if (BUILD_SHARED_LIBS OR EXECUTABLE_PROJECT) if(IS_VTK_9XX) string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}") endif() - target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}) endif() +target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT}) if (USE_QT) foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})