Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt5Keychain: Map missing configuration to the first one. #10901

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2597,8 +2597,27 @@ option(QTKEYCHAIN "Secure credentials storage support for Live Broadcasting prof
if(QTKEYCHAIN)
find_package(Qt5Keychain REQUIRED)
target_compile_definitions(mixxx-lib PUBLIC __QTKEYCHAIN__)
target_link_libraries(mixxx-lib PRIVATE ${QTKEYCHAIN_LIBRARIES})
target_include_directories(mixxx-lib SYSTEM PUBLIC ${QTKEYCHAIN_INCLUDE_DIRS})
# If the current configuration is not found, using the first one.
# This matches the cmake implementation in cmTarget.cxx which is
# broken for some reasons on Ubuntu 22.04.
get_property(CONFIGS TARGET qt5keychain PROPERTY IMPORTED_CONFIGURATIONS)
string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
if (NOT "${BUILD_TYPE_UPPER}" IN_LIST CONFIGS)
if ("RELEASE" IN_LIST CONFIGS)
set_target_properties(qt5keychain PROPERTIES
MAP_IMPORTED_CONFIG_${BUILD_TYPE_UPPER} RELEASE
)
else()
foreach(c ${CONFIGS})
message(STATUS "qt5keychain: Map ${CMAKE_BUILD_TYPE} to configuration ${c}")
set_target_properties(qt5keychain PROPERTIES
MAP_IMPORTED_CONFIG_${BUILD_TYPE_UPPER} ${c}
)
break()
endforeach()
endif()
endif()
target_link_libraries(mixxx-lib PRIVATE qt5keychain)
endif()

# USB HID or/and Bulk controller support
Expand Down