From 5a11cfdf55017f236d819b838a203a96affab20b Mon Sep 17 00:00:00 2001 From: Ladislav Michl Date: Mon, 5 Aug 2024 17:09:12 +0200 Subject: [PATCH 1/2] cMake: Adjust to the new names of find_pip_package return variables Fixes: d01ce32a1f6d ("Update for LibPack3") --- cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake index d2c43e2e80..56262511cb 100644 --- a/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake +++ b/cMake/FreeCAD_Helpers/SetupShibokenAndPyside.cmake @@ -52,8 +52,8 @@ macro(SetupShibokenAndPyside) if(NOT SHIBOKEN_INCLUDE_DIR) find_pip_package(Shiboken${SHIBOKEN_MAJOR_VERSION}) if (Shiboken${SHIBOKEN_MAJOR_VERSION}_FOUND) - set(SHIBOKEN_INCLUDE_DIR ${Shiboken${SHIBOKEN_MAJOR_VERSION}_INCLUDE_DIR}) - set(SHIBOKEN_LIBRARY ${Shiboken${SHIBOKEN_MAJOR_VERSION}_LIBRARY}) + set(SHIBOKEN_INCLUDE_DIR ${Shiboken${SHIBOKEN_MAJOR_VERSION}_INCLUDE_DIRS}) + set(SHIBOKEN_LIBRARY ${Shiboken${SHIBOKEN_MAJOR_VERSION}_LIBRARIES}) endif() endif() @@ -66,8 +66,8 @@ macro(SetupShibokenAndPyside) if(NOT PYSIDE_INCLUDE_DIR) find_pip_package(PySide${PYSIDE_MAJOR_VERSION}) if (PySide${PYSIDE_MAJOR_VERSION}_FOUND) - set(PYSIDE_INCLUDE_DIR ${PySide${PYSIDE_MAJOR_VERSION}_INCLUDE_DIR}) - set(PYSIDE_LIBRARY ${PySide${PYSIDE_MAJOR_VERSION}_LIBRARY}) + set(PYSIDE_INCLUDE_DIR ${PySide${PYSIDE_MAJOR_VERSION}_INCLUDE_DIRS}) + set(PYSIDE_LIBRARY ${PySide${PYSIDE_MAJOR_VERSION}_LIBRARIES}) endif() endif() From 5b66e2bc91b90f82aadcd07198d26f67372e1c2f Mon Sep 17 00:00:00 2001 From: Ladislav Michl Date: Mon, 5 Aug 2024 21:50:12 +0200 Subject: [PATCH 2/2] 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()