Skip to content

Commit 3d7a768

Browse files
Use versionless Qt cmake targets
1 parent 28efc22 commit 3d7a768

File tree

12 files changed

+12
-14
lines changed

12 files changed

+12
-14
lines changed

.github/workflows/dev-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [ubuntu-20.04, ubuntu-22.04]
15+
os: [ubuntu-22.04]
1616

1717
steps:
1818
- uses: actions/setup-node@v3

.github/workflows/prod-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
strategy:
1111
matrix:
12-
os: [ubuntu-20.04, ubuntu-22.04]
12+
os: [ubuntu-22.04]
1313

1414
steps:
1515
- uses: actions/setup-node@v3

CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ else()
127127
find_package(PkgConfig)
128128

129129
# Qt
130-
find_package(Qt5Core CONFIG REQUIRED)
131-
find_package(Qt5Widgets CONFIG REQUIRED)
132-
find_package(Qt5Network CONFIG REQUIRED)
130+
find_package(Qt5 5.15 REQUIRED COMPONENTS Core Widgets Network)
133131

134132
# libpcap
135133
if (NOT WIN32)

cmake/PackExternalDeps.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
function(pack_qt_libs)
33

4-
get_target_property(QT_CORE_LIB Qt5::Core LOCATION)
4+
get_target_property(QT_CORE_LIB Qt::Core LOCATION)
55
if (APPLE)
66
get_filename_component(CORE_FRAMEWORK_DIR "${QT_CORE_LIB}" DIRECTORY)
77
get_filename_component(QT_LIB_DIR "${CORE_FRAMEWORK_DIR}" DIRECTORY)

src/hobbits-core/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ target_include_directories(hobbits-core INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}")
2323
if (BUILDING_WITH_CONAN)
2424
set(ALL_LINK_LIBS CONAN_PKG::qt)
2525
else()
26-
set(ALL_LINK_LIBS Qt5::Core Qt5::Widgets)
26+
set(ALL_LINK_LIBS Qt::Core Qt::Widgets)
2727
endif()
2828

2929
target_link_libraries(hobbits-core ${ALL_LINK_LIBS})

src/hobbits-gui/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ file(GLOB RCFILES "${CMAKE_CURRENT_SOURCE_DIR}/*.qrc" "${CMAKE_CURRENT_SOURCE_DI
1919
if (BUILDING_WITH_CONAN)
2020
set(ALL_LINK_LIBS hobbits-python hobbits-widgets hobbits-core CONAN_PKG::qt)
2121
else()
22-
set(ALL_LINK_LIBS hobbits-python hobbits-widgets hobbits-core Qt5::Widgets)
22+
set(ALL_LINK_LIBS hobbits-python hobbits-widgets hobbits-core Qt::Widgets)
2323
endif()
2424

2525
add_executable(hobbits MACOSX_BUNDLE "${SRCFILES}" "${HDRFILES}" "${RCFILES}")

src/hobbits-plugins/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ macro(pluginInDir pluginType modName modDir)
1818
if (BUILDING_WITH_CONAN)
1919
set(ALL_LINK_LIBS hobbits-core hobbits-widgets CONAN_PKG::qt)
2020
else()
21-
set(ALL_LINK_LIBS hobbits-core hobbits-widgets Qt5::Core Qt5::Widgets)
21+
set(ALL_LINK_LIBS hobbits-core hobbits-widgets Qt::Core Qt::Widgets)
2222
endif()
2323

2424
target_link_libraries("${pluginName}" PRIVATE ${ALL_LINK_LIBS})
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
pluginInDir("${pluginType}" "HttpData" "${CMAKE_CURRENT_SOURCE_DIR}")
22

33
if (NOT BUILDING_WITH_CONAN)
4-
target_link_libraries("hobbits-plugin-importerexporters-HttpData" PRIVATE Qt5::Network)
4+
target_link_libraries("hobbits-plugin-importerexporters-HttpData" PRIVATE Qt::Network)
55
endif()
66

src/hobbits-plugins/importerexporters/PacketCapture/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if (NOT WIN32)
55
if (BUILDING_WITH_CONAN)
66
target_link_libraries("hobbits-plugin-importerexporters-PacketCapture" PRIVATE CONAN_PKG::libpcap)
77
else()
8-
target_link_libraries("hobbits-plugin-importerexporters-PacketCapture" PRIVATE ${PCAP_LIBRARY} Qt5::Network)
8+
target_link_libraries("hobbits-plugin-importerexporters-PacketCapture" PRIVATE ${PCAP_LIBRARY} Qt::Network)
99
endif()
1010

1111
endif()
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pluginInDir("${pluginType}" "TcpData" "${CMAKE_CURRENT_SOURCE_DIR}")
22

33
if (NOT BUILDING_WITH_CONAN)
4-
target_link_libraries("hobbits-plugin-importerexporters-TcpData" PRIVATE Qt5::Network)
4+
target_link_libraries("hobbits-plugin-importerexporters-TcpData" PRIVATE Qt::Network)
55
endif()
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pluginInDir("${pluginType}" "UdpData" "${CMAKE_CURRENT_SOURCE_DIR}")
22

33
if (NOT BUILDING_WITH_CONAN)
4-
target_link_libraries("hobbits-plugin-importerexporters-UdpData" PRIVATE Qt5::Network)
4+
target_link_libraries("hobbits-plugin-importerexporters-UdpData" PRIVATE Qt::Network)
55
endif()

src/hobbits-runner/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ add_executable("hobbits-runner" "${SRCFILES}" "${HDRFILES}" "${RCFILES}")
1919
if (BUILDING_WITH_CONAN)
2020
set(ALL_LINK_LIBS hobbits-python hobbits-widgets hobbits-core CONAN_PKG::qt)
2121
else()
22-
set(ALL_LINK_LIBS hobbits-python hobbits-widgets hobbits-core Qt5::Widgets)
22+
set(ALL_LINK_LIBS hobbits-python hobbits-widgets hobbits-core Qt::Widgets)
2323
endif()
2424

2525
target_link_libraries("hobbits-runner" ${ALL_LINK_LIBS})

0 commit comments

Comments
 (0)