mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Add libvorbis (and ogg) dependency
This commit is contained in:
		
							parent
							
								
									3741ab1c91
								
							
						
					
					
						commit
						61198a46e7
					
				
					 7 changed files with 88 additions and 0 deletions
				
			
		|  | @ -133,6 +133,8 @@ if("${SRB2_CONFIG_SYSTEM_LIBRARIES}") | |||
| 	find_package(CURL REQUIRED) | ||||
| 	find_package(GME REQUIRED) | ||||
| 	find_package(VPX REQUIRED) | ||||
| 	find_package(Vorbis REQUIRED) | ||||
| 	find_package(VorbisEnc REQUIRED) | ||||
| endif() | ||||
| 
 | ||||
| if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) | ||||
|  |  | |||
							
								
								
									
										33
									
								
								cmake/Modules/FindVorbis.cmake
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								cmake/Modules/FindVorbis.cmake
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,33 @@ | |||
| include(LibFindMacros) | ||||
| 
 | ||||
| libfind_pkg_check_modules(Vorbis_PKGCONF Vorbis) | ||||
| 
 | ||||
| find_path(Vorbis_INCLUDE_DIR | ||||
| 	NAMES vorbis/codec.h | ||||
| 	PATHS | ||||
| 		${Vorbis_PKGCONF_INCLUDE_DIRS} | ||||
| 		"/usr/include" | ||||
| 		"/usr/local/include" | ||||
| ) | ||||
| 
 | ||||
| find_library(Vorbis_LIBRARY | ||||
| 	NAMES vorbis | ||||
| 	PATHS | ||||
| 		${Vorbis_PKGCONF_LIBRARY_DIRS} | ||||
| 		"/usr/lib" | ||||
| 		"/usr/local/lib" | ||||
| ) | ||||
| 
 | ||||
| set(Vorbis_PROCESS_INCLUDES Vorbis_INCLUDE_DIR) | ||||
| set(Vorbis_PROCESS_LIBS Vorbis_LIBRARY) | ||||
| libfind_process(Vorbis) | ||||
| 
 | ||||
| if(Vorbis_FOUND AND NOT TARGET Vorbis::vorbis) | ||||
| 	add_library(Vorbis::vorbis UNKNOWN IMPORTED) | ||||
| 	set_target_properties( | ||||
| 		Vorbis::vorbis | ||||
| 		PROPERTIES | ||||
| 		IMPORTED_LOCATION "${Vorbis_LIBRARY}" | ||||
| 		INTERFACE_INCLUDE_DIRECTORIES "${Vorbis_INCLUDE_DIR}" | ||||
| 	) | ||||
| endif() | ||||
							
								
								
									
										33
									
								
								cmake/Modules/FindVorbisEnc.cmake
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								cmake/Modules/FindVorbisEnc.cmake
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,33 @@ | |||
| include(LibFindMacros) | ||||
| 
 | ||||
| libfind_pkg_check_modules(VorbisEnc_PKGCONF VorbisEnc) | ||||
| 
 | ||||
| find_path(VorbisEnc_INCLUDE_DIR | ||||
| 	NAMES vorbis/vorbisenc.h | ||||
| 	PATHS | ||||
| 		${VorbisEnc_PKGCONF_INCLUDE_DIRS} | ||||
| 		"/usr/include" | ||||
| 		"/usr/local/include" | ||||
| ) | ||||
| 
 | ||||
| find_library(VorbisEnc_LIBRARY | ||||
| 	NAMES vorbisenc | ||||
| 	PATHS | ||||
| 		${VorbisEnc_PKGCONF_LIBRARY_DIRS} | ||||
| 		"/usr/lib" | ||||
| 		"/usr/local/lib" | ||||
| ) | ||||
| 
 | ||||
| set(VorbisEnc_PROCESS_INCLUDES VorbisEnc_INCLUDE_DIR) | ||||
| set(VorbisEnc_PROCESS_LIBS VorbisEnc_LIBRARY) | ||||
| libfind_process(VorbisEnc) | ||||
| 
 | ||||
| if(VorbisEnc_FOUND AND NOT TARGET Vorbis::vorbisenc) | ||||
| 	add_library(Vorbis::vorbisenc UNKNOWN IMPORTED) | ||||
| 	set_target_properties( | ||||
| 		Vorbis::vorbisenc | ||||
| 		PROPERTIES | ||||
| 		IMPORTED_LOCATION "${VorbisEnc_LIBRARY}" | ||||
| 		INTERFACE_INCLUDE_DIRECTORIES "${VorbisEnc_INCLUDE_DIR}" | ||||
| 	) | ||||
| endif() | ||||
|  | @ -231,6 +231,7 @@ target_link_libraries(SRB2SDL2 PRIVATE fmt) | |||
| target_link_libraries(SRB2SDL2 PRIVATE imgui::imgui) | ||||
| target_link_libraries(SRB2SDL2 PRIVATE webm::libwebm webm::libvpx) | ||||
| target_link_libraries(SRB2SDL2 PRIVATE libyuv::libyuv) | ||||
| target_link_libraries(SRB2SDL2 PRIVATE Vorbis::vorbis Vorbis::vorbisenc) | ||||
| 
 | ||||
| target_link_libraries(SRB2SDL2 PRIVATE acsvm) | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										2
									
								
								thirdparty/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								thirdparty/CMakeLists.txt
									
										
									
									
										vendored
									
									
								
							|  | @ -16,6 +16,8 @@ include("cpm-sdl2.cmake") | |||
| 	include("cpm-curl.cmake") | ||||
| 	include("cpm-libgme.cmake") | ||||
| 	include("cpm-libvpx.cmake") | ||||
| 	include("cpm-ogg.cmake") # libvorbis depends | ||||
| 	include("cpm-libvorbis.cmake") | ||||
| endif() | ||||
| 
 | ||||
| include("cpm-rapidjson.cmake") | ||||
|  |  | |||
							
								
								
									
										11
									
								
								thirdparty/cpm-libvorbis.cmake
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								thirdparty/cpm-libvorbis.cmake
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,11 @@ | |||
| CPMAddPackage( | ||||
| 	NAME vorbis | ||||
| 	VERSION 1.3.7 | ||||
| 	URL "https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.zip" | ||||
| 	EXCLUDE_FROM_ALL ON | ||||
| ) | ||||
| 
 | ||||
| if(vorbis_ADDED) | ||||
| 	add_library(Vorbis::vorbis ALIAS vorbis) | ||||
| 	add_library(Vorbis::vorbisenc ALIAS vorbisenc) | ||||
| endif() | ||||
							
								
								
									
										6
									
								
								thirdparty/cpm-ogg.cmake
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								thirdparty/cpm-ogg.cmake
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| CPMAddPackage( | ||||
| 	NAME ogg | ||||
| 	VERSION 1.3.5 | ||||
| 	URL "https://github.com/xiph/ogg/releases/download/v1.3.5/libogg-1.3.5.zip" | ||||
| 	EXCLUDE_FROM_ALL ON | ||||
| ) | ||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 James R
						James R