2010-01-21 15:12:50 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2010-06-04 17:17:55 +00:00
|
|
|
# Search all libraries on the system
|
2010-01-21 15:12:50 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2010-06-04 17:17:55 +00:00
|
|
|
# Do not search Lib in /usr/lib64. Hope it is not overwritten in find_package or others macro
|
|
|
|
SET(FIND_LIBRARY_USE_LIB64_PATHS FALSE)
|
2010-01-22 04:36:49 +00:00
|
|
|
|
2010-08-02 07:33:11 +00:00
|
|
|
## Linux only libraries
|
2010-06-04 17:17:55 +00:00
|
|
|
if(Linux)
|
2011-05-23 21:34:45 +00:00
|
|
|
# Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags
|
|
|
|
#
|
|
|
|
# Warning: because of multiarch Ubuntu move /usr/lib/glib-2.0/include/glibconfig.h to /usr/lib/i386-linux-gnu/glib-2.0/include/glibconfig.h
|
|
|
|
# So as temporary work around, I copy the FindGTK2 module inside pcsx2 and add the /usr/lib/i386-linux-gnu path... -- Gregory
|
|
|
|
#
|
|
|
|
# find_package(GTK2 REQUIRED gtk)
|
|
|
|
find_package(GTK2_pcsx2 REQUIRED gtk)
|
2010-08-02 07:33:11 +00:00
|
|
|
if(GTK2_FOUND)
|
|
|
|
# From version 2.21.3 gtk moved gdk-pixbuf into a separate module
|
|
|
|
# Cmake need to be fixed. For the moment uses a manual detection.
|
|
|
|
find_path(GDK_PIXBUF_INCLUDE_DIRS NAMES gdk-pixbuf/gdk-pixbuf.h PATHS
|
|
|
|
/usr/include/gdk-pixbuf-2.0
|
|
|
|
/usr/include)
|
|
|
|
if (GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
set(GTK2_INCLUDE_DIRS "${GDK_PIXBUF_INCLUDE_DIRS}" "${GTK2_INCLUDE_DIRS}")
|
|
|
|
# Remove duplicates when cmake will be fixed
|
|
|
|
list(REMOVE_DUPLICATES GTK2_INCLUDE_DIRS)
|
|
|
|
endif (GDK_PIXBUF_INCLUDE_DIRS)
|
|
|
|
endif(GTK2_FOUND)
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
find_package(X11)
|
2010-01-21 15:12:50 +00:00
|
|
|
endif(Linux)
|
2010-08-02 07:33:11 +00:00
|
|
|
|
|
|
|
## Use cmake package to find module
|
2010-06-04 17:17:55 +00:00
|
|
|
find_package(ALSA)
|
|
|
|
find_package(BZip2)
|
2011-01-20 20:45:07 +00:00
|
|
|
find_package(Gettext) # translation tool
|
2010-06-23 10:07:18 +00:00
|
|
|
find_package(JPEG)
|
2010-06-04 17:17:55 +00:00
|
|
|
find_package(OpenGL)
|
|
|
|
# Tell cmake that we use SDL as a library and not as an application
|
2011-02-26 20:02:22 +00:00
|
|
|
if(NOT FORCE_INTERNAL_SDL)
|
|
|
|
set(SDL_BUILDING_LIBRARY TRUE)
|
|
|
|
find_package(SDL)
|
|
|
|
endif(NOT FORCE_INTERNAL_SDL)
|
2010-06-04 17:17:55 +00:00
|
|
|
find_package(Subversion)
|
2011-05-14 11:03:02 +00:00
|
|
|
# The requirement of wxWidgets is checked in SelectPcsx2Plugins module
|
|
|
|
# Does not require the module (allow to compile non-wx plugins)
|
2011-02-15 14:37:30 +00:00
|
|
|
# Force the unicode build (the variable is only supported on cmake 2.8.3 and above)
|
2011-05-09 20:32:50 +00:00
|
|
|
# Warning do not put any double-quote for the argument...
|
|
|
|
# set(wxWidgets_CONFIG_OPTIONS --unicode=yes --debug=yes) # In case someone want to debug inside wx
|
|
|
|
set(wxWidgets_CONFIG_OPTIONS --unicode=yes)
|
2010-08-02 07:33:11 +00:00
|
|
|
find_package(wxWidgets COMPONENTS base core adv)
|
2010-06-22 13:30:36 +00:00
|
|
|
if(NOT FORCE_INTERNAL_ZLIB)
|
|
|
|
find_package(ZLIB)
|
|
|
|
endif(NOT FORCE_INTERNAL_ZLIB)
|
2010-08-02 07:33:11 +00:00
|
|
|
|
|
|
|
## Use pcsx2 package to find module
|
2010-06-04 17:17:55 +00:00
|
|
|
include(FindCg)
|
|
|
|
include(FindGlew)
|
2010-06-22 14:36:50 +00:00
|
|
|
include(FindPortAudio)
|
2010-06-22 13:30:36 +00:00
|
|
|
if(NOT FORCE_INTERNAL_SOUNDTOUCH)
|
2010-06-22 14:36:50 +00:00
|
|
|
include(FindSoundTouch)
|
2010-06-22 13:30:36 +00:00
|
|
|
endif(NOT FORCE_INTERNAL_SOUNDTOUCH)
|
2010-06-21 11:05:30 +00:00
|
|
|
include(FindSparseHash)
|
2010-06-04 17:17:55 +00:00
|
|
|
|
|
|
|
# Note for include_directory: The order is important to avoid a mess between include file from your system and the one of pcsx2
|
|
|
|
# If you include first 3rdparty, all 3rdpary include will have a higer priority...
|
|
|
|
# If you include first /usr/include, all system include will have a higer priority over the pcsx2 one...
|
|
|
|
# Current implementation:
|
|
|
|
# 1/ include 3rdparty sub-directory that we will used (either request or fallback)
|
|
|
|
# 2/ include system one
|
|
|
|
#----------------------------------------
|
|
|
|
# Fallback on 3rdparty libraries
|
|
|
|
#----------------------------------------
|
|
|
|
# Note to avoid some conflict with system include, we must include 3rdparty first
|
|
|
|
if(NOT ZLIB_FOUND OR FORCE_INTERNAL_ZLIB)
|
2010-01-22 04:36:49 +00:00
|
|
|
# use project one
|
|
|
|
set(projectZLIB TRUE)
|
2010-06-03 15:43:10 +00:00
|
|
|
set(ZLIB_FOUND TRUE)
|
2010-06-04 17:17:55 +00:00
|
|
|
# Set path
|
2010-06-19 12:28:22 +00:00
|
|
|
set(ZLIB_LIBRARIES pcsx2_zlib)
|
2010-06-07 13:32:10 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/zlib)
|
2010-06-22 13:30:36 +00:00
|
|
|
message(STATUS "Use internal pcsx2 zlib library")
|
2010-06-04 17:17:55 +00:00
|
|
|
endif(NOT ZLIB_FOUND OR FORCE_INTERNAL_ZLIB)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
if(NOT SOUNDTOUCH_FOUND OR FORCE_INTERNAL_SOUNDTOUCH)
|
|
|
|
# use project one
|
|
|
|
set(projectSoundTouch TRUE)
|
|
|
|
set(SOUNDTOUCH_FOUND TRUE)
|
|
|
|
# Set path
|
2010-06-19 12:28:22 +00:00
|
|
|
set(SOUNDTOUCH_LIBRARIES pcsx2_SoundTouch)
|
2010-06-11 13:51:43 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/soundtouch_linux_include)
|
2010-06-22 13:30:36 +00:00
|
|
|
message(STATUS "Use internal pcsx2 SoundTouch library")
|
2010-06-04 17:17:55 +00:00
|
|
|
endif(NOT SOUNDTOUCH_FOUND OR FORCE_INTERNAL_SOUNDTOUCH)
|
|
|
|
|
2011-02-26 20:02:22 +00:00
|
|
|
if(NOT SDL_FOUND OR FORCE_INTERNAL_SDL)
|
|
|
|
# use project one
|
|
|
|
set(projectSDL TRUE)
|
|
|
|
set(SDL_FOUND TRUE)
|
|
|
|
# Set path
|
|
|
|
set(SDL_LIBRARY pcsx2_SDL)
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/3rdparty/SDL-1.3.0-5387/include)
|
|
|
|
message(STATUS "Use internal pcsx2 SDL library")
|
|
|
|
endif(NOT SDL_FOUND OR FORCE_INTERNAL_SDL)
|
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
#----------------------------------------
|
2010-06-04 17:17:55 +00:00
|
|
|
# Use system include (if not 3rdparty one)
|
2010-01-22 04:36:49 +00:00
|
|
|
#----------------------------------------
|
2010-06-04 17:17:55 +00:00
|
|
|
if(Linux)
|
|
|
|
# GTK2
|
|
|
|
if(GTK2_FOUND)
|
|
|
|
include_directories(${GTK2_INCLUDE_DIRS})
|
|
|
|
endif(GTK2_FOUND)
|
2010-01-22 04:36:49 +00:00
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# x11
|
2010-01-22 04:36:49 +00:00
|
|
|
if(X11_FOUND)
|
|
|
|
include_directories(${X11_INCLUDE_DIR})
|
|
|
|
endif(X11_FOUND)
|
|
|
|
endif(Linux)
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# ALSA
|
2010-01-22 04:36:49 +00:00
|
|
|
if(ALSA_FOUND)
|
|
|
|
include_directories(${ALSA_INCLUDE_DIRS})
|
|
|
|
endif(ALSA_FOUND)
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# bzip2
|
2010-06-19 13:59:16 +00:00
|
|
|
if(BZIP2_FOUND)
|
2010-05-12 11:25:30 +00:00
|
|
|
include_directories(${BZIP2_INCLUDE_DIR})
|
2010-06-19 13:59:16 +00:00
|
|
|
endif(BZIP2_FOUND)
|
2010-01-22 04:36:49 +00:00
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# Cg
|
2010-01-22 04:36:49 +00:00
|
|
|
if(CG_FOUND)
|
2010-06-23 15:45:05 +00:00
|
|
|
include_directories(${CG_INCLUDE_DIRS})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(CG_FOUND)
|
|
|
|
|
2010-06-23 10:07:18 +00:00
|
|
|
# Jpeg
|
|
|
|
if(JPEG_FOUND)
|
|
|
|
include_directories(${JPEG_INCLUDE_DIR})
|
|
|
|
endif(JPEG_FOUND)
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# GLEW
|
2010-01-22 04:36:49 +00:00
|
|
|
if(GLEW_FOUND)
|
2010-10-30 11:24:03 +00:00
|
|
|
include_directories(${GLEW_INCLUDE_DIR})
|
2010-01-22 04:36:49 +00:00
|
|
|
endif(GLEW_FOUND)
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# OpenGL
|
2010-01-21 15:12:50 +00:00
|
|
|
if(OPENGL_FOUND)
|
|
|
|
include_directories(${OPENGL_INCLUDE_DIR})
|
|
|
|
endif(OPENGL_FOUND)
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# PortAudio
|
2010-01-22 04:36:49 +00:00
|
|
|
if(PORTAUDIO_FOUND)
|
|
|
|
include_directories(${PORTAUDIO_INCLUDE_DIR})
|
|
|
|
endif(PORTAUDIO_FOUND)
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# SDL
|
2011-02-26 20:02:22 +00:00
|
|
|
if(SDL_FOUND AND NOT projectSDL)
|
2010-01-21 15:12:50 +00:00
|
|
|
include_directories(${SDL_INCLUDE_DIR})
|
2011-02-26 20:02:22 +00:00
|
|
|
endif(SDL_FOUND AND NOT projectSDL)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
# SoundTouch
|
|
|
|
if(SOUNDTOUCH_FOUND AND NOT projectSoundTouch)
|
2010-05-23 07:51:43 +00:00
|
|
|
include_directories(${SOUNDTOUCH_INCLUDE_DIR})
|
2010-06-04 17:17:55 +00:00
|
|
|
endif(SOUNDTOUCH_FOUND AND NOT projectSoundTouch)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-06-21 11:05:30 +00:00
|
|
|
# SPARSEHASH
|
|
|
|
if(SPARSEHASH_FOUND)
|
|
|
|
include_directories(${SPARSEHASH_INCLUDE_DIR})
|
|
|
|
endif(SPARSEHASH_FOUND)
|
2010-06-04 17:17:55 +00:00
|
|
|
|
|
|
|
# Wx
|
|
|
|
if(wxWidgets_FOUND)
|
|
|
|
if(Linux)
|
2010-06-05 11:56:52 +00:00
|
|
|
# Force the use of 32 bit library configuration on
|
|
|
|
# 64 bits machine with 32 bits library in /usr/lib32
|
2011-05-10 16:22:28 +00:00
|
|
|
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
2011-05-10 09:26:39 +00:00
|
|
|
if (EXISTS "/usr/lib32")
|
|
|
|
# Debian/ubuntu. 64b in /usr/lib and 32b in /usr/lib32
|
|
|
|
STRING(REGEX REPLACE "/usr/lib/wx" "/usr/lib32/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
|
|
|
|
# I'm sure someone did it! 64b in /usr/lib64 and 32b in /usr/lib32
|
|
|
|
STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib32/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
|
|
|
|
endif (EXISTS "/usr/lib32")
|
|
|
|
if (EXISTS "/usr/lib")
|
|
|
|
# Fedora/Open suse. 64b in /usr/lib64 and 32b in /usr/lib
|
|
|
|
STRING(REGEX REPLACE "/usr/lib64/wx" "/usr/lib/wx" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
|
|
|
|
endif (EXISTS "/usr/lib")
|
2011-05-10 16:22:28 +00:00
|
|
|
endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
2010-06-04 17:17:55 +00:00
|
|
|
endif(Linux)
|
2010-06-05 11:56:52 +00:00
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
include(${wxWidgets_USE_FILE})
|
|
|
|
endif(wxWidgets_FOUND)
|
|
|
|
|
|
|
|
# Zlib
|
|
|
|
if(ZLIB_FOUND AND NOT projectZLIB)
|
|
|
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
|
|
|
endif(ZLIB_FOUND AND NOT projectZLIB)
|