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.
This commit is contained in:
Ladislav Michl
2024-08-05 21:50:12 +02:00
parent 5a11cfdf55
commit 5b66e2bc91

View File

@@ -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()
endfunction()