cmake: Display package versions in summary
This commit is contained in:
parent
84da909b47
commit
fd2edfdc08
@ -7,19 +7,23 @@ find_package(CairoFC REQUIRED)
|
|||||||
|
|
||||||
if (ENABLE_ALSA)
|
if (ENABLE_ALSA)
|
||||||
find_package(ALSA REQUIRED)
|
find_package(ALSA REQUIRED)
|
||||||
|
set(ALSA_VERSION ${ALSA_VERSION_STRING})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_CURL)
|
if (ENABLE_CURL)
|
||||||
find_package(CURL REQUIRED)
|
find_package(CURL REQUIRED)
|
||||||
|
set(CURL_VERSION ${CURL_VERSION_STRING})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_MPD)
|
if (ENABLE_MPD)
|
||||||
find_package(LibMPDClient REQUIRED)
|
find_package(LibMPDClient REQUIRED)
|
||||||
|
set(MPD_VERSION ${LibMPDClient_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (ENABLE_NETWORK)
|
if (ENABLE_NETWORK)
|
||||||
if(WITH_LIBNL)
|
if(WITH_LIBNL)
|
||||||
find_package(LibNlGenl3 REQUIRED)
|
find_package(LibNlGenl3 REQUIRED)
|
||||||
|
set(NETWORK_LIBRARY_VERSION ${LibNlGenl3_VERSION})
|
||||||
else()
|
else()
|
||||||
find_package(Libiw REQUIRED)
|
find_package(Libiw REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
@ -27,10 +31,9 @@ endif()
|
|||||||
|
|
||||||
if (ENABLE_PULSEAUDIO)
|
if (ENABLE_PULSEAUDIO)
|
||||||
find_package(LibPulse REQUIRED)
|
find_package(LibPulse REQUIRED)
|
||||||
|
set(PULSEAUDIO_VERSION ${LibPulse_VERSION})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Randr is required
|
|
||||||
set(XORG_EXTENSIONS RANDR)
|
|
||||||
if (WITH_XCOMPOSITE)
|
if (WITH_XCOMPOSITE)
|
||||||
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} COMPOSITE)
|
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} COMPOSITE)
|
||||||
endif()
|
endif()
|
||||||
@ -44,12 +47,16 @@ if (WITH_XRM)
|
|||||||
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} XRM)
|
set(XORG_EXTENSIONS ${XORG_EXTENSIONS} XRM)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(XCB_VERSION "")
|
# Set min xrandr version required
|
||||||
if (WITH_XRANDR_MONITOR)
|
if (WITH_XRANDR_MONITORS)
|
||||||
set(XCB_VERSION "1.12")
|
set(XRANDR_VERSION "1.12")
|
||||||
|
else ()
|
||||||
|
set(XRANDR_VERSION "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Xcb ${XCB_VERSION} REQUIRED COMPONENTS ${XORG_EXTENSIONS})
|
# Randr is required
|
||||||
|
find_package(Xcb ${XRANDR_VERSION} REQUIRED COMPONENTS RANDR)
|
||||||
|
find_package(Xcb REQUIRED COMPONENTS ${XORG_EXTENSIONS})
|
||||||
|
|
||||||
# FreeBSD Support
|
# FreeBSD Support
|
||||||
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
||||||
|
@ -21,21 +21,21 @@ colored_option(" testsuite" BUILD_TESTS)
|
|||||||
colored_option(" documentation" BUILD_DOC)
|
colored_option(" documentation" BUILD_DOC)
|
||||||
|
|
||||||
message(STATUS " Module support:")
|
message(STATUS " Module support:")
|
||||||
colored_option(" alsa" ENABLE_ALSA)
|
colored_option(" alsa" ENABLE_ALSA ALSA_VERSION)
|
||||||
colored_option(" curl" ENABLE_CURL)
|
colored_option(" curl" ENABLE_CURL CURL_VERSION)
|
||||||
colored_option(" i3" ENABLE_I3)
|
colored_option(" i3" ENABLE_I3)
|
||||||
colored_option(" mpd" ENABLE_MPD)
|
colored_option(" mpd" ENABLE_MPD MPD_VERSION)
|
||||||
colored_option(" network (${WIRELESS_LIB})" ENABLE_NETWORK)
|
colored_option(" network (${WIRELESS_LIB})" ENABLE_NETWORK NETWORK_LIBRARY_VERSION)
|
||||||
colored_option(" pulseaudio" ENABLE_PULSEAUDIO)
|
colored_option(" pulseaudio" ENABLE_PULSEAUDIO PULSEAUDIO_VERSION)
|
||||||
colored_option(" xkeyboard" WITH_XKB)
|
colored_option(" xkeyboard" WITH_XKB Xcb_XKB_VERSION)
|
||||||
|
|
||||||
message(STATUS " X extensions:")
|
message(STATUS " X extensions:")
|
||||||
colored_option(" xcb-randr" WITH_XRANDR)
|
colored_option(" xcb-randr" WITH_XRANDR Xcb_RANDR_VERSION)
|
||||||
colored_option(" xcb-randr (monitor support)" WITH_XRANDR_MONITORS)
|
colored_option(" xcb-randr (monitor support)" WITH_XRANDR_MONITORS Xcb_RANDR_VERSION)
|
||||||
colored_option(" xcb-composite" WITH_XCOMPOSITE)
|
colored_option(" xcb-composite" WITH_XCOMPOSITE Xcb_COMPOSITE_VERSION)
|
||||||
colored_option(" xcb-xkb" WITH_XKB)
|
colored_option(" xcb-xkb" WITH_XKB Xcb_XKB_VERSION)
|
||||||
colored_option(" xcb-xrm" WITH_XRM)
|
colored_option(" xcb-xrm" WITH_XRM Xcb_XRM_VERSION)
|
||||||
colored_option(" xcb-cursor" WITH_XCURSOR)
|
colored_option(" xcb-cursor" WITH_XCURSOR Xcb_CURSOR_VERSION)
|
||||||
|
|
||||||
message(STATUS " Log options:")
|
message(STATUS " Log options:")
|
||||||
colored_option(" Trace logging" DEBUG_LOGGER)
|
colored_option(" Trace logging" DEBUG_LOGGER)
|
||||||
|
@ -13,11 +13,8 @@ endfunction()
|
|||||||
# colored_option {{{
|
# colored_option {{{
|
||||||
|
|
||||||
function(colored_option text flag)
|
function(colored_option text flag)
|
||||||
# Append version of option, if ${flag}_VERSION is set
|
if(ARGC GREATER 2 AND NOT "${${ARGV2}}" STREQUAL "")
|
||||||
set(version ${${flag}_VERSION})
|
set(text "${text} (${${ARGV2}})")
|
||||||
|
|
||||||
if(NOT "${version}" STREQUAL "")
|
|
||||||
set(text "${text} (${version})")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${flag})
|
if(${flag})
|
||||||
@ -90,6 +87,7 @@ macro(find_package_impl pkg_config_name find_pkg_name header_to_find)
|
|||||||
set(${find_pkg_name}_INCLUDE_DIR ${PC_${find_pkg_name}_INCLUDE_DIRS})
|
set(${find_pkg_name}_INCLUDE_DIR ${PC_${find_pkg_name}_INCLUDE_DIRS})
|
||||||
set(${find_pkg_name}_INCLUDE_DIRS ${${find_pkg_name}_INCLUDE_DIR})
|
set(${find_pkg_name}_INCLUDE_DIRS ${${find_pkg_name}_INCLUDE_DIR})
|
||||||
set(${find_pkg_name}_LIBRARY ${PC_${find_pkg_name}_LIBRARIES})
|
set(${find_pkg_name}_LIBRARY ${PC_${find_pkg_name}_LIBRARIES})
|
||||||
|
set(${find_pkg_name}_VERSION ${PC_${find_pkg_name}_VERSION})
|
||||||
set(${find_pkg_name}_LIBRARIES ${${find_pkg_name}_LIBRARY})
|
set(${find_pkg_name}_LIBRARIES ${${find_pkg_name}_LIBRARY})
|
||||||
|
|
||||||
find_package_handle_standard_args(${find_pkg_name}
|
find_package_handle_standard_args(${find_pkg_name}
|
||||||
@ -97,7 +95,7 @@ macro(find_package_impl pkg_config_name find_pkg_name header_to_find)
|
|||||||
${find_pkg_name}_INCLUDE_DIRS
|
${find_pkg_name}_INCLUDE_DIRS
|
||||||
${find_pkg_name}_LIBRARIES
|
${find_pkg_name}_LIBRARIES
|
||||||
VERSION_VAR
|
VERSION_VAR
|
||||||
PC_${find_pkg_name}_VERSION
|
${find_pkg_name}_VERSION
|
||||||
)
|
)
|
||||||
|
|
||||||
mark_as_advanced(${find_pkg_name}_INCLUDE_DIR ${find_pkg_name}_LIBRARY)
|
mark_as_advanced(${find_pkg_name}_INCLUDE_DIR ${find_pkg_name}_LIBRARY)
|
||||||
|
Loading…
Reference in New Issue
Block a user