Commit e5bd419c authored by Laurent Montel's avatar Laurent Montel 😁

Move to own directory

parent c02d10b8
cmake_minimum_required(VERSION 2.8.12)
project(Akonadi-Contact)
# ECM setup
find_package(ECM 0.0.12 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
set(KF5_VERSION "4.97.0")
ecm_setup_version(${KF5_VERSION} VARIABLE_PREFIX AKONADIKMIME
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake"
SOVERSION 5
)
########### Find packages ###########
find_package(KF5KDE4Support ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
if(${CMAKE_SOURCE_DIR} STREQUAL ${Akonadi-Contact_SOURCE_DIR})
find_package(KF5Akonadi CONFIG REQUIRED)
endif()
########### Targets ###########
add_subdirectory(src)
# TODO: Port tests
#add_subdirectory(tests)
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KF5AkonadiContact")
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5AkonadiContactConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5AkonadiContactConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(EXPORT KF5AkonadiContactTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5AkonadiContactTargets.cmake NAMESPACE KF5::)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/akonadi-contact_version.h
DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
)
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
endif()
@PACKAGE_INIT@
# Any changes in this ".cmake" file will be overwritten by CMake, the source is the ".cmake.in" file.
find_dependency(KF5AkonadiCore "@KF5_VERSION@")
find_dependency(KF5AkonadiWidgets "@KF5_VERSION@")
include("${CMAKE_CURRENT_LIST_DIR}/KF5AkonadiContactTargets.cmake")
# Turn exceptions on
kde_enable_exceptions()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${Boost_INCLUDE_DIR}
${CMAKE_BINARY_DIR}/kabc
${CMAKE_SOURCE_DIR}/kabc
${kcalcore_BINARY_DIR}
)
remove_definitions(-DQT_NO_CAST_FROM_BYTEARRAY)
find_package(Prison QUIET)
set_package_properties(Prison PROPERTIES DESCRIPTION "Prison" URL "http://projects.kde.org/prison" TYPE OPTIONAL PURPOSE "Needed to show mobile barcodes of your contacts")
......@@ -18,12 +13,9 @@ endif()
set( AKONADI_PHONE_DIAL_DEFAULT "UseSkype" )
set( AKONADI_SEND_SMS_DEFAULT "UseSkypeSms" )
add_subdirectory(tests)
add_subdirectory(kcm)
add_subdirectory(editor/im)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII ${KDE4_ENABLE_EXCEPTIONS}")
########### next target ###############
set(akonadicontact_actions_SRCS
......@@ -130,13 +122,25 @@ include_directories(
${CMAKE_BINARY_DIR}/akonadi
)
add_library(akonadi-contact ${LIBRARY_TYPE} ${akonadicontact_LIB_SRC})
add_library(KF5AkonadiContact ${akonadicontact_LIB_SRC})
generate_export_header(KF5AkonadiContact BASE_NAME akonadi-contact)
add_library(KF5::AkonadiContact ALIAS KF5AkonadiContact)
target_include_directories(KF5AkonadiContact INTERFACE "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/AkonadiContact;${Boost_INCLUDE_DIR}>")
generate_export_header(akonadi-contact
BASE_NAME akonadi_contact
EXPORT_FILE_NAME akonadi-contact_export.h
target_link_libraries(KF5AkonadiContact
KF5::AkonadiCore
KF5::AkonadiWidgets
KF5::KIOCore
kabc
kcalcore
kmime
kpimutils
)
if (KDE4_BUILD_TESTS)
set(AKONADI_CONTACT_TESTS_EXPORT AKONADI_CONTACT_EXPORT)
endif()
......@@ -151,32 +155,21 @@ configure_file(akonadi-contactprivate_export.h.in
"${CMAKE_CURRENT_BINARY_DIR}/akonadi-contactprivate_export.h"
)
target_link_libraries(akonadi-contact akonadi-kde
kabc
kcalcore
kmime
kpimutils
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${KDE4_PHONON_LIBS})
if(PRISON_FOUND)
target_link_libraries(akonadi-contact ${PRISON_LIBRARIES})
target_link_libraries(KF5AkonadiContact ${PRISON_LIBRARIES})
endif()
target_link_libraries(akonadi-contact LINK_INTERFACE_LIBRARIES
akonadi-kde
kabc
kcalcore
kmime
kpimutils
${KDE4_KDEUI_LIBS}
${KDE4_KIO_LIBS}
${KDE4_PHONON_LIBS})
set_target_properties(KF5AkonadiContact PROPERTIES
VERSION ${AKONADICONTACT_VERSION_STRING}
SOVERSION ${AKONADICONTACT_SOVERSION}
EXPORT_NAME AkonadiContact
)
set_target_properties(akonadi-contact PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION})
install(TARGETS
KF5AkonadiContact
EXPORT KF5AkonadiContactTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
)
install(TARGETS akonadi-contact EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES editor/pics/world.jpg DESTINATION ${DATA_INSTALL_DIR}/akonadi/contact/pics)
install(FILES editor/data/zone.tab DESTINATION ${DATA_INSTALL_DIR}/akonadi/contact/data)
install(FILES recentcontactscollections.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
......
Markdown is supported
0% or .