Compare commits
	
		
			6 Commits
		
	
	
		
			26b6b1f902
			...
			f4999a63a5
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f4999a63a5 | |||
| 33b4976d7a | |||
| df82357cfd | |||
| bd5152a9e7 | |||
| 322a60aa39 | |||
| e86f4b6908 | 
| @ -1,20 +1,11 @@ | ||||
| project (nncmpp C) | ||||
| cmake_minimum_required (VERSION 2.8.5) | ||||
| cmake_minimum_required (VERSION 3.0) | ||||
| project (nncmpp VERSION 0.9.0 LANGUAGES C) | ||||
| 
 | ||||
| # Moar warnings | ||||
| if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUCC) | ||||
| 	set (wdisabled "-Wno-unused-function -Wno-implicit-fallthrough") | ||||
| 	set (wdisabled "-Wno-unused-function") | ||||
| 	set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -Wall -Wextra ${wdisabled}") | ||||
| 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}") | ||||
| endif () | ||||
| 
 | ||||
| # For custom modules | ||||
| set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/liberty/cmake) | ||||
| @ -35,7 +26,7 @@ if (USE_SYSTEM_TERMO) | ||||
| 	if (NOT Termo_FOUND) | ||||
| 		message (FATAL_ERROR "System termo library not found") | ||||
| 	endif (NOT Termo_FOUND) | ||||
| else (USE_SYSTEM_TERMO) | ||||
| else () | ||||
| 	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 | ||||
| @ -45,7 +36,7 @@ else (USE_SYSTEM_TERMO) | ||||
| 	get_directory_property (Termo_INCLUDE_DIRS | ||||
| 		DIRECTORY termo INCLUDE_DIRECTORIES) | ||||
| 	set (Termo_LIBRARIES termo-static) | ||||
| endif (USE_SYSTEM_TERMO) | ||||
| endif () | ||||
| 
 | ||||
| include_directories (${Unistring_INCLUDE_DIRS} | ||||
| 	${Ncursesw_INCLUDE_DIRS} ${Termo_INCLUDE_DIRS} ${curl_INCLUDE_DIRS}) | ||||
| @ -56,6 +47,12 @@ 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) | ||||
| @ -76,7 +73,7 @@ install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) | ||||
| find_program (HELP2MAN_EXECUTABLE help2man) | ||||
| if (NOT HELP2MAN_EXECUTABLE) | ||||
| 	message (FATAL_ERROR "help2man not found") | ||||
| endif (NOT HELP2MAN_EXECUTABLE) | ||||
| endif () | ||||
| 
 | ||||
| foreach (page ${PROJECT_NAME}) | ||||
| 	set (page_output "${PROJECT_BINARY_DIR}/${page}.1") | ||||
| @ -86,7 +83,7 @@ foreach (page ${PROJECT_NAME}) | ||||
| 			"${PROJECT_BINARY_DIR}/${page}" -o ${page_output} | ||||
| 		DEPENDS ${page} | ||||
| 		COMMENT "Generating man page for ${page}" VERBATIM) | ||||
| endforeach (page) | ||||
| endforeach () | ||||
| 
 | ||||
| add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES}) | ||||
| 
 | ||||
| @ -94,23 +91,20 @@ 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 (page) | ||||
| endforeach () | ||||
| 
 | ||||
| # 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,9 +43,6 @@ 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 e029aae1d3d1884ca868c3694bdec0456b3e8267 | ||||
| Subproject commit d71c47f8ce7aecdc4856630e9d73a48912be68c1 | ||||
							
								
								
									
										6
									
								
								nncmpp.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								nncmpp.c
									
									
									
									
									
								
							| @ -744,6 +744,12 @@ 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 8c4e867760eb20e3cdf997a301c8f8672c01e380 | ||||
| Subproject commit f7912a8ce7bbf7f701b5217bbb3879b13b66cfe7 | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user