From 0931da2674795e9fda01a886856e81a2205a3b09 Mon Sep 17 00:00:00 2001 From: Ladislav Michl Date: Mon, 5 Aug 2024 21:50:12 +0200 Subject: [PATCH] cMake: Fix searching for pip installed package libraries Although this is a bit fragile way to search for package libraries it does the job. A more robust solution may be desirable. --- cMake/FreeCadMacros.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cMake/FreeCadMacros.cmake b/cMake/FreeCadMacros.cmake index f4f628e483..f5efcdefe6 100644 --- a/cMake/FreeCadMacros.cmake +++ b/cMake/FreeCadMacros.cmake @@ -302,8 +302,8 @@ macro(find_pip_package PACKAGE) file(GLOB OPT_LIBRARIES "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/${PIP_PACKAGE_NAME}.*.lib") file(GLOB DEBUG_LIBRARIES "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/${PIP_PACKAGE_NAME}_d.*.lib") else() - file(GLOB OPT_LIBRARIES "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/${PIP_PACKAGE_NAME}.*.so") - file(GLOB DEBUG_LIBRARIES "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/${PIP_PACKAGE_NAME}_d.*.so") + string(TOLOWER ${PIP_PACKAGE_NAME} PIP_LIB_NAME) + file(GLOB OPT_LIBRARIES "${PIP_PACKAGE_LOCATION}/${PIP_PACKAGE_NAME}/*${PIP_LIB_NAME}*.so.*") endif() if (OPT_LIBRARIES AND DEBUG_LIBRARIES) set(${PACKAGE}_LIBRARIES optimized ${OPT_LIBRARIES} debug ${DEBUG_LIBRARIES} CACHE PATH "") @@ -322,4 +322,4 @@ function(target_compile_warn_error ProjectName) if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX) target_compile_options(${ProjectName} PRIVATE -Werror) endif() -endfunction() \ No newline at end of file +endfunction()