2010-01-21 15:12:50 +00:00
|
|
|
# Project Name
|
|
|
|
project(Pcsx2)
|
|
|
|
|
2010-07-28 14:51:02 +00:00
|
|
|
# There is some incompatible change with version 2.6 and below !
|
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
2010-06-22 13:30:36 +00:00
|
|
|
# Variable to check that people use the good file
|
|
|
|
set(TOP_CMAKE_WAS_SOURCED TRUE)
|
|
|
|
|
2010-07-15 22:24:35 +00:00
|
|
|
# Print a clear message that 64bits is not supported
|
|
|
|
# It would avoid compilation failure later.
|
2011-02-12 10:37:44 +00:00
|
|
|
# Note: disable the failure in package mode
|
|
|
|
if(NOT PACKAGE_MODE)
|
|
|
|
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
2011-05-14 11:03:02 +00:00
|
|
|
if (EXISTS /etc/fedora-release)
|
|
|
|
# Fedora users can install all .i686
|
|
|
|
message(STATUS "
|
|
|
|
Please ensure that you have all 32bits dependency installed (.i686 packages).
|
|
|
|
See http://code.google.com/p/pcsx2/wiki/ChrootAnd64bStatusLinux for more details.")
|
|
|
|
else (EXISTS /etc/fedora-release)
|
2011-02-12 10:37:44 +00:00
|
|
|
message(FATAL_ERROR "
|
|
|
|
PCSX2 does not support 64bits environment. Please install a 32bits chroot or a 32bits OS.
|
|
|
|
PCSX2 have neither no plan to support the 64bits architecture in the future.
|
|
|
|
It will need a complete rewrite of the core emulator and a lots of time
|
|
|
|
|
|
|
|
However when linux distribution will support properly multi-arch package, it will
|
|
|
|
be at least possible to easily compile and install PCSX2 witout too much hassle (the chroot environment)")
|
2011-05-14 11:03:02 +00:00
|
|
|
endif (EXISTS /etc/fedora-release)
|
2011-02-12 10:37:44 +00:00
|
|
|
endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
|
|
|
endif(NOT PACKAGE_MODE)
|
2010-07-15 22:24:35 +00:00
|
|
|
|
2011-02-19 19:02:24 +00:00
|
|
|
# 64 bits specific configuration
|
|
|
|
if(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
|
|
|
# Do not search library in /usr/lib64
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
|
|
|
|
# Probably useless but it will not harm
|
|
|
|
SET_PROPERTY(GLOBAL PROPERTY COMPILE_DEFINITIONS "-m32")
|
|
|
|
endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
|
2010-07-15 22:24:35 +00:00
|
|
|
|
2010-06-04 20:35:02 +00:00
|
|
|
# set module path
|
|
|
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
|
|
|
|
|
|
|
# include some generic functions
|
|
|
|
include(Pcsx2Utils)
|
|
|
|
|
|
|
|
# Detect current OS
|
|
|
|
detectOperatingSystem()
|
|
|
|
|
2010-05-23 07:51:43 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2010-06-04 20:35:02 +00:00
|
|
|
# Include specific module
|
2010-06-03 17:28:20 +00:00
|
|
|
# BuildParameters Must be done before SearchForStuff
|
|
|
|
include(BuildParameters)
|
|
|
|
# SearchForStuff be done before SelectPcsx2Plugins
|
2010-05-23 07:51:43 +00:00
|
|
|
include(SearchForStuff)
|
2010-06-03 17:28:20 +00:00
|
|
|
include(SelectPcsx2Plugins)
|
2010-05-23 07:51:43 +00:00
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# add additional project-wide include directories
|
2010-06-04 17:17:55 +00:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/common/include
|
2010-01-21 15:12:50 +00:00
|
|
|
${PROJECT_SOURCE_DIR}/common/include/Utilities
|
|
|
|
${PROJECT_SOURCE_DIR}/common/include/x86emitter)
|
|
|
|
|
2011-01-20 20:45:07 +00:00
|
|
|
# make the translation
|
|
|
|
if(EXISTS "${PROJECT_SOURCE_DIR}/locales")
|
|
|
|
add_subdirectory(locales)
|
|
|
|
endif(EXISTS "${PROJECT_SOURCE_DIR}/locales")
|
|
|
|
|
2010-01-21 15:12:50 +00:00
|
|
|
# make 3rdParty
|
2010-06-07 13:32:10 +00:00
|
|
|
if(EXISTS "${PROJECT_SOURCE_DIR}/3rdparty")
|
|
|
|
add_subdirectory(3rdparty)
|
|
|
|
endif(EXISTS "${PROJECT_SOURCE_DIR}/3rdparty")
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# make common
|
2010-06-04 17:17:55 +00:00
|
|
|
if(common_libs)
|
2010-07-13 09:16:13 +00:00
|
|
|
add_subdirectory(common/src/Utilities)
|
|
|
|
add_subdirectory(common/src/x86emitter)
|
2010-06-04 17:17:55 +00:00
|
|
|
endif(common_libs)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# make tools
|
|
|
|
add_subdirectory(tools)
|
|
|
|
|
|
|
|
# make pcsx2
|
2010-06-07 13:32:10 +00:00
|
|
|
if(EXISTS "${PROJECT_SOURCE_DIR}/pcsx2" AND pcsx2_core)
|
2010-06-04 17:17:55 +00:00
|
|
|
add_subdirectory(pcsx2)
|
2010-06-07 13:32:10 +00:00
|
|
|
endif(EXISTS "${PROJECT_SOURCE_DIR}/pcsx2" AND pcsx2_core)
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# make plugins
|
2010-06-07 13:32:10 +00:00
|
|
|
if(EXISTS "${PROJECT_SOURCE_DIR}/plugins")
|
|
|
|
add_subdirectory(plugins)
|
|
|
|
endif(EXISTS "${PROJECT_SOURCE_DIR}/plugins")
|
2011-07-17 11:25:17 +00:00
|
|
|
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
# Install some files to ease package creation
|
|
|
|
if(PACKAGE_MODE)
|
|
|
|
INSTALL(FILES "${PROJECT_SOURCE_DIR}/bin/GameIndex.dbf" DESTINATION ${GAMEINDEX_DIR})
|
|
|
|
endif(PACKAGE_MODE)
|