Skip to content

Commit

Permalink
fix: Fix build with qapt-qt6
Browse files Browse the repository at this point in the history
Use cmake to find the depend qapt-qt6 or qapt and link it.

Log: Fix build with qapt-qt6
  • Loading branch information
re2zero authored and deepin-bot[bot] committed Jan 7, 2025
1 parent e7d9048 commit 4e421f5
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ else()
endif()
message(" >>> Build with DTK: ${DTK_VERSION_MAJOR}")

if (QT_DESIRED_VERSION MATCHES 6)
find_package(QApt-qt6 REQUIRED)
include_directories(${QApt-qt6_INCLUDE_DIRS})
set(QAPT_LIB QApt-qt6)
else()
find_package(QApt REQUIRED)
include_directories(${QApt_INCLUDE_DIRS})
set(QAPT_LIB QApt)
endif()

add_subdirectory(src/AptInstallDepend)
add_subdirectory(src/deb-installer)

Expand Down
4 changes: 2 additions & 2 deletions src/deb-installer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ file(GLOB_RECURSE APP_SRCS
add_executable(${PROJECT_NAME} ${APP_SRCS} ${APP_QRC})

target_include_directories(${APP_BIN_NAME}
PUBLIC ${DtkWidget_INCLUDE_DIRS} ${OBJECT_BINARY_DIR})
PUBLIC ${OBJECT_BINARY_DIR})

target_link_libraries(${APP_BIN_NAME}
${LINK_LIBS}
QApt
${QAPT_LIB}
)
set(CMAKE_INSTALL_PREFIX /usr)

Expand Down
3 changes: 1 addition & 2 deletions src/deepin-deb-installer-dev/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ set(LINK_LIBS
Qt${QT_DESIRED_VERSION}::Core
Qt${QT_DESIRED_VERSION}::DBus
Qt${QT_DESIRED_VERSION}::Concurrent
QApt
)

include_directories(${CMAKE_CURRENT_LIST_DIR})
Expand All @@ -54,7 +53,7 @@ add_library( ${APP_BIN_NAME} SHARED ${APP_SRCS})
target_link_libraries(${APP_BIN_NAME}
PRIVATE
${LINK_LIBS}
QApt
${QAPT_LIB}
)

set(CMAKE_INSTALL_PREFIX /usr)
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ add_executable(${APP_BIN_NAME_TEST} ${APP_SRCS} ${APP_QRC} ${TEST_ACCESSIBLE_HEA
target_link_libraries(${APP_BIN_NAME_TEST}
PUBLIC
${LINK_LIBS}
QApt
${QAPT_LIB}
${GTEST_LIBRARIES}
${GTEST_MAIN_LIBRARIES}
pthread
Expand Down

0 comments on commit 4e421f5

Please sign in to comment.