generic: move find_package() calls to top-level build file

reference:
https://github.com/fluxer/katana/issues/7

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-03-26 21:09:16 +02:00
parent 6e3132729e
commit e735f1fd50
8 changed files with 122 additions and 127 deletions

View file

@ -76,6 +76,25 @@ set_package_properties(ENCHANT PROPERTIES
PURPOSE "Spell checking support via Enchant"
)
find_package(Exiv2 0.21)
set_package_properties(Exiv2 PROPERTIES
DESCRIPTION "Image metadata library and tools"
URL "http://www.exiv2.org"
TYPE REQUIRED
PURPOSE "Required to build libkexiv2"
)
# NOTE: Libraw 0.16.x is prefered version to use because it's ported to Cmake
# with full features supported. Until libraw 0.16.0 is release (ends of 2013),
# we will support previous version (with limited support)
find_package(LibRaw 0.15)
set_package_properties(LibRaw PROPERTIES
DESCRIPTION "library that provides image Raw file demosaicing"
URL "http://www.libraw.org"
TYPE REQUIRED
PURPOSE "Required to build libkdcraw"
)
# optional features
if(X11_FOUND)
macro_bool_to_01(X11_XTest_FOUND HAVE_XTEST)
@ -144,6 +163,81 @@ set_package_properties(ACL
PURPOSE "KIO and KIO slaves"
)
macro_optional_find_package(Avahi)
set_package_properties(Avahi PROPERTIES
DESCRIPTION "Facilities for service discovery on a local network (DNSSD)"
URL "http://avahi.org"
TYPE OPTIONAL
PURPOSE "Either Avahi or DNSSD is required for KDE applications to make use of multicast DNS/DNS-SD service discovery"
)
macro_optional_find_package(DNSSD)
set_package_properties(DNSSD PROPERTIES
DESCRIPTION "Facilities for service discovery on a local network"
URL "http://avahi.org"
TYPE OPTIONAL
PURPOSE "Either Avahi or DNSSD is required for KDE applications to make use of multicast DNS/DNS-SD service discovery"
)
macro_optional_find_package(BZip2)
set_package_properties(BZip2 PROPERTIES
DESCRIPTION "Support for BZip2 compressed files and data streams"
URL "http://www.bzip.org"
TYPE RECOMMENDED
)
macro_optional_find_package(LibLZMA)
set_package_properties(LibLZMA PROPERTIES
DESCRIPTION "Support for xz compressed files and data streams"
URL "http://tukaani.org/xz/"
TYPE OPTIONAL
)
macro_optional_find_package(Jasper 2.0.20)
set_package_properties(Jasper PROPERTIES
URL "http://www.ece.uvic.ca/~mdadams/jasper"
PURPOSE "Support for JPEG-2000 images"
TYPE OPTIONAL
)
macro_optional_find_package(OpenEXR)
set_package_properties(OpenEXR PROPERTIES
URL "http://www.openexr.com"
PURPOSE "Support for OpenEXR images"
TYPE OPTIONAL
)
macro_optional_find_package(WebP)
set_package_properties(WebP PROPERTIES
DESCRIPTION "A new image format for the Web"
URL "https://developers.google.com/speed/webp"
TYPE OPTIONAL
)
macro_optional_find_package(GSSAPI)
set_package_properties(GSSAPI PROPERTIES
DESCRIPTION "Allows KIO to make use of certain HTTP authentication services"
URL "http://web.mit.edu/kerberos/www"
TYPE OPTIONAL
PURPOSE "A MIT or HEIMDAL flavor of GSSAPI can be used"
)
macro_optional_find_package(HUpnp)
set_package_properties(HUpnp PROPERTIES
URL "http://www.herqq.org"
PURPOSE "Allows Solid to provide information about UPnP devices on the network"
TYPE OPTIONAL
)
# v143+ required for udev_monitor_filter_add_match_subsystem_devtype()
macro_optional_find_package(UDev 143)
set_package_properties(UDev PROPERTIES
DESCRIPTION "UDev support for Solid"
URL "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
PURPOSE "Allows Solid to use UDev to provide information about devices on Linux"
TYPE OPTIONAL
)
################# configure checks and create the configured files #################
include(ConfigureChecks.cmake)
@ -296,8 +390,8 @@ install(
DESTINATION ${KDE4_INCLUDE_INSTALL_DIR}
)
# the following will be the correct locations once cmake has the improved
# FIND_PACKAGE(): ${SHARE_INSTALL_PREFIX}/cmake/KDE4)
# the path bellow will be the correct locations once FindKDE4Internal is no longer required:
# ${KDE4_SHARE_INSTALL_PREFIX}/cmake/KDE4
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/KDE4Config.cmake

