Apply more cmake patches by riebl, the files are easier to read now, thanks

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10923 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2012-03-06 01:07:26 +00:00
parent d1240cb1bf
commit 09804299f4
3 changed files with 104 additions and 101 deletions
+27
View File
@@ -0,0 +1,27 @@
# - Find Fribidi
# Find the Fribidi includes and libraries
#
# Following variables are provided:
# FRIBIDI_FOUND
# True if Fribidi has been found
# FRIBIDI_INCLUDE_DIRS
# The include directories of Fribidi
# FRIBIDI_LIBRARIES
# Fribidi library list
find_path(FRIBIDI_INCLUDE_DIR NAMES fribidi/fribidi.h PATHS /Library/Frameworks/fribidi.framework/Headers)
find_library(FRIBIDI_LIBRARY NAMES fribidi PATHS /Library/Frameworks/fribidi.framework)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Fribidi DEFAULT_MSG FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)
#if(APPLE)
#set(FRIBIDI_INCLUDE_DIR "/Library/Frameworks/fribidi.framework/Headers")
#endif()
# Publish variables
set(FRIBIDI_INCLUDE_DIRS ${FRIBIDI_INCLUDE_DIR})
set(FRIBIDI_LIBRARIES ${FRIBIDI_LIBRARY})
mark_as_advanced(FRIBIDI_INCLUDE_DIR FRIBIDI_LIBRARY)
+58
View File
@@ -0,0 +1,58 @@
# - Find Irrlicht
# Find the Irrlicht includes and libraries
#
# Following variables are provided:
# IRRLICHT_FOUND
# True if Irrlicht has been found
# IRRLICHT_DIR
# Path to Irrlicht
# IRRLICHT_INCLUDE_DIRS
# The include directories of Irrlicht
# IRRLICHT_LIBRARIES
# Irrlicht library list
set(IRRLICHT_DIR "" CACHE PATH "Path to Irrlicht")
# Set library directories depending on system
if(APPLE)
set(IRRLICHT_LIBRARY_DIR "/Library/Frameworks/IrrFramework.framework")
elseif(UNIX)
set(IRRLICHT_LIBRARY_DIR "${IRRLICHT_DIR}/lib/Linux")
elseif(MSVC)
set(IRRLICHT_LIBRARY_DIR "${IRRLICHT_DIR}/lib/Win32-visualstudio")
else()
set(IRRLICHT_LIBRARY_DIR "${IRRLICHT_DIR}/lib/Win32-gcc")
endif()
# Find include directory and library
find_path(IRRLICHT_INCLUDE_DIR NAMES irrlicht.h
PATHS ${IRRLICHT_DIR} /Library/Frameworks/IrrFramework.framework/Versions/A/Headers/
PATH_SUFFIXES include)
if(APPLE)
find_library(IRRLICHT_LIBRARY NAMES IrrFramework PATHS ${IRRLICHT_LIBRARY_DIR})
else()
find_library(IRRLICHT_LIBRARY NAMES Irrlicht PATHS ${IRRLICHT_LIBRARY_DIR})
endif()
# Determine Irrlicht version
if(EXISTS ${IRRLICHT_INCLUDE_DIR}/IrrCompileConfig.h)
file(STRINGS ${IRRLICHT_INCLUDE_DIR}/IrrCompileConfig.h IRRLICHT_COMPILE_CONFIG REGEX IRRLICHT_VERSION)
string(REGEX MATCH "IRRLICHT_VERSION_MAJOR ([0-9]+)" _tmp ${IRRLICHT_COMPILE_CONFIG})
set(IRRLICHT_VERSION_MAJOR ${CMAKE_MATCH_1})
string(REGEX MATCH "IRRLICHT_VERSION_MINOR ([0-9]+)" _tmp ${IRRLICHT_COMPILE_CONFIG})
set(IRRLICHT_VERSION_MINOR ${CMAKE_MATCH_1})
string(REGEX MATCH "IRRLICHT_VERSION_REVISION ([0-9]+)" _tmp ${IRRLICHT_COMPILE_CONFIG})
set(IRRLICHT_VERSION_REVISION ${CMAKE_MATCH_1})
set(IRRLICHT_VERSION "${IRRLICHT_VERSION_MAJOR}.${IRRLICHT_VERSION_MINOR}.${IRRLICHT_VERSION_REVISION}")
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Irrlicht
REQUIRED_VARS IRRLICHT_LIBRARY IRRLICHT_INCLUDE_DIR
VERSION_VAR IRRLICHT_VERSION)
# Publish variables
set(IRRLICHT_INCLUDE_DIRS ${IRRLICHT_INCLUDE_DIR})
set(IRRLICHT_LIBRARIES ${IRRLICHT_LIBRARY})
mark_as_advanced(IRRLICHT_INCLUDE_DIR IRRLICHT_LIBRARY)