Compare commits
No commits in common. "f4999a63a54d726a4c4e0bca45b740b310c9d941" and "26b6b1f902e69b852431c2e510adbfbb3dbe009b" have entirely different histories.
f4999a63a5
...
26b6b1f902
@ -1,11 +1,20 @@
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
project (nncmpp VERSION 0.9.0 LANGUAGES C)
|
||||
project (nncmpp C)
|
||||
cmake_minimum_required (VERSION 2.8.5)
|
||||
|
||||
# Moar warnings
|
||||
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
|
||||
set (wdisabled "-Wno-unused-function")
|
||||
set (wdisabled "-Wno-unused-function -Wno-implicit-fallthrough")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra ${wdisabled}")
|
||||
endif ()
|
||||
endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC)
|
||||
|
||||
# Version
|
||||
set (project_VERSION_MAJOR "0")
|
||||
set (project_VERSION_MINOR "9")
|
||||
set (project_VERSION_PATCH "0")
|
||||
|
||||
set (project_VERSION "${project_VERSION_MAJOR}")
|
||||
set (project_VERSION "${project_VERSION}.${project_VERSION_MINOR}")
|
||||
set (project_VERSION "${project_VERSION}.${project_VERSION_PATCH}")
|
||||
|
||||
# For custom modules
|
||||
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/liberty/cmake)
|
||||
@ -26,7 +35,7 @@ if (USE_SYSTEM_TERMO)
|
||||
if (NOT Termo_FOUND)
|
||||
message (FATAL_ERROR "System termo library not found")
|
||||
endif (NOT Termo_FOUND)
|
||||
else ()
|
||||
else (USE_SYSTEM_TERMO)
|
||||
add_subdirectory (termo EXCLUDE_FROM_ALL)
|
||||
# We don't have many good choices when we don't want to install it and want
|
||||
# to support older versions of CMake; this is a relatively clean approach
|
||||
@ -36,7 +45,7 @@ else ()
|
||||
get_directory_property (Termo_INCLUDE_DIRS
|
||||
DIRECTORY termo INCLUDE_DIRECTORIES)
|
||||
set (Termo_LIBRARIES termo-static)
|
||||
endif ()
|
||||
endif (USE_SYSTEM_TERMO)
|
||||
|
||||
include_directories (${Unistring_INCLUDE_DIRS}
|
||||
${Ncursesw_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS} ${curl_INCLUDE_DIRS})
|
||||
@ -47,12 +56,6 @@ include (CheckFunctionExists)
|
||||
set (CMAKE_REQUIRED_LIBRARIES ${Ncursesw_LIBRARIES})
|
||||
CHECK_FUNCTION_EXISTS ("resizeterm" HAVE_RESIZETERM)
|
||||
|
||||
if ("${CMAKE_SYSTEM_NAME}" MATCHES "BSD")
|
||||
# Need this for SIGWINCH in FreeBSD and OpenBSD respectively;
|
||||
# our POSIX version macros make it undefined
|
||||
add_definitions (-D__BSD_VISIBLE=1 -D_BSD_SOURCE=1)
|
||||
endif ()
|
||||
|
||||
# Generate a configuration file
|
||||
configure_file (${PROJECT_SOURCE_DIR}/config.h.in
|
||||
${PROJECT_BINARY_DIR}/config.h)
|
||||
@ -73,7 +76,7 @@ install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
|
||||
find_program (HELP2MAN_EXECUTABLE help2man)
|
||||
if (NOT HELP2MAN_EXECUTABLE)
|
||||
message (FATAL_ERROR "help2man not found")
|
||||
endif ()
|
||||
endif (NOT HELP2MAN_EXECUTABLE)
|
||||
|
||||
foreach (page ${PROJECT_NAME})
|
||||
set (page_output "${PROJECT_BINARY_DIR}/${page}.1")
|
||||
@ -83,7 +86,7 @@ foreach (page ${PROJECT_NAME})
|
||||
"${PROJECT_BINARY_DIR}/${page}" -o ${page_output}
|
||||
DEPENDS ${page}
|
||||
COMMENT "Generating man page for ${page}" VERBATIM)
|
||||
endforeach ()
|
||||
endforeach (page)
|
||||
|
||||
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
|
||||
|
||||
@ -91,20 +94,23 @@ foreach (page ${project_MAN_PAGES})
|
||||
string (REGEX MATCH "\\.([0-9])$" manpage_suffix "${page}")
|
||||
install (FILES "${page}"
|
||||
DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}")
|
||||
endforeach ()
|
||||
endforeach (page)
|
||||
|
||||
# CPack
|
||||
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "MPD client")
|
||||
set (CPACK_PACKAGE_VENDOR "Premysl Eric Janouch")
|
||||
set (CPACK_PACKAGE_CONTACT "Přemysl Eric Janouch <p@janouch.name>")
|
||||
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
|
||||
set (CPACK_PACKAGE_VERSION_MAJOR ${project_VERSION_MAJOR})
|
||||
set (CPACK_PACKAGE_VERSION_MINOR ${project_VERSION_MINOR})
|
||||
set (CPACK_PACKAGE_VERSION_PATCH ${project_VERSION_PATCH})
|
||||
set (CPACK_GENERATOR "TGZ;ZIP")
|
||||
set (CPACK_PACKAGE_FILE_NAME
|
||||
"${PROJECT_NAME}-${PROJECT_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||
"${PROJECT_NAME}-${project_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
|
||||
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${project_VERSION}")
|
||||
set (CPACK_SOURCE_GENERATOR "TGZ;ZIP")
|
||||
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git;/build;/CMakeLists.txt.user")
|
||||
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
|
||||
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${project_VERSION}")
|
||||
|
||||
set (CPACK_SET_DESTDIR TRUE)
|
||||
include (CPack)
|
||||
|
@ -43,6 +43,9 @@ Or you can try telling CMake to make a package for you. For Debian it is:
|
||||
$ cpack -G DEB
|
||||
# dpkg -i nncmpp-*.deb
|
||||
|
||||
Note that for versions of CMake before 2.8.9, you need to prefix `cpack` with
|
||||
`fakeroot` or file ownership will end up wrong.
|
||||
|
||||
Having the program installed, create a configuration file and run it.
|
||||
|
||||
Configuration
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define CONFIG_H
|
||||
|
||||
#define PROGRAM_NAME "${CMAKE_PROJECT_NAME}"
|
||||
#define PROGRAM_VERSION "${PROJECT_VERSION}"
|
||||
#define PROGRAM_VERSION "${project_VERSION}"
|
||||
|
||||
#cmakedefine HAVE_RESIZETERM
|
||||
|
||||
|
2
liberty
2
liberty
@ -1 +1 @@
|
||||
Subproject commit d71c47f8ce7aecdc4856630e9d73a48912be68c1
|
||||
Subproject commit e029aae1d3d1884ca868c3694bdec0456b3e8267
|
6
nncmpp.c
6
nncmpp.c
@ -744,12 +744,6 @@ static struct config_schema g_config_settings[] =
|
||||
{ .name = "root",
|
||||
.comment = "Where all the files MPD is playing are located",
|
||||
.type = CONFIG_ITEM_STRING },
|
||||
|
||||
// Disabling this minimises MPD traffic and has the following caveats:
|
||||
// - when MPD stalls on retrieving audio data, we keep ticking
|
||||
// - when the "play" succeeds in ACTION_MPD_REPLACE for the same item as
|
||||
// is currently playing, we do not reset g.song_elapsed (we could ask
|
||||
// for a response which feels racy, or rethink the mechanism there)
|
||||
{ .name = "poll_elapsed_time",
|
||||
.comment = "Whether to actively poll MPD for the elapsed time",
|
||||
.type = CONFIG_ITEM_BOOLEAN,
|
||||
|
2
termo
2
termo
@ -1 +1 @@
|
||||
Subproject commit f7912a8ce7bbf7f701b5217bbb3879b13b66cfe7
|
||||
Subproject commit 8c4e867760eb20e3cdf997a301c8f8672c01e380
|
Loading…
x
Reference in New Issue
Block a user