View file

@ -1,14 +1,5 @@
project(dnssd)
macro_optional_find_package(Avahi)
macro_bool_to_01(AVAHI_FOUND HAVE_AVAHI)
set_package_properties(Avahi PROPERTIES
DESCRIPTION "Facilities for service discovery on a local network (DNSSD)"
URL "http://avahi.org"
TYPE OPTIONAL
PURPOSE "Either Avahi or DNSSD is required for KDE applications to make use of multicast DNS/DNS-SD service discovery"
)
include_directories( ${KDE4_KDECORE_INCLUDES} )
set(kdnssd_LIB_SRCS
@ -18,7 +9,7 @@ set(kdnssd_LIB_SRCS
)
kde4_add_kcfg_files(kdnssd_LIB_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/settings.kcfgc)
if(HAVE_AVAHI)
if(AVAHI_FOUND)
include_directories( ${AVAHI_INCLUDE_DIR} )
set(kdnssd_LIB_SRCS ${kdnssd_LIB_SRCS}
avahi-domainbrowser.cpp
@ -45,53 +36,40 @@ if(HAVE_AVAHI)
org.freedesktop.Avahi.ServiceTypeBrowser.xml
avahi_servicetypebrowser_interface
)
else(HAVE_AVAHI)
macro_optional_find_package(DNSSD)
macro_bool_to_01(DNSSD_FOUND HAVE_DNSSD)
set_package_properties(DNSSD PROPERTIES
DESCRIPTION "Facilities for service discovery on a local network"
URL "http://avahi.org"
TYPE OPTIONAL
PURPOSE "Either Avahi or DNSSD is required for KDE applications to make use of multicast DNS/DNS-SD service discovery"
elseif(DNSSD_FOUND)
include_directories( ${DNSSD_INCLUDE_DIR} )
set(kdnssd_LIB_SRCS ${kdnssd_LIB_SRCS}
mdnsd-domainbrowser.cpp
mdnsd-remoteservice.cpp
mdnsd-publicservice.cpp
mdnsd-responder.cpp
mdnsd-servicebrowser.cpp
mdnsd-servicetypebrowser.cpp
)
if(HAVE_DNSSD)
include_directories( ${DNSSD_INCLUDE_DIR} )
set(kdnssd_LIB_SRCS ${kdnssd_LIB_SRCS}
mdnsd-domainbrowser.cpp
mdnsd-remoteservice.cpp
mdnsd-publicservice.cpp
mdnsd-responder.cpp
mdnsd-servicebrowser.cpp
mdnsd-servicetypebrowser.cpp
)
else(HAVE_DNSSD)
set(kdnssd_LIB_SRCS ${kdnssd_LIB_SRCS}
dummy-domainbrowser.cpp
dummy-remoteservice.cpp
dummy-publicservice.cpp
dummy-servicebrowser.cpp
dummy-servicetypebrowser.cpp
)
endif(HAVE_DNSSD)
endif(HAVE_AVAHI)
else()
set(kdnssd_LIB_SRCS ${kdnssd_LIB_SRCS}
dummy-domainbrowser.cpp
dummy-remoteservice.cpp
dummy-publicservice.cpp
dummy-servicebrowser.cpp
dummy-servicetypebrowser.cpp
)
endif()
########### next target ###############
add_library(kdnssd ${LIBRARY_TYPE} ${kdnssd_LIB_SRCS})
if(HAVE_DNSSD)
target_link_libraries(kdnssd PRIVATE
${KDE4_KDECORE_LIBS}
${QT_QTNETWORK_LIBRARY}
)
if(DNSSD_FOUND)
target_link_libraries(kdnssd PRIVATE
${KDE4_KDECORE_LIBS}
${DNSSD_LIBRARIES}
${QT_QTNETWORK_LIBRARY}
)
else(HAVE_DNSSD)
target_link_libraries(kdnssd PRIVATE
${KDE4_KDECORE_LIBS}
${QT_QTNETWORK_LIBRARY}
)
endif(HAVE_DNSSD)
endif()
target_link_libraries(kdnssd PUBLIC kdecore ${QT_QTCORE_LIBRARY} )

View file

@ -24,17 +24,6 @@
PROJECT(libkdcraw)
# NOTE: Libraw 0.16.x is prefered version to use because it's ported to Cmake
# with full features supported. Until libraw 0.16.0 is release (ends of 2013),
# we will support previous version (with limited support)
FIND_PACKAGE(LibRaw 0.15 REQUIRED)
SET_PACKAGE_PROPERTIES(LibRaw PROPERTIES
DESCRIPTION "library that provides image Raw file demosaicing"
URL "http://www.libraw.org"
TYPE REQUIRED
PURPOSE "Required to build libkdcraw"
)
IF(EXISTS "${LIBRAW_INCLUDE_DIR}/libraw_config.h")
ADD_DEFINITIONS(-DLIBRAW_HAS_CONFIG)
MESSAGE(STATUS "LibRaw config file exists: yes")

View file

@ -1,17 +1,3 @@
macro_optional_find_package(BZip2)
set_package_properties(BZip2 PROPERTIES
DESCRIPTION "Support for BZip2 compressed files and data streams"
URL "http://www.bzip.org"
TYPE RECOMMENDED
)
macro_optional_find_package(LibLZMA)
set_package_properties(LibLZMA PROPERTIES
DESCRIPTION "Support for xz compressed files and data streams"
URL "http://tukaani.org/xz/"
TYPE OPTIONAL
)
macro_bool_to_01(BZIP2_FOUND HAVE_BZIP2_SUPPORT)
if(BZIP2_FOUND AND BZIP2_NEED_PREFIX)
set(NEED_BZ2_PREFIX 1)

View file

@ -39,13 +39,6 @@ include_directories(
${KDE4_KDEUI_INCLUDES}
)
find_package(Exiv2 REQUIRED VERSION "0.21")
set_package_properties(Exiv2 PROPERTIES
DESCRIPTION "Image metadata library and tools"
URL "http://www.exiv2.org"
PURPOSE "Required to build libkexiv2"
)
# =======================================================
# Set env. variables accordinly.

View file

@ -1,26 +1,5 @@
project(kimgio)
macro_optional_find_package(Jasper 2.0.20)
set_package_properties(Jasper PROPERTIES
URL "http://www.ece.uvic.ca/~mdadams/jasper"
PURPOSE "Support for JPEG-2000 images"
TYPE OPTIONAL
)
macro_optional_find_package(OpenEXR)
set_package_properties(OpenEXR PROPERTIES
URL "http://www.openexr.com"
PURPOSE "Support for OpenEXR images"
TYPE OPTIONAL
)
macro_optional_find_package(WebP)
set_package_properties(WebP PROPERTIES
DESCRIPTION "A new image format for the Web"
URL "https://developers.google.com/speed/webp"
TYPE OPTIONAL
)
include_directories(${KDE4_KDEUI_INCLUDES})
##################################

View file

@ -1,13 +1,5 @@
project(kioslave-http)
macro_optional_find_package(GSSAPI)
set_package_properties(GSSAPI PROPERTIES
DESCRIPTION "Allows KIO to make use of certain HTTP authentication services"
URL "http://web.mit.edu/kerberos/www"
TYPE OPTIONAL
PURPOSE "A MIT or HEIMDAL flavor of GSSAPI can be used"
)
if(GSSAPI_FOUND)
set(HAVE_LIBGSSAPI 1)
if(GSSAPI_FLAVOR STREQUAL "MIT")

View file

@ -106,22 +106,6 @@ set(solid_LIB_SRCS
backends/fstab/fstabwatcher.cpp
)
macro_optional_find_package(HUpnp)
set_package_properties(HUpnp PROPERTIES
URL "http://www.herqq.org"
PURPOSE "Allows Solid to provide information about UPnP devices on the network"
TYPE OPTIONAL
)
# v143+ required for udev_monitor_filter_add_match_subsystem_devtype()
macro_optional_find_package(UDev 143)
set_package_properties(UDev PROPERTIES
DESCRIPTION "UDev support for Solid"
URL "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
PURPOSE "Allows Solid to use UDev to provide information about devices on Linux"
TYPE OPTIONAL
)
configure_file(
config-solid.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-solid.h