Skip to content

Commit

Permalink
Merge pull request #4116 from Be-ing/upower_2.3
Browse files Browse the repository at this point in the history
backport Upower CMake check fix to 2.3 branch
  • Loading branch information
Holzhaus authored Jul 18, 2021
2 parents 782561c + 1db2fd1 commit 5a700ab
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2188,15 +2188,6 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(mixxx-lib PRIVATE Threads::Threads)

# Upower
if(UNIX AND NOT APPLE)
find_package(GLIB COMPONENTS gobject REQUIRED)
find_package(Upower REQUIRED)
target_include_directories(mixxx-lib SYSTEM PUBLIC ${GLIB_INCLUDE_DIRS})
target_link_libraries(mixxx-lib PRIVATE ${GLIB_LIBRARIES} ${GLIB_GOBJECT_LIBRARIES})
target_link_libraries(mixxx-lib PRIVATE Upower::Upower)
endif()

# iOS/OS X Frameworks
if(APPLE)
find_library(COREFOUNDATION_LIBRARY CoreFoundation REQUIRED)
Expand Down Expand Up @@ -2232,6 +2223,10 @@ if(BATTERY)
elseif(APPLE)
target_sources(mixxx-lib PRIVATE src/util/battery/batterymac.cpp)
elseif(UNIX)
find_package(Upower REQUIRED)
find_package(GLIB COMPONENTS gobject REQUIRED)
target_include_directories(mixxx-lib SYSTEM PUBLIC ${GLIB_INCLUDE_DIRS})
target_link_libraries(mixxx-lib PRIVATE Upower::Upower ${GLIB_LIBRARIES} ${GLIB_GOBJECT_LIBRARIES})
target_sources(mixxx-lib PRIVATE src/util/battery/batterylinux.cpp)
else()
message(FATAL_ERROR "Battery support is not implemented for the target platform.")
Expand Down

0 comments on commit 5a700ab

Please sign in to comment.