-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
110 lines (91 loc) · 4.16 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#[==========================================================================[
KMidimon - ALSA Sequencer based MIDI Monitor
Copyright (C) 2005-2024 Pedro Lopez-Cabanillas <[email protected]>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
#]==========================================================================]
cmake_minimum_required(VERSION 3.16)
project(kmidimon
VERSION 1.4.1
LANGUAGES CXX
DESCRIPTION "ALSA Sequencer based MIDI Monitor"
HOMEPAGE_URL "https://kmidimon.sourceforge.io/"
)
#set(PROJECT_RELEASE_DATE "December 25, 2023")
option(BUILD_DOCS "Process Markdown sources of man pages and help files" ON)
option(EMBED_TRANSLATIONS "Embed translations instead of installing" OFF)
option(USE_QT5 "Prefer building with Qt5 instead of Qt6" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_admin")
include(SCMRevision)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED Yes)
if (USE_QT5)
find_package(QT NAMES Qt5 REQUIRED)
find_package(Qt5 5.12 COMPONENTS Gui Widgets LinguistTools REQUIRED)
else()
find_package(QT NAMES Qt6 REQUIRED)
find_package(Qt6 6.2 COMPONENTS Gui Widgets LinguistTools Core5Compat REQUIRED)
endif()
if(QT_FOUND)
message(STATUS "Found Qt version: ${QT_VERSION}")
endif()
find_package(Drumstick 2.10 COMPONENTS ALSA File REQUIRED)
if(Drumstick_FOUND)
message(STATUS "Found Drumstick version: ${Drumstick_VERSION}")
endif()
message (STATUS "${PROJECT_NAME} v${PROJECT_VERSION}
install prefix: ${CMAKE_INSTALL_PREFIX}
Build configuration: ${CMAKE_BUILD_TYPE}
Processor: ${CMAKE_SYSTEM_PROCESSOR}
Qt: ${QT_VERSION}
Drumstick: ${Drumstick_VERSION}
Embed translations: ${EMBED_TRANSLATIONS}
Build docs: ${BUILD_DOCS}")
include(GNUInstallDirs)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wzero-as-null-pointer-constant -Wsuggest-override")
endif()
add_subdirectory(icons)
add_subdirectory(doc)
if(NOT EMBED_TRANSLATIONS)
add_subdirectory(translations)
endif()
add_subdirectory(src)
configure_file(
"${CMAKE_SOURCE_DIR}/kmidimon.spec.in"
"${CMAKE_SOURCE_DIR}/kmidimon.spec"
IMMEDIATE @ONLY)
configure_file(
"${CMAKE_SOURCE_DIR}/cmake_admin/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY
)
add_custom_target ( uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
add_custom_target ( tarball
COMMAND mkdir -p kmidimon-${PROJECT_VERSION}
COMMAND cp -r cmake_admin kmidimon-${PROJECT_VERSION}
COMMAND cp -r doc kmidimon-${PROJECT_VERSION}
COMMAND cp -r icons kmidimon-${PROJECT_VERSION}
COMMAND cp -r src kmidimon-${PROJECT_VERSION}
COMMAND cp -r translations kmidimon-${PROJECT_VERSION}
COMMAND cp CMakeLists.txt AUTHORS COPYING ChangeLog configure.* *.md *.ins *.spec* *.desktop *.lsm *.qrc *.pro *.pri *.xml kmidimon-${PROJECT_VERSION}
COMMAND tar -cj --exclude .svn --exclude *.old --exclude *~ -f kmidimon-${PROJECT_VERSION}.tar.bz2 kmidimon-${PROJECT_VERSION}
COMMAND tar -cz --exclude .svn --exclude *.old --exclude *~ -f kmidimon-${PROJECT_VERSION}.tar.gz kmidimon-${PROJECT_VERSION}
COMMAND rm -rf kmidimon-${PROJECT_VERSION}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
install( FILES net.sourceforge.kmidimon.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications )
install( FILES net.sourceforge.kmidimon.metainfo.xml
DESTINATION ${CMAKE_INSTALL_DATADIR}/metainfo )
install( FILES standards.ins
DESTINATION ${CMAKE_INSTALL_DATADIR}/kmidimon )