Apply another patch by riebl to move detection of Ogg/Vorbis to the find_package module in a subdir
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10936 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
c1a43b42aa
commit
1ff469d1a6
@ -51,16 +51,6 @@ if(USE_WIIUSE)
|
|||||||
include_directories("${STK_SOURCE_DIR}/wiiuse")
|
include_directories("${STK_SOURCE_DIR}/wiiuse")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
|
||||||
# We could use smarter detection of the frameworks but supporting a single official setup makes things easy...
|
|
||||||
include_directories("/Library/Frameworks/Ogg.framework/Headers")
|
|
||||||
include_directories("/Library/Frameworks/Vorbis.framework/Headers")
|
|
||||||
include_directories("/usr/local/include")
|
|
||||||
include_directories("/usr/include")
|
|
||||||
find_library(Ogg /Library/Frameworks/Ogg.framework)
|
|
||||||
find_library(Vorbis /Library/Frameworks/Vorbis.framework)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Set lib paths
|
# Set lib paths
|
||||||
link_directories("${STK_SOURCE_DIR}/bullet")
|
link_directories("${STK_SOURCE_DIR}/bullet")
|
||||||
|
|
||||||
@ -73,18 +63,12 @@ find_package(OpenGL REQUIRED)
|
|||||||
include_directories(${OPENGL_INCLUDE_DIR})
|
include_directories(${OPENGL_INCLUDE_DIR})
|
||||||
|
|
||||||
# OpenAL
|
# OpenAL
|
||||||
if(APPLE)
|
find_package(OpenAL REQUIRED)
|
||||||
find_library(OpenAL /Library/Frameworks/OpenAL.framework)
|
include_directories(${OPENAL_INCLUDE_DIR})
|
||||||
else()
|
|
||||||
find_package(OpenAL)
|
# OggVorbis
|
||||||
|
find_package(OggVorbis REQUIRED)
|
||||||
if(OPENAL_FOUND)
|
include_directories(${OGGVORBIS_INCLUDE_DIRS})
|
||||||
message(STATUS "OpenAL found (include dir: ${OPENAL_INCLUDE_DIR})")
|
|
||||||
include_directories(${OPENAL_INCLUDE_DIR})
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "OpenAL not found.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# CURL
|
# CURL
|
||||||
find_package(CURL REQUIRED)
|
find_package(CURL REQUIRED)
|
||||||
@ -151,25 +135,19 @@ if (APPLE)
|
|||||||
# build the executable and create an app bundle
|
# build the executable and create an app bundle
|
||||||
add_executable(supertuxkart MACOSX_BUNDLE ${SRCS} )
|
add_executable(supertuxkart MACOSX_BUNDLE ${SRCS} )
|
||||||
|
|
||||||
|
find_library(IOKIT_LIBRARY IOKit)
|
||||||
|
find_library(QUICKTIME_LIBRARY QuickTime)
|
||||||
|
find_library(CARBON_LIBRARY Carbon)
|
||||||
|
find_library(AUDIOUNIT_LIBRARY AudioUnit)
|
||||||
|
find_library(COCOA_LIBRARY Cocoa)
|
||||||
|
|
||||||
target_link_libraries(supertuxkart
|
target_link_libraries(supertuxkart
|
||||||
bulletdynamics
|
${IOKIT_LIBRARY}
|
||||||
bulletcollision
|
${QUICKTIME_LIBRARY}
|
||||||
bulletmath
|
${CARBON_LIBRARY}
|
||||||
enet
|
${AUDIOUNIT_LIBRARY}
|
||||||
${CURL_LIBRARIES}
|
${COCOA_LIBRARY})
|
||||||
# We could use smarter detection of the frameworks but supporting a single official setup makes things easy...
|
|
||||||
${IRRLICHT_LIBRARIES}
|
|
||||||
${OPENGL_LIBRARIES}
|
|
||||||
/Library/Frameworks/Ogg.framework
|
|
||||||
/Library/Frameworks/OpenAL.framework
|
|
||||||
/Library/Frameworks/Vorbis.framework
|
|
||||||
# TODO: allow linking against frameworks from a SDK.
|
|
||||||
/System/Library/Frameworks/IOKit.framework
|
|
||||||
/System/Library/Frameworks/QuickTime.framework
|
|
||||||
/System/Library/Frameworks/Carbon.framework
|
|
||||||
/System/Library/Frameworks/AudioUnit.framework
|
|
||||||
/System/Library/Frameworks/Cocoa.framework)
|
|
||||||
|
|
||||||
# configure CMake to use a custom Info.plist
|
# configure CMake to use a custom Info.plist
|
||||||
set_target_properties(supertuxkart PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/src/ide/Xcode/SuperTuxKart-Info.plist )
|
set_target_properties(supertuxkart PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/src/ide/Xcode/SuperTuxKart-Info.plist )
|
||||||
|
|
||||||
@ -182,22 +160,26 @@ else()
|
|||||||
# Build the final executable
|
# Build the final executable
|
||||||
add_executable(supertuxkart ${SRCS})
|
add_executable(supertuxkart ${SRCS})
|
||||||
|
|
||||||
target_link_libraries(supertuxkart
|
if(UNIX)
|
||||||
${IRRLICHT_LIBRARIES}
|
target_link_libraries(supertuxkart pthread Xxf86vm)
|
||||||
bulletdynamics
|
endif()
|
||||||
bulletcollision
|
|
||||||
bulletmath
|
|
||||||
enet
|
|
||||||
pthread
|
|
||||||
${CURL_LIBRARIES}
|
|
||||||
${OPENGL_LIBRARIES}
|
|
||||||
${OPENAL_LIBRARY}
|
|
||||||
vorbisfile)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Common library dependencies
|
||||||
|
target_link_libraries(supertuxkart
|
||||||
|
bulletdynamics
|
||||||
|
bulletcollision
|
||||||
|
bulletmath
|
||||||
|
enet
|
||||||
|
${CURL_LIBRARIES}
|
||||||
|
${IRRLICHT_LIBRARIES}
|
||||||
|
${OGGVORBIS_LIBRARIES}
|
||||||
|
${OPENAL_LIBRARY}
|
||||||
|
${OPENGL_LIBRARIES})
|
||||||
|
|
||||||
if(USE_FRIBIDI)
|
if(USE_FRIBIDI)
|
||||||
target_link_libraries(supertuxkart ${FRIBIDI_LIBRARIES})
|
target_link_libraries(supertuxkart ${FRIBIDI_LIBRARIES})
|
||||||
add_definitions(-DENABLE_BIDI=1)
|
add_definitions(-DENABLE_BIDI)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_WIIUSE)
|
if(USE_WIIUSE)
|
||||||
|
40
cmake/FindOggVorbis.cmake
Normal file
40
cmake/FindOggVorbis.cmake
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# - Find OggVorbis
|
||||||
|
# Find the OggVorbis includes and libraries
|
||||||
|
#
|
||||||
|
# Following variables are provided:
|
||||||
|
# OGGVORBIS_FOUND
|
||||||
|
# True if OggVorbis has been found
|
||||||
|
# OGGVORBIS_INCLUDE_DIRS
|
||||||
|
# The include directories of OggVorbis
|
||||||
|
# OGGVORBIS_LIBRARIES
|
||||||
|
# OggVorbis library list
|
||||||
|
|
||||||
|
|
||||||
|
find_path(OGGVORBIS_OGG_INCLUDE_DIR NAMES ogg/ogg.h)
|
||||||
|
find_path(OGGVORBIS_VORBIS_INCLUDE_DIR NAMES vorbis/vorbisfile.h)
|
||||||
|
find_library(OGGVORBIS_OGG_LIBRARY NAMES ogg Ogg)
|
||||||
|
find_library(OGGVORBIS_VORBIS_LIBRARY NAMES vorbis Vorbis)
|
||||||
|
find_library(OGGVORBIS_VORBISFILE_LIBRARY NAMES vorbisfile)
|
||||||
|
|
||||||
|
if (APPLE)
|
||||||
|
set(OGGVORBIS_OGG_INCLUDE_DIR "/Library/Frameworks/Ogg.framework/Headers/")
|
||||||
|
set(OGGVORBIS_VORBIS_INCLUDE_DIR "/Library/Frameworks/Vorbis.framework/Headers/")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(APPLE AND NOT OGGVORBIS_VORBISFILE_LIBRARY)
|
||||||
|
# Seems to be the same on Apple systems
|
||||||
|
set(OGGVORBIS_VORBISFILE_LIBRARY ${OGGVORBIS_VORBIS_LIBRARY})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(OggVorbis DEFAULT_MSG
|
||||||
|
OGGVORBIS_OGG_INCLUDE_DIR OGGVORBIS_VORBIS_INCLUDE_DIR
|
||||||
|
OGGVORBIS_OGG_LIBRARY OGGVORBIS_VORBIS_LIBRARY OGGVORBIS_VORBISFILE_LIBRARY)
|
||||||
|
|
||||||
|
# Publish variables
|
||||||
|
set(OGGVORBIS_INCLUDE_DIRS ${OGGVORBIS_OGG_INCLUDE_DIR} ${OGGVORBIS_VORBIS_INCLUDE_DIR})
|
||||||
|
set(OGGVORBIS_LIBRARIES ${OGGVORBIS_OGG_LIBRARY} ${OGGVORBIS_VORBIS_LIBRARY} ${OGGVORBIS_VORBISFILE_LIBRARY})
|
||||||
|
list(REMOVE_DUPLICATES OGGVORBIS_INCLUDE_DIRS)
|
||||||
|
list(REMOVE_DUPLICATES OGGVORBIS_LIBRARIES)
|
||||||
|
mark_as_advanced(OGGVORBIS_OGG_INCLUDE_DIR OGGVORBIS_VORBIS_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(OGGVORBIS_OGG_LIBRARY OGGVORBIS_VORBIS_LIBRARY OGGVORBIS_VORBISFILE_LIBRARY)
|
Loading…
x
Reference in New Issue
Block a user