Skip to content

Commit

Permalink
Only include Qt5Core once with CMake (issue #2147)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Oct 31, 2020
1 parent 53d685c commit 3b83069
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ if(USE_PCH)
include(cotire/CMake/cotire)
endif()

# Load Qt5Core here as it can only be included once (QTBUG-87863)
find_package(Qt5Core REQUIRED)

add_subdirectory(lib)
add_subdirectory(gui)
add_subdirectory(gui-qml)
Expand Down
1 change: 0 additions & 1 deletion src/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ project(cli)

add_definitions(-DCLI=1)

find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
set(QT_LIBRARIES Qt5::Core Qt5::Network)

Expand Down
1 change: 0 additions & 1 deletion src/crash-reporter/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
project(CrashReporter)

find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Widgets REQUIRED)
set(QT_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets)
Expand Down
1 change: 0 additions & 1 deletion src/e2e/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
project(e2e)

find_package(Qt5Core REQUIRED)
set(QT_LIBRARIES Qt5::Core)

file(GLOB_RECURSE SOURCES "src/*.cpp")
Expand Down
1 change: 0 additions & 1 deletion src/gui-qml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ add_definitions(-DGUI=1)
add_subdirectory(languages)

# Qt libraries
find_package(Qt5Core REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5Network REQUIRED)
set(QT_LIBRARIES Qt5::Core Qt5::Quick Qt5::Network)
Expand Down
1 change: 0 additions & 1 deletion src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ endif()

# Qt libraries
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Multimedia REQUIRED)
Expand Down
1 change: 0 additions & 1 deletion src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
project(lib)

find_package(Qt5Concurrent REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED) # For some classes such as QPixmap
find_package(Qt5Network REQUIRED)
find_package(Qt5Qml REQUIRED)
Expand Down
1 change: 0 additions & 1 deletion src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if(DEFINED HEADLESS)
add_definitions(-DHEADLESS=1)
endif()

find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5Test REQUIRED)
find_package(Qt5Widgets REQUIRED)
Expand Down

0 comments on commit 3b83069

Please sign in to comment.