diff --git a/.gitmodules b/.gitmodules index e82ae2c11..6a826be5d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "linphone-sdk"] path = external/linphone-sdk - url = https://gitlab.linphone.org/BC/public/linphone-sdk.git \ No newline at end of file + url = https://gitlab.linphone.org/BC/public/linphone-sdk.git +[submodule "external/qtkeychain"] + path = external/qtkeychain + url = https://github.com/frankosterfeld/qtkeychain.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a55d10af4..51888ab72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,9 +185,9 @@ add_option(OPTION_LIST ENABLE_SCREENSHARING "Enable screen sharing." ${ENABLE_VI # QtKeychain add_option(OPTION_LIST LIBSECRET_SUPPORT "Build with libsecret support" OFF) # Need libsecret-devel if(WIN32) - add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name for a workaround with windeployqt" "EQt5Keychain") + add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt6Keychain library name for a workaround with windeployqt" "EQt6Keychain") else() - add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt5Keychain library name" "Qt5Keychain") + add_cache(OPTION_LIST QTKEYCHAIN_TARGET_NAME "Override Qt6Keychain library name" "Qt6Keychain") endif() if(WIN32) add_option(OPTION_LIST ENABLE_OPENSSL_EXPORT "Enable OpenSSL deployment" YES) @@ -206,7 +206,7 @@ set(ENABLE_CSHARP_WRAPPER OFF CACHE BOOL "Build the CSharp wrapper for Liblinpho set(ENABLE_THEORA OFF) set(ENABLE_QT_GL ${ENABLE_VIDEO}) -find_package(Qt6 REQUIRED COMPONENTS Core) +find_package(Qt6 REQUIRED COMPONENTS Core Widgets) if(NOT Qt6_FOUND) message(FATAL_ERROR "Minimum supported Qt6!") @@ -227,18 +227,11 @@ endif() if(NOT APPLE OR MONO_ARCH) add_custom_target(linphone-deps) if(NOT LINPHONE_QT_ONLY) - function(add_external) - set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # Prevent project from overriding the options we just set here - add_subdirectory("external") - endfunction() - add_external() - - if(ENABLE_QT_KEYCHAIN) - function(add_linphone_keychain) - #add_subdirectory("external/qtkeychain") - endfunction() - add_linphone_keychain() - endif() + function(add_external) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # Prevent project from overriding the options we just set here + add_subdirectory("external") + endfunction() + add_external() endif() function(add_linphone_app) set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) # Prevent project from overriding the options we just set here @@ -270,4 +263,16 @@ else() include(cmake/TasksMacos.cmake) endif() +if (ENABLE_QT_KEYCHAIN) + target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${PROJECT_SOURCE_DIR}/external/qtkeychain) + target_link_libraries(${TARGET_NAME} PUBLIC ${QTKEYCHAIN_TARGET_NAME}) + message(STATUS "link libraries: ${TARGET_NAME} ${QTKEYCHAIN_TARGET_NAME}") +endif() + +message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}") +message(STATUS "PROJECT_SOURCE_DIR: ${PROJECT_SOURCE_DIR}") +message(STATUS "Contents of qtkeychain:") +file(GLOB QTKEYCHAIN_HEADERS "${PROJECT_SOURCE_DIR}/external/qtkeychain/qtkeychain/*.h") +message(STATUS "Found headers: ${QTKEYCHAIN_HEADERS}") + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/hook/pre-commit" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/") diff --git a/Linphone/CMakeLists.txt b/Linphone/CMakeLists.txt index f693f59f7..837b9a195 100644 --- a/Linphone/CMakeLists.txt +++ b/Linphone/CMakeLists.txt @@ -19,7 +19,7 @@ endforeach() set(TARGET_NAME Linphone) set(APP_TARGETS ${LinphoneCxx_TARGET} ${Mediastreamer2_TARGET}#MediastreamerUtils - ${LibLinphone_TARGET})#MediastreamerUtils + ${LibLinphone_TARGET})#Liblinphone set(QT_DEFAULT_MAJOR_VERSION 6) set(QT_PACKAGES Core Quick Qml Widgets Svg Multimedia Test NetworkAuth Concurrent)# Search Core at first for initialize Qt scripts for next find_packages. diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index bec868965..c812204c1 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,2 +1,8 @@ add_subdirectory(linphone-sdk/) +if(ENABLE_QT_KEYCHAIN) + function(add_linphone_keychain) + add_subdirectory(qtkeychain/) + endfunction() + add_linphone_keychain() +endif() \ No newline at end of file diff --git a/external/qtkeychain b/external/qtkeychain new file mode 160000 index 000000000..35c4f4018 --- /dev/null +++ b/external/qtkeychain @@ -0,0 +1 @@ +Subproject commit 35c4f40186a6ac3260982256e846bb0774ea91de