2010-01-21 15:12:50 +00:00
|
|
|
# Project Name
|
|
|
|
project(Pcsx2)
|
|
|
|
|
2012-05-07 16:29:06 +00:00
|
|
|
# Debian-based distributions require at least 2.8.5 due to multiarch.
|
2018-12-08 06:18:12 +00:00
|
|
|
# Bumping up to 3.0 seems reasonable at this point, and will let us modernize
|
|
|
|
# things a bit.
|
2020-05-07 15:32:34 +00:00
|
|
|
#
|
|
|
|
# Setting it to a range tells it that it supports the features on the newer
|
|
|
|
# versions as well, avoiding setting policies.
|
2020-05-20 05:15:47 +00:00
|
|
|
cmake_minimum_required(VERSION 3.3.0...3.17)
|
2012-10-21 18:10:13 +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-06-04 20:35:02 +00:00
|
|
|
# set module path
|
2014-03-30 14:28:59 +00:00
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
2010-06-04 20:35:02 +00:00
|
|
|
|
2014-03-30 14:25:11 +00:00
|
|
|
# include some generic functions to ensure correctness of the env
|
2010-06-04 20:35:02 +00:00
|
|
|
include(Pcsx2Utils)
|
|
|
|
|
2014-03-30 14:25:11 +00:00
|
|
|
check_no_parenthesis_in_path()
|
2010-06-04 20:35:02 +00:00
|
|
|
detectOperatingSystem()
|
2020-09-29 14:30:03 +00:00
|
|
|
check_compiler_version("7.0" "7.0")
|
2013-07-06 09:42:46 +00:00
|
|
|
|
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
|
|
|
|
2013-06-28 10:43:50 +00:00
|
|
|
# Must be done after SearchForStuff
|
2020-05-24 06:19:47 +00:00
|
|
|
get_git_version_info()
|
2013-06-28 10:43:50 +00:00
|
|
|
write_svnrev_h()
|
|
|
|
|
2018-09-06 04:38:38 +00:00
|
|
|
if(NOT NO_TRANSLATION)
|
2020-10-17 01:47:54 +00:00
|
|
|
# make the translation
|
|
|
|
if(EXISTS "${CMAKE_SOURCE_DIR}/locales")
|
|
|
|
add_subdirectory(locales)
|
|
|
|
endif()
|
2014-12-21 15:48:41 +00:00
|
|
|
endif()
|
2020-10-17 01:47:54 +00:00
|
|
|
|
|
|
|
# 3rdpary Libraries
|
|
|
|
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/fmt/fmt")
|
|
|
|
add_subdirectory(3rdparty/fmt/fmt)
|
2018-09-06 04:38:38 +00:00
|
|
|
endif()
|
2011-01-20 20:45:07 +00:00
|
|
|
|
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)
|
2014-12-21 15:48:41 +00:00
|
|
|
endif()
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# make pcsx2
|
2014-03-30 14:28:59 +00:00
|
|
|
if(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core)
|
2010-06-04 17:17:55 +00:00
|
|
|
add_subdirectory(pcsx2)
|
2014-12-21 15:48:41 +00:00
|
|
|
endif()
|
2010-01-21 15:12:50 +00:00
|
|
|
|
|
|
|
# make plugins
|
2014-03-30 14:28:59 +00:00
|
|
|
if(EXISTS "${CMAKE_SOURCE_DIR}/plugins")
|
2010-06-07 13:32:10 +00:00
|
|
|
add_subdirectory(plugins)
|
2014-12-21 15:48:41 +00:00
|
|
|
endif()
|
2011-07-17 11:25:17 +00:00
|
|
|
|
2020-08-19 08:19:28 +00:00
|
|
|
# tests
|
|
|
|
if(ACTUALLY_ENABLE_TESTS)
|
|
|
|
add_subdirectory(3rdparty/gtest EXCLUDE_FROM_ALL)
|
|
|
|
add_subdirectory(tests/ctest)
|
|
|
|
endif()
|
|
|
|
|
2011-07-17 11:25:17 +00:00
|
|
|
#-------------------------------------------------------------------------------
|
2016-02-28 13:01:02 +00:00
|
|
|
|
2011-07-17 11:25:17 +00:00
|
|
|
# Install some files to ease package creation
|
|
|
|
if(PACKAGE_MODE)
|
2015-08-07 06:39:39 +00:00
|
|
|
if(NOT DISABLE_CHEATS_ZIP)
|
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/cheats_ws.zip" DESTINATION "${GAMEINDEX_DIR}")
|
|
|
|
endif()
|
2014-03-30 14:28:59 +00:00
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/GameIndex.dbf" DESTINATION "${GAMEINDEX_DIR}")
|
|
|
|
|
2014-09-14 16:41:26 +00:00
|
|
|
# set categories depending on system/distribution in pcsx2.desktop
|
|
|
|
if(openSUSE)
|
|
|
|
set(PCSX2_MENU_CATEGORIES "System;Emulator;")
|
|
|
|
else()
|
|
|
|
set(PCSX2_MENU_CATEGORIES "Game;Emulator;")
|
|
|
|
endif()
|
2015-05-18 08:04:23 +00:00
|
|
|
configure_file("${CMAKE_SOURCE_DIR}/linux_various/PCSX2.desktop.in" "${CMAKE_BINARY_DIR}/linux_various/PCSX2.desktop" @ONLY)
|
2014-09-14 16:41:26 +00:00
|
|
|
|
2015-05-18 08:04:23 +00:00
|
|
|
INSTALL(FILES "${CMAKE_BINARY_DIR}/linux_various/PCSX2.desktop" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
|
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2.xpm" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/pixmaps")
|
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_FAQ.pdf" DESTINATION "${DOC_DIR}")
|
2020-02-10 03:46:49 +00:00
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/Configuration_Guide.pdf" DESTINATION "${DOC_DIR}")
|
2016-03-21 06:02:59 +00:00
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2.1" DESTINATION "${MAN_DIR}/man1")
|
2015-08-07 06:39:39 +00:00
|
|
|
if(NOT DISABLE_PCSX2_WRAPPER)
|
2016-02-28 13:01:02 +00:00
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2-linux.sh" DESTINATION "${BIN_DIR}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
else()
|
|
|
|
if(NOT DISABLE_PCSX2_WRAPPER)
|
|
|
|
# special case to avoid having linux files in windows
|
|
|
|
INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2-linux.sh" DESTINATION "${CMAKE_SOURCE_DIR}/bin")
|
2015-08-07 06:39:39 +00:00
|
|
|
endif()
|
2014-12-21 15:48:41 +00:00
|
|
|
endif()
|