CMakeLists.txt 2.86 KB
Newer Older
1 2
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)

3 4
project(minuet)

5 6
# KDE Application Version, managed by release script
set (KDE_APPLICATIONS_VERSION_MAJOR "16")
Sandro Andrade's avatar
Sandro Andrade committed
7 8
set (KDE_APPLICATIONS_VERSION_MINOR "07")
set (KDE_APPLICATIONS_VERSION_MICRO "70")
Sandro Andrade's avatar
Sandro Andrade committed
9
#set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")
Sandro Andrade's avatar
Sandro Andrade committed
10
set (KDE_APPLICATIONS_VERSION "0.1.70")
11

12 13 14
set(ECM_MIN_VERSION "5.15.0")
set(QT_MIN_VERSION "5.4.0")
set(KF5_MIN_VERSION "5.15.0")
15 16

find_package(ECM ${ECM_MIN_VERSION} CONFIG REQUIRED)
17
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
18

19
include(ECMSetupVersion)
20 21 22
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECMakeSettings)
23
include(GenerateExportHeader)
24
include(KDECompilerSettings NO_POLICY_SCOPE)
25 26
include(FeatureSummary)

27
ecm_setup_version(${KDE_APPLICATIONS_VERSION} VARIABLE_PREFIX MINUET
28
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/app/minuet_version.h"
29 30
)

31 32 33 34 35 36
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
    Core
    Widgets
    Quick
#    Gui
)
37

38
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
39
    DocTools
40
    XmlGui
41 42 43 44
    I18n
    CoreAddons
    Completion
    WidgetsAddons
45
    KIO
Sandro Andrade's avatar
Sandro Andrade committed
46
    Crash
47 48
)

49 50 51 52 53 54
find_package(PkgConfig REQUIRED)
if(PKG_CONFIG_FOUND)
    message(STATUS "Program pkg-config found (${PKG_CONFIG_EXECUTABLE})")
else()
    message(FATAL_ERROR "Program pkg-config not found")
endif()
55

56 57 58 59 60 61 62 63 64
pkg_check_modules(ALSA REQUIRED alsa>=1.0.0)
if(ALSA_FOUND)
    link_directories(${ALSA_LIBDIR})
    include_directories(${ALSA_INCLUDEDIR})
    #link_libraries(${ALSA_LIBRARIES})
else()
    message(FATAL_ERROR "Please install ALSA library and headers (libasound2)")
endif()

65
pkg_check_modules(DRUMSTICK_ALSA REQUIRED drumstick-alsa>=1.0.1)
66 67 68 69 70 71 72 73
if(DRUMSTICK_ALSA_FOUND)
    link_directories(${DRUMSTICK_ALSA_LIBDIR})
    include_directories(${DRUMSTICK_ALSA_INCLUDEDIR})
    #link_libraries(${DRUMSTICK_ALSA_LIBRARIES})
else()
    message(FATAL_ERROR "Please install drumstick libraries and headers (package drumstick-devel)")
endif()

74
pkg_check_modules(DRUMSTICK_FILE REQUIRED drumstick-file>=1.0.1)
75 76 77 78 79 80 81 82
if(DRUMSTICK_FILE_FOUND)
    link_directories(${DRUMSTICK_FILE_LIBDIR})
    include_directories(${DRUMSTICK_FILE_INCLUDEDIR})
    #link_libraries(${DRUMSTICK_FILE_LIBRARIES})
else()
    message(FATAL_ERROR "Please install drumstick libraries and headers (package drumstick-devel)")
endif()

83 84
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

85 86
include_directories(${minuet_SOURCE_DIR}/src/ ${minuet_BINARY_DIR}/src)

87 88 89
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(icons)
90
add_subdirectory(exercises)
Sandro Andrade's avatar
Sandro Andrade committed
91 92

install(FILES org.kde.minuet.appdata.xml DESTINATION ${SHARE_INSTALL_PREFIX}/appdata/)
93 94 95 96 97

install(EXPORT MinuetTargets
    DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/Minuet"
    NAMESPACE Minuet::
    FILE MinuetTargets.cmake)