This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
CMakeLists.txt
159 lines (128 loc) · 5.27 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# define minimum cmake version
cmake_minimum_required(VERSION 3.0)
project( Guayadeque )
# Set Release type for builds where CMAKE_BUILD_TYPE is unset.
# This is usually a good default as this implictly enables
#
# CFLAGS = -O3 -DNDEBUG
#
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE "Release" )
ENDIF( NOT CMAKE_BUILD_TYPE )
# Adhere to GNU filesystem layout conventions
include( GNUInstallDirs )
MESSAGE( STATUS "Using install prefix ${CMAKE_INSTALL_PREFIX} ..." )
FIND_PACKAGE(PkgConfig)
SET( SEARCH_LIBS
/usr/lib
/usr/local/lib )
# [sl 2020-05-23] according to https://cmake.org/cmake/help/v3.0/module/FindwxWidgets.html
SET(wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
FIND_PACKAGE( wxWidgets COMPONENTS base core adv net html xml aui qa )
IF( NOT wxWidgets_FOUND)
MESSAGE( FATAL_ERROR "wxWidgets not found!" )
ENDIF( NOT wxWidgets_FOUND)
PKG_CHECK_MODULES( GSTREAMER REQUIRED gstreamer-1.0 )
PKG_CHECK_MODULES( GSTREAMER REQUIRED gstreamer-pbutils-1.0 )
PKG_CHECK_MODULES( GSTREAMER_TAG REQUIRED gstreamer-tag-1.0 )
PKG_CHECK_MODULES( SQLITE3 REQUIRED sqlite3 )
PKG_CHECK_MODULES( LIBCURL REQUIRED libcurl )
PKG_CHECK_MODULES( LIBTAG taglib>=1.6.4)
IF( NOT LIBTAG_FOUND )
PKG_CHECK_MODULES( LIBTAG taglib>=1.6.1)
IF( NOT LIBTAG_FOUND )
PKG_CHECK_MODULES( LIBTAG taglib>=1.6 )
IF( NOT LIBTAG_FOUND )
MESSAGE( FATAL_ERROR "taglib 1.6 not found!" )
ENDIF( NOT LIBTAG_FOUND )
ELSE( NOT LIBTAG_FOUND )
ADD_DEFINITIONS(-DTAGLIB_WITH_MP4_COVERS=1)
ENDIF( NOT LIBTAG_FOUND )
ELSE( NOT LIBTAG_FOUND )
ADD_DEFINITIONS(-DTAGLIB_WITH_MP4_COVERS=1)
ADD_DEFINITIONS(-DTAGLIB_WITH_APE_SUPPORT=1)
ENDIF( NOT LIBTAG_FOUND )
PKG_CHECK_MODULES( LIBDBUS REQUIRED dbus-1 )
PKG_CHECK_MODULES( LIBGDKPIXBUF20 REQUIRED gdk-pixbuf-2.0 )
PKG_CHECK_MODULES( LIBGIO REQUIRED gio-2.0 )
OPTION( ENABLE_IPOD "Enable iPod support by including libgpod support" ON )
IF( ENABLE_IPOD )
PKG_CHECK_MODULES( LIBGPOD libgpod-1.0 )
IF( NOT LIBGPOD_FOUND )
MESSAGE( " libgpod-dev not found! No iPod support!!" )
ELSE( NOT LIBGPOD_FOUND )
ADD_DEFINITIONS(-DWITH_LIBGPOD_SUPPORT=1)
ENDIF( NOT LIBGPOD_FOUND )
ENDIF( ENABLE_IPOD )
PKG_CHECK_MODULES( LIBWXSQLITE3 wxsqlite3 )
IF( NOT LIBWXSQLITE3_FOUND )
PKG_CHECK_MODULES( LIBWXSQLITE330 wxsqlite3-3.0 )
IF( NOT LIBWXSQLITE330_FOUND )
MESSAGE( FATAL_ERROR "wxSqlite3 not found" )
ENDIF( NOT LIBWXSQLITE330_FOUND )
ENDIF( NOT LIBWXSQLITE3_FOUND )
PKG_CHECK_MODULES( LIBJSONCPP jsoncpp )
IF( NOT LIBJSONCPP_FOUND )
MESSAGE( FALTAL_ERROR "libjsoncpp not found" )
ENDIF( NOT LIBJSONCPP_FOUND )
# Include wxWidgets macros
INCLUDE(${wxWidgets_USE_FILE})
IF( NOT _GUREVISION_ )
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE _GUREVISION_
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ENDIF( NOT _GUREVISION_ )
# Make Version.h
CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in
${CMAKE_CURRENT_BINARY_DIR}/Version.h )
#
#ADD_DEFINITIONS(${wxWidgets_DEFINITIONS})
ADD_COMPILE_OPTIONS( -Wall )
ADD_DEFINITIONS( -DDATADIR=\"${CMAKE_INSTALL_FULL_DATADIR}/guayadeque\" -DDATAROOTDIR=\"${CMAKE_INSTALL_FULL_DATAROOTDIR}\" )
# We define the include paths here, our minimal source dir is one,
# and also the include dirs defined by wxWidgets
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${wxWidgets_INCLUDE_DIRS}
${GSTREAMER_INCLUDE_DIRS}
${GSTREAMER_TAG_INCLUDE_DIRS}
${SQLITE3_INCLUDE_DIRS}
${LIBCURL_INCLUDE_DIRS}
${LIBTAG_INCLUDE_DIRS}
${LIBDBUS_INCLUDE_DIRS}
${LIBGIO_INCLUDE_DIRS}
${LIBGPOD_INCLUDE_DIRS}
${LIBWXSQLITE3_INCLUDE_DIRS}
${LIBWXSQLITE330_INCLUDE_DIRS}
${LIBJSONCPP_INCLUDE_DIRS}
)
IF( PROFILE )
ADD_DEFINITIONS( -pg )
SET(CMAKE_EXE_LINKER_FLAGS "-pg -g")
MESSAGE( "Adding profiling code." )
ENDIF( PROFILE )
ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( po )
# default configuration and desktop icon
# freedesktop.org-specific files
INSTALL( FILES defconfig/guayadeque.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications )
INSTALL( FILES defconfig/guayadeque.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps )
INSTALL( FILES defconfig/guayadeque.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/appdata )
# program-specific files
INSTALL( FILES defconfig/guayadeque.default.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/guayadeque )
INSTALL( FILES defconfig/equalizers.default.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/guayadeque )
INSTALL( FILES defconfig/lyrics_sources.xml DESTINATION ${CMAKE_INSTALL_DATADIR}/guayadeque )
CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/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(debug
${CMAKE_COMMAND} -DMAKE_BUILD_TYPE:STRING=Debug ${PROJECT_SOURCE_DIR})
ADD_CUSTOM_TARGET(release
${CMAKE_COMMAND} -DMAKE_BUILD_TYPE:STRING=Release ${PROJECT_SOURCE_DIR})