mirror of https://github.com/PCSX2/pcsx2.git
CMake: Added PACKAGE_MODE option
Set paths, add check in SetResourcesDir
This commit is contained in:
parent
4c5253c0f5
commit
0c949db506
|
@ -119,3 +119,4 @@ oprofile_data/
|
||||||
CMakeSettings.json
|
CMakeSettings.json
|
||||||
/ci-artifacts/
|
/ci-artifacts/
|
||||||
/out/
|
/out/
|
||||||
|
/.cache/
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
# Extra preprocessor definitions that will be added to all pcsx2 builds
|
# Extra preprocessor definitions that will be added to all pcsx2 builds
|
||||||
set(PCSX2_DEFS "")
|
set(PCSX2_DEFS "")
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Misc option
|
# Misc option
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
@ -8,6 +10,7 @@ option(ENABLE_TESTS "Enables building the unit tests" ON)
|
||||||
option(ENABLE_GSRUNNER "Enables building the GSRunner" OFF)
|
option(ENABLE_GSRUNNER "Enables building the GSRunner" OFF)
|
||||||
option(LTO_PCSX2_CORE "Enable LTO/IPO/LTCG on the subset of pcsx2 that benefits most from it but not anything else")
|
option(LTO_PCSX2_CORE "Enable LTO/IPO/LTCG on the subset of pcsx2 that benefits most from it but not anything else")
|
||||||
option(USE_VTUNE "Plug VTUNE to profile GS JIT.")
|
option(USE_VTUNE "Plug VTUNE to profile GS JIT.")
|
||||||
|
option(PACKAGE_MODE "Use this option to ease packaging of PCSX2 (developer/distribution option)")
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Graphical option
|
# Graphical option
|
||||||
|
@ -199,6 +202,15 @@ if(MSVC)
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(PACKAGE_MODE)
|
||||||
|
file(RELATIVE_PATH relative_datadir ${CMAKE_INSTALL_FULL_BINDIR} ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2)
|
||||||
|
|
||||||
|
# Compile all source codes with those defines
|
||||||
|
list(APPEND PCSX2_DEFS
|
||||||
|
PCSX2_APP_DATADIR="${relative_datadir}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(USE_VTUNE)
|
if(USE_VTUNE)
|
||||||
list(APPEND PCSX2_DEFS ENABLE_VTUNE)
|
list(APPEND PCSX2_DEFS ENABLE_VTUNE)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1282,6 +1282,16 @@ function(setup_main_executable target)
|
||||||
install(CODE "file(WRITE \"${CMAKE_SOURCE_DIR}/bin/qt.conf\" \"[Paths]\\nPlugins = ./QtPlugins\")")
|
install(CODE "file(WRITE \"${CMAKE_SOURCE_DIR}/bin/qt.conf\" \"[Paths]\\nPlugins = ./QtPlugins\")")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
if (PACKAGE_MODE)
|
||||||
|
install(TARGETS pcsx2-qt DESTINATION ${CMAKE_INSTALL_FULL_BINDIR})
|
||||||
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/resources DESTINATION ${CMAKE_INSTALL_FULL_DATADIR}/PCSX2)
|
||||||
|
else()
|
||||||
|
install(TARGETS pcsx2-qt DESTINATION ${CMAKE_SOURCE_DIR}/bin)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
if(CMAKE_GENERATOR MATCHES "Xcode")
|
if(CMAKE_GENERATOR MATCHES "Xcode")
|
||||||
# If we're generating an xcode project, you can just add the shaders to the main pcsx2 target and xcode will deal with them properly
|
# If we're generating an xcode project, you can just add the shaders to the main pcsx2 target and xcode will deal with them properly
|
||||||
|
|
|
@ -1871,8 +1871,12 @@ void EmuFolders::SetAppRoot()
|
||||||
bool EmuFolders::SetResourcesDirectory()
|
bool EmuFolders::SetResourcesDirectory()
|
||||||
{
|
{
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
|
#ifndef PCSX2_APP_DATADIR
|
||||||
// On Windows/Linux, these are in the binary directory.
|
// On Windows/Linux, these are in the binary directory.
|
||||||
Resources = Path::Combine(AppRoot, "resources");
|
Resources = Path::Combine(AppRoot, "resources");
|
||||||
|
#else
|
||||||
|
Resources = Path::Canonicalize(Path::Combine(AppRoot, PCSX2_APP_DATADIR "/resources"));
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
// On macOS, this is in the bundle resources directory.
|
// On macOS, this is in the bundle resources directory.
|
||||||
Resources = Path::Canonicalize(Path::Combine(AppRoot, "../Resources"));
|
Resources = Path::Canonicalize(Path::Combine(AppRoot, "../Resources"));
|
||||||
|
|
Loading…
Reference in New Issue