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-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
|
2014-03-25 16:29:47 +00:00
|
|
|
find_package(Git)
|
2010-06-23 10:07:18 +00:00
|
|
|
find_package(JPEG)
|
2010-06-04 17:17:55 +00:00
|
|
|
find_package(OpenGL)
|
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
|
2014-03-26 10:37:49 +00:00
|
|
|
#
|
2013-03-05 12:38:22 +00:00
|
|
|
# Fedora uses an extra non-standard option ... Arch must be the first option.
|
2014-12-25 02:18:28 +00:00
|
|
|
# They do uname -m if missing so only fix for cross compilations.
|
|
|
|
# http://pkgs.fedoraproject.org/cgit/wxGTK.git/plain/wx-config
|
|
|
|
if(Fedora AND CMAKE_CROSSCOMPILING)
|
|
|
|
set(wxWidgets_CONFIG_OPTIONS --arch ${PCSX2_TARGET_ARCHITECTURES} --unicode=yes)
|
2013-01-02 13:34:38 +00:00
|
|
|
else()
|
|
|
|
set(wxWidgets_CONFIG_OPTIONS --unicode=yes)
|
|
|
|
endif()
|
2015-01-04 00:56:50 +00:00
|
|
|
|
2015-01-09 12:10:11 +00:00
|
|
|
if(WX28_API)
|
|
|
|
list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8)
|
|
|
|
else()
|
|
|
|
list(APPEND wxWidgets_CONFIG_OPTIONS --version=3.0)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(GTK3_API)
|
|
|
|
list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
|
|
|
|
else()
|
|
|
|
list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2)
|
|
|
|
endif()
|
|
|
|
|
2015-01-09 12:44:26 +00:00
|
|
|
# wx2.8 => /usr/bin/wx-config-2.8
|
|
|
|
# lib32-wx2.8 => /usr/bin/wx-config32-2.8
|
|
|
|
# wx3.0 => /usr/bin/wx-config-3.0
|
2015-01-04 00:56:50 +00:00
|
|
|
# I'm going to take a wild guess and predict this:
|
2015-01-09 12:44:26 +00:00
|
|
|
# lib32-wx3.0 => /usr/bin/wx-config32-3.0
|
|
|
|
# FindwxWidgets only searches for wx-config.
|
2015-01-04 00:56:50 +00:00
|
|
|
if(CMAKE_CROSSCOMPILING)
|
2015-01-04 20:08:12 +00:00
|
|
|
# May need to fix the filenames for lib32-wx3.0.
|
2015-01-09 12:44:26 +00:00
|
|
|
if(NOT WX28_API AND ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-3.0")
|
2015-01-04 00:56:50 +00:00
|
|
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-3.0")
|
2015-01-09 12:44:26 +00:00
|
|
|
elseif(WX28_API AND ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-2.8")
|
2015-01-04 00:56:50 +00:00
|
|
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-2.8")
|
|
|
|
endif()
|
|
|
|
else()
|
2015-01-09 12:44:26 +00:00
|
|
|
if(NOT WX28_API AND EXISTS "/usr/bin/wx-config-3.0")
|
2015-01-09 03:27:16 +00:00
|
|
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0")
|
2015-01-09 12:44:26 +00:00
|
|
|
elseif(WX28_API AND EXISTS "/usr/bin/wx-config-2.8")
|
2015-01-04 00:56:50 +00:00
|
|
|
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-2.8")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2010-08-02 07:33:11 +00:00
|
|
|
find_package(wxWidgets COMPONENTS base core adv)
|
2012-08-15 10:22:19 +00:00
|
|
|
find_package(ZLIB)
|
2010-08-02 07:33:11 +00:00
|
|
|
|
|
|
|
## Use pcsx2 package to find module
|
2014-08-04 16:15:10 +00:00
|
|
|
include(FindCg)
|
2010-06-04 17:17:55 +00:00
|
|
|
include(FindGlew)
|
2011-09-06 19:07:55 +00:00
|
|
|
include(FindLibc)
|
2014-08-04 16:15:10 +00:00
|
|
|
|
|
|
|
## Use CheckLib package to find module
|
|
|
|
include(CheckLib)
|
2014-12-28 06:41:57 +00:00
|
|
|
if(Linux)
|
|
|
|
check_lib(AIO aio libaio.h)
|
|
|
|
endif()
|
2014-12-24 16:41:04 +00:00
|
|
|
check_lib(EGL EGL EGL/egl.h)
|
2014-08-04 16:15:10 +00:00
|
|
|
check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h)
|
|
|
|
check_lib(SOUNDTOUCH SoundTouch soundtouch/SoundTouch.h)
|
2010-06-04 17:17:55 +00:00
|
|
|
|
2014-12-07 11:19:14 +00:00
|
|
|
if(SDL2_API)
|
2014-12-28 17:54:17 +00:00
|
|
|
check_lib(SDL2 SDL2 SDL.h PATH_SUFFIXES SDL2)
|
2014-12-07 11:19:14 +00:00
|
|
|
else()
|
|
|
|
# Tell cmake that we use SDL as a library and not as an application
|
|
|
|
set(SDL_BUILDING_LIBRARY TRUE)
|
|
|
|
find_package(SDL)
|
|
|
|
endif()
|
|
|
|
|
2014-12-28 06:41:57 +00:00
|
|
|
if(UNIX)
|
2014-12-07 21:06:39 +00:00
|
|
|
find_package(X11)
|
|
|
|
# Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags
|
|
|
|
if (GTK3_API)
|
2014-12-28 03:15:08 +00:00
|
|
|
if(CMAKE_CROSSCOMPILING)
|
|
|
|
find_package(GTK3 REQUIRED gtk)
|
|
|
|
else()
|
|
|
|
check_lib(GTK3 gtk+-3.0 gtk/gtk.h)
|
|
|
|
endif()
|
2014-12-07 21:06:39 +00:00
|
|
|
else()
|
|
|
|
find_package(GTK2 REQUIRED gtk)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
#----------------------------------------
|
2014-12-07 20:06:21 +00:00
|
|
|
# Use system include
|
2010-01-22 04:36:49 +00:00
|
|
|
#----------------------------------------
|
2014-12-28 06:41:57 +00:00
|
|
|
if(UNIX)
|
2010-06-04 17:17:55 +00:00
|
|
|
if(GTK2_FOUND)
|
|
|
|
include_directories(${GTK2_INCLUDE_DIRS})
|
2014-12-07 21:06:39 +00:00
|
|
|
elseif(GTK3_FOUND)
|
|
|
|
include_directories(${GTK3_INCLUDE_DIRS})
|
|
|
|
# A lazy solution
|
|
|
|
set(GTK2_LIBRARIES ${GTK3_LIBRARIES})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-01-22 04:36:49 +00:00
|
|
|
|
|
|
|
if(X11_FOUND)
|
|
|
|
include_directories(${X11_INCLUDE_DIR})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2010-01-22 04:36:49 +00:00
|
|
|
|
|
|
|
if(ALSA_FOUND)
|
|
|
|
include_directories(${ALSA_INCLUDE_DIRS})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-01-22 04:36:49 +00:00
|
|
|
|
2010-06-19 13:59:16 +00:00
|
|
|
if(BZIP2_FOUND)
|
2010-05-12 11:25:30 +00:00
|
|
|
include_directories(${BZIP2_INCLUDE_DIR})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-01-22 04:36:49 +00:00
|
|
|
|
|
|
|
if(CG_FOUND)
|
2010-06-23 15:45:05 +00:00
|
|
|
include_directories(${CG_INCLUDE_DIRS})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-01-22 04:36:49 +00:00
|
|
|
|
2010-06-23 10:07:18 +00:00
|
|
|
if(JPEG_FOUND)
|
|
|
|
include_directories(${JPEG_INCLUDE_DIR})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-06-23 10:07:18 +00:00
|
|
|
|
2010-01-22 04:36:49 +00:00
|
|
|
if(GLEW_FOUND)
|
2010-10-30 11:24:03 +00:00
|
|
|
include_directories(${GLEW_INCLUDE_DIR})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-01-22 04:36:49 +00:00
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
if(OPENGL_FOUND)
|
|
|
|
include_directories(${OPENGL_INCLUDE_DIR})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2014-12-07 11:19:14 +00:00
|
|
|
if(SDL_FOUND AND NOT SDL2_API)
|
2010-01-21 15:12:50 +00:00
|
|
|
include_directories(${SDL_INCLUDE_DIR})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-06-04 17:17:55 +00:00
|
|
|
if(wxWidgets_FOUND)
|
|
|
|
include(${wxWidgets_USE_FILE})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2010-06-04 17:17:55 +00:00
|
|
|
|
2012-08-15 10:22:19 +00:00
|
|
|
if(ZLIB_FOUND)
|
2010-06-04 17:17:55 +00:00
|
|
|
include_directories(${ZLIB_INCLUDE_DIRS})
|
2014-04-17 18:24:12 +00:00
|
|
|
endif()
|
2014-07-05 12:54:56 +00:00
|
|
|
|
|
|
|
#----------------------------------------
|
|
|
|
# Use project-wide include directories
|
|
|
|
#----------------------------------------
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/common/include
|
|
|
|
${CMAKE_SOURCE_DIR}/common/include/Utilities
|
|
|
|
${CMAKE_SOURCE_DIR}/common/include/x86emitter
|
|
|
|
# File generated by Cmake
|
|
|
|
${CMAKE_BINARY_DIR}/common/include
|
|
|
|
)
|
2015-01-04 19:38:36 +00:00
|
|
|
|
|
|
|
#----------------------------------------
|
|
|
|
# Check correctness of the parameter
|
|
|
|
# Note: wxWidgets_INCLUDE_DIRS must be defined
|
|
|
|
#----------------------------------------
|
|
|
|
include(ApiValidation)
|
|
|
|
WX_vs_SDL()
|