Skip to content

Commit

Permalink
Merge pull request #3750 from Holzhaus/cmake-3.20-qrc-fix
Browse files Browse the repository at this point in the history
CMake: Fix Qt resource files with CMake 3.20
  • Loading branch information
uklotzde authored Mar 27, 2021
2 parents 25f342e + 0422d67 commit 0716ff2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1612,15 +1612,14 @@ add_dependencies(mixxx-test mixxx-testdata)
#
# Resources
#
add_library(mixxx-qrc OBJECT EXCLUDE_FROM_ALL res/mixxx.qrc)
set_target_properties(mixxx-qrc PROPERTIES AUTORCC ON)

# Add resources to mixxx and mixxx-test binaries, not the mixxx-lib static
# library. Doing this would require initialization using Q_INIT_RESOURCE()
# calls that are not present at the moment. Further information can be found
# at: https://doc.qt.io/qt5/resources.html#using-resources-in-a-library
target_sources(mixxx PRIVATE $<TARGET_OBJECTS:mixxx-qrc>)
target_sources(mixxx-test PRIVATE $<TARGET_OBJECTS:mixxx-qrc>)
target_sources(mixxx PRIVATE res/mixxx.qrc)
set_target_properties(mixxx PROPERTIES AUTORCC ON)
target_sources(mixxx-test PRIVATE res/mixxx.qrc)
set_target_properties(mixxx-test PROPERTIES AUTORCC ON)

file(READ src/_version.h MIXXX_VERSION_FILECONTENT)
string(REGEX REPLACE "^.*#define MIXXX_VERSION \"(.*)\".*$" "\\1" MIXXX_VERSION "${MIXXX_VERSION_FILECONTENT}")
Expand Down

0 comments on commit 0716ff2

Please sign in to comment.