generic: mostly build system cleanups

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2015-10-29 17:52:26 +02:00
parent a0dbbaabdf
commit 26a1b35e6c
7 changed files with 107 additions and 103 deletions

View file

@ -223,10 +223,6 @@ configure_file(config-compiler.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-compil
configure_file(config-pty.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-pty.h)
configure_file(kdemacros.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdemacros.h)
# these two calls here should go somewhere else, Alex
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
################# list the subdirectories #################
add_subdirectory( cmake )

View file

@ -80,11 +80,7 @@ check_symbol_exists(posix_madvise "sys/mman.h" HAVE_MADVISE)
check_symbol_exists(getgrouplist "unistd.h;grp.h" HAVE_GETGROUPLIST)# kdecore/fakes.c
check_function_exists(backtrace HAVE_BACKTRACE) # kdecore, kio
# This is broken on OSX 10.6 (succeeds but shouldn't do) and doesn't exist
# on previous versions so don't do the check on APPLE.
if(NOT APPLE)
check_function_exists(fdatasync HAVE_FDATASYNC) # kdecore, kate
endif(NOT APPLE)
check_function_exists(fdatasync HAVE_FDATASYNC) # kdecore, kate
check_function_exists(mmap HAVE_MMAP) # kdecore, khtml
check_function_exists(sendfile HAVE_SENDFILE) # kioslave
@ -104,6 +100,9 @@ if (HAVE___RES_INIT_IN_RESOLV_LIBRARY OR HAVE_RES_INIT_IN_RESOLV_LIBRARY)
set(HAVE_RESOLV_LIBRARY TRUE)
endif (HAVE___RES_INIT_IN_RESOLV_LIBRARY OR HAVE_RES_INIT_IN_RESOLV_LIBRARY)
check_library_exists(nsl gethostbyname "" HAVE_NSL_LIBRARY)
check_library_exists(socket connect "" HAVE_SOCKET_LIBRARY)
if (UNIX)
# for kdecore (kpty) & kdesu

View file

@ -593,9 +593,6 @@ if(WIN32 OR CYGWIN OR APPLE)
message(FATAL_ERROR "Windows/Cygwin/Apple is NOT supported.")
endif()
# setup default RPATH/install_name handling, it sets up to build with full
# RPATH. When installing, RPATH will be changed to the LIB_INSTALL_DIR
# and all link directories which are not inside the current build dir.
set(_KDE4_PLATFORM_INCLUDE_DIRS)
# add our LIB_INSTALL_DIR to the RPATH (but only when it is not one of the
@ -612,6 +609,8 @@ if("${_isSystemPlatformLibDir}" STREQUAL "-1"
set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
endif()
# add our LIB_INSTALL_DIR to the RPATH, also skip re-linking during install
set(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
@ -848,7 +847,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(KDE4_CXX_FPIE_FLAGS "-fPIE")
set(KDE4_PIE_LDFLAGS "-pie")
if (CMAKE_SYSTEM_NAME STREQUAL GNU)
if(CMAKE_SYSTEM_NAME STREQUAL GNU)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pthread")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pthread")
endif (CMAKE_SYSTEM_NAME STREQUAL GNU)
@ -947,8 +946,8 @@ if(NOT KDE4Internal_FIND_QUIETLY)
kde4_print_results()
endif()
#add the found Qt and KDE include directories to the current include path
#the ${KDE4_INCLUDE_DIR}/KDE directory is for forwarding includes, eg. #include <KMainWindow>
# add the found Qt and KDE include directories to the current include path
# the ${KDE4_INCLUDE_DIR}/KDE directory is for forwarding includes, eg. #include <KMainWindow>
set(KDE4_INCLUDES
${KDE4_INCLUDE_DIR}
${KDE4_INCLUDE_DIR}/KDE

View file

@ -11,13 +11,10 @@ include_directories(
)
macro_optional_find_package(MusicBrainz5)
macro_log_feature(MUSICBRAINZ5_FOUND
"MusicBrainz5"
"A library that provides access to metadata lookup on the MusicBrainz server"
"http://www.musicbrainz.org"
FALSE
""
"Music metadata lookup for KDE multimedia applications through libkcddb. You need version 5.x of libmusicbrainz"
set_package_properties(MusicBrainz5 PROPERTIES
DESCRIPTION "A library that provides access to metadata lookup on the MusicBrainz server"
URL "http://www.musicbrainz.org"
PURPOSE "Music metadata lookup for KDE multimedia applications through libkcddb. You need version 5.x of libmusicbrainz"
)
if(MUSICBRAINZ5_FOUND)

View file

@ -24,29 +24,27 @@
PROJECT(libkexiv2)
FIND_PACKAGE(KDE4Internal REQUIRED 4.14.3)
ADD_DEFINITIONS(
${QT_DEFINITIONS}
${QT_QTDBUS_DEFINITIONS}
${KDE4_DEFINITIONS}
-DKDE_DEFAULT_DEBUG_AREA=51003
)
INCLUDE_DIRECTORIES(
${QDBUS_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
${KDE4_KDECORE_INCLUDES}
${KDE4_KDEUI_INCLUDES}
)
INCLUDE(KDE4Defaults)
INCLUDE(MacroLibrary)
INCLUDE(MacroOptionalAddSubdirectory)
INCLUDE(MacroOptionalFindPackage)
INCLUDE(FindPackageHandleStandardArgs)
ADD_DEFINITIONS (${QT_DEFINITIONS} ${QT_QTDBUS_DEFINITIONS} ${KDE4_DEFINITIONS})
INCLUDE_DIRECTORIES (${QDBUS_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}
${CMAKE_BINARY_DIR}
${KDE4_INCLUDES}
${KDE4_KDECORE_INCLUDES}
${KDE4_KDEUI_INCLUDES})
SET(LIBKEXIV2_AREA_CODE_GENERAL 51003)
ADD_DEFINITIONS(-DKDE_DEFAULT_DEBUG_AREA=${LIBKEXIV2_AREA_CODE_GENERAL})
SET(EXIV2_MIN_VERSION "0.21")
FIND_PACKAGE(Exiv2)
MACRO_LOG_FEATURE(EXIV2_FOUND "Exiv2" "Required to build libkexiv2." "http://www.exiv2.org"
TRUE ${EXIV2_MIN_VERSION} "")
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.
@ -57,14 +55,18 @@ SET(KEXIV2_LIB_SO_VERSION_STRING "${KDE_VERSION_MAJOR}.${KDE_VERSION_MINOR}.${KD
# =======================================================
IF(EXIV2_FOUND)
ADD_SUBDIRECTORY(libkexiv2)
ADD_SUBDIRECTORY(libkexiv2)
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()
if(ENABLE_TESTING)
add_subdirectory(tests)
endif()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/libkexiv2.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libkexiv2.pc)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libkexiv2.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig )
ENDIF(EXIV2_FOUND)
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/libkexiv2.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/libkexiv2.pc
)
INSTALL(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libkexiv2.pc
DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
)

View file

@ -127,27 +127,26 @@ set(solid_LIB_SRCS
backends/shared/cpufeatures.cpp
)
macro_optional_find_package( HUpnp )
macro_optional_find_package( HUpnp VERSION "0.9")
set_package_properties(HUpnp PROPERTIES
URL "http://www.herqq.org"
PURPOSE "Allows Solid to provide information about UPnP devices on the network"
TYPE OPTIONAL
)
if(HUPNP_FOUND)
include_directories( ${HUPNP_INCLUDE_DIR} )
message(STATUS "Building Solid UPnP backend." )
set(solid_LIB_SRCS ${solid_LIB_SRCS}
backends/upnp/upnpdevice.cpp
backends/upnp/upnpdevicemanager.cpp
backends/upnp/upnpdeviceinterface.cpp
backends/upnp/upnpmediaserver.cpp
backends/upnp/upnpinternetgateway.cpp
backends/upnp/upnpcontrolpoint.cpp
)
endif()
set(HUPNP_ENABLED FALSE CACHE BOOL "explicitly enable the compilation of the hupnp backend")
if (HUPNP_ENABLED AND HUPNP_FOUND AND ((HUPNP_VERSION_MAJOR EQUAL 0 AND HUPNP_VERSION_MINOR EQUAL 9) OR (HUPNP_VERSION_MAJOR EQUAL 1)))
include_directories( ${HUPNP_INCLUDE_DIR} )
message(STATUS "Building Solid UPnP backend." )
set(solid_LIB_SRCS ${solid_LIB_SRCS}
backends/upnp/upnpdevice.cpp
backends/upnp/upnpdevicemanager.cpp
backends/upnp/upnpdeviceinterface.cpp
backends/upnp/upnpmediaserver.cpp
backends/upnp/upnpinternetgateway.cpp
backends/upnp/upnpcontrolpoint.cpp
)
else ()
if(NOT HUPNP_ENABLED)
message(STATUS "To have UPnP support, explicitly enable HUPNP_ENABLED in the cmake cache")
endif(NOT HUPNP_ENABLED)
set(HUPNP_FOUND false)
endif ()
macro_log_feature( HUPNP_FOUND "HUPnP" "UPnP support for Solid" "http://www.herqq.org" FALSE "" "Allows Solid to provide information about UPnP devices on the network" )
# message(STATUS "Building Solid KUPnP backend." )
# set(solid_LIB_SRCS ${solid_LIB_SRCS}
@ -164,23 +163,26 @@ macro_log_feature( HUPNP_FOUND "HUPnP" "UPnP support for Solid" "http://www.herq
# backends/kupnp/kupnpmanager.cpp
# )
macro_optional_find_package( UDev )
set_package_properties(UDev PROPERTIES DESCRIPTION "UDev support for Solid"
URL "http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"
TYPE OPTIONAL
PURPOSE "Allows Solid to use UDev to provide information about devices on Linux"
)
macro_optional_find_package(UDev)
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
)
############### prefer udisks2 over udisks
macro_optional_find_package( UDisks2 )
set_package_properties(UDisks2 PROPERTIES DESCRIPTION "UDisks2 support for Solid"
URL "http://www.freedesktop.org/wiki/Software/udisks/"
TYPE OPTIONAL
PURPOSE "Allows Solid to use UDisks2 to provide information about devices on Linux"
)
if ( UDISKS2_FOUND )
macro_optional_find_package(UDisks2)
set_package_properties(UDisks2 PROPERTIES
DESCRIPTION "UDisks2 support for Solid"
URL "http://www.freedesktop.org/wiki/Software/udisks/"
PURPOSE "Allows Solid to use UDisks2 to provide information about devices on Linux"
TYPE OPTIONAL
)
if(UDISKS2_FOUND )
set(WITH_SOLID_UDISKS2 ON)
else ()
else()
set(WITH_SOLID_UDISKS2 OFF)
endif()

View file

@ -7,29 +7,38 @@ include_directories(
# it is the same as FIND_PACKAGE(<name>) but additionally creates an OPTION(WITH_<name>)
# so the checking for the software can be disabled via ccmake or -DWITH_<name>=OFF
macro_optional_find_package(HSPELL)
set_package_properties(HSPELL PROPERTIES DESCRIPTION "Spell checking support for Hebrew"
URL "http://ivrix.org.il/projects/spell-checker/"
TYPE OPTIONAL
PURPOSE "Hebrew support can also be provided via Enchant, providing the correct Enchant backends are installed"
)
set_package_properties(HSPELL PROPERTIES
URL "http://ivrix.org.il/projects/spell-checker/"
TYPE OPTIONAL
PURPOSE "Spell checking support for Hebrew"
)
if (HSPELL_FOUND)
add_subdirectory( hspell )
endif (HSPELL_FOUND)
macro_optional_find_package(ENCHANT)
set_package_properties(ENCHANT PROPERTIES DESCRIPTION "Spell checking support via Enchant"
URL "http://www.abisource.com/projects/enchant/"
TYPE OPTIONAL
)
set_package_properties(ENCHANT PROPERTIES
DESCRIPTION "Spell checking support via Enchant"
URL "http://www.abisource.com/projects/enchant/"
TYPE OPTIONAL
)
if (ENCHANT_FOUND)
add_subdirectory( enchant )
endif (ENCHANT_FOUND)
if(ENCHANT_FOUND)
add_subdirectory(enchant)
endif()
#macro_optional_find_package(HUNSPELL)
#macro_log_feature(HUNSPELL_FOUND "Hunspell" "Spell checking support via Hunspell" "http://hunspell.sourceforge.net/" FALSE "" "This is not needed for spell checking if Enchant is provided or only Hebrew spell checking is required.")
#if (HUNSPELL_FOUND)
# add_subdirectory( hunspell )
#endif (HUNSPELL_FOUND)
# This is not needed for spell checking if Enchant is provided or only Hebrew
# spell checking is required
#
# macro_optional_find_package(HUNSPELL)
# set_package_properties(HUNSPELL PROPERTIES
# PURPOSE "Spell checking support via Hunspell"
# URL "http://hunspell.sourceforge.net/"
# TYPE OPTIONAL
# )
if (HUNSPELL_FOUND)
add_subdirectory( hunspell )
endif (HUNSPELL_FOUND)