cmake: add a new option to select the doc path in package mode

DOC_DIR_COMPILATION=/usr/share/doc/pcsx2

close issue #402
This commit is contained in:
Gregory Hainaut 2014-12-21 16:48:41 +01:00
parent 8123b5090a
commit 0c17d67fa5
4 changed files with 29 additions and 18 deletions

View File

@ -67,23 +67,23 @@ write_svnrev_h()
# make the translation # make the translation
if(EXISTS "${CMAKE_SOURCE_DIR}/locales") if(EXISTS "${CMAKE_SOURCE_DIR}/locales")
add_subdirectory(locales) add_subdirectory(locales)
endif(EXISTS "${CMAKE_SOURCE_DIR}/locales") endif()
# make common # make common
if(common_libs) if(common_libs)
add_subdirectory(common/src/Utilities) add_subdirectory(common/src/Utilities)
add_subdirectory(common/src/x86emitter) add_subdirectory(common/src/x86emitter)
endif(common_libs) endif()
# make pcsx2 # make pcsx2
if(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core) if(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core)
add_subdirectory(pcsx2) add_subdirectory(pcsx2)
endif(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core) endif()
# make plugins # make plugins
if(EXISTS "${CMAKE_SOURCE_DIR}/plugins") if(EXISTS "${CMAKE_SOURCE_DIR}/plugins")
add_subdirectory(plugins) add_subdirectory(plugins)
endif(EXISTS "${CMAKE_SOURCE_DIR}/plugins") endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Install some files to ease package creation # Install some files to ease package creation
@ -104,4 +104,4 @@ if(PACKAGE_MODE)
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_FAQ.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_FAQ.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_Readme.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_Readme.pdf" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/pcsx2.1" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/pcsx2.1" DESTINATION "${CMAKE_INSTALL_PREFIX}/share/man/man1/")
endif(PACKAGE_MODE) endif()

View File

@ -39,19 +39,23 @@ option(GTK3_API "Use GTK3 api (experimental/wxWidget must be built with GTK3 sup
if(PACKAGE_MODE) if(PACKAGE_MODE)
if(NOT DEFINED PLUGIN_DIR) if(NOT DEFINED PLUGIN_DIR)
set(PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/lib/games/pcsx2") set(PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/lib/games/pcsx2")
endif(NOT DEFINED PLUGIN_DIR) endif()
if(NOT DEFINED GAMEINDEX_DIR) if(NOT DEFINED GAMEINDEX_DIR)
set(GAMEINDEX_DIR "${CMAKE_INSTALL_PREFIX}/share/games/pcsx2") set(GAMEINDEX_DIR "${CMAKE_INSTALL_PREFIX}/share/games/pcsx2")
endif(NOT DEFINED GAMEINDEX_DIR) endif()
if(NOT DEFINED BIN_DIR) if(NOT DEFINED BIN_DIR)
set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin") set(BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin")
endif(NOT DEFINED BIN_DIR) endif()
# Compile all source codes with these 2 defines if(NOT DEFINED DOC_DIR)
add_definitions(-DPLUGIN_DIR_COMPILATION=${PLUGIN_DIR} -DGAMEINDEX_DIR_COMPILATION=${GAMEINDEX_DIR}) set(DOC_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/pcsx2")
endif(PACKAGE_MODE) endif()
# Compile all source codes with those defines
add_definitions(-DPLUGIN_DIR_COMPILATION=${PLUGIN_DIR} -DGAMEINDEX_DIR_COMPILATION=${GAMEINDEX_DIR} -DDOC_DIR_COMPILATION=${DOC_DIR})
endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Compiler extra # Compiler extra

View File

@ -9,7 +9,7 @@ if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR " message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif(NOT TOP_CMAKE_WAS_SOURCED) endif()
# set common flags # set common flags
@ -650,20 +650,20 @@ if(Linux)
set(Platform set(Platform
${pcsx2LinuxSources} ${pcsx2LinuxSources}
${pcsx2LinuxHeaders}) ${pcsx2LinuxHeaders})
endif(Linux) endif()
# Windows # Windows
if(Windows) if(Windows)
set(Platform set(Platform
${pcsx2WindowsSources} ${pcsx2WindowsSources}
${pcsx2WindowsHeaders}) ${pcsx2WindowsHeaders})
endif(Windows) endif()
# MacOSX # MacOSX
if(MacOSX) if(MacOSX)
set(Platform set(Platform
) )
endif(MacOSX) endif()
set(pcsx2FinalSources set(pcsx2FinalSources
${Common} ${Common}
@ -703,6 +703,6 @@ endforeach()
# See issue: 1233 # See issue: 1233
if(PACKAGE_MODE) if(PACKAGE_MODE)
SET_SOURCE_FILES_PROPERTIES(gui/AppConfig.cpp PROPERTIES COMPILE_FLAGS "-Wp,-ansi,-U__STRICT_ANSI__") SET_SOURCE_FILES_PROPERTIES(gui/AppConfig.cpp PROPERTIES COMPILE_FLAGS "-Wp,-ansi,-U__STRICT_ANSI__")
endif(PACKAGE_MODE) endif()
add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}") add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}")

View File

@ -70,8 +70,15 @@ Panels::FirstTimeIntroPanel::FirstTimeIntroPanel( wxWindow* parent )
SetMinWidth( 600 ); SetMinWidth( 600 );
FastFormatUnicode faqFile; FastFormatUnicode faqFile;
faqFile.Write( L"file:///%s/Docs/PCSX2_FAQ.pdf", #ifndef DOC_DIR_COMPILATION
WX_STR(InstallFolder.ToString()) ); faqFile.Write( L"file:///%s/Docs/PCSX2_FAQ.pdf", WX_STR(InstallFolder.ToString()) );
#else
// Each linux distributions have his rules for path so we give them the possibility to
// change it with compilation flags. -- Gregory
#define xDOC_str(s) DOC_str(s)
#define DOC_str(s) #s
faqFile.Write( L"file://%s/PCSX2_FAQ.pdf", xDOC_str(DOC_DIR_COMPILATION) );
#endif
wxStaticBoxSizer& langSel = *new wxStaticBoxSizer( wxVERTICAL, this, _("Language selector") ); wxStaticBoxSizer& langSel = *new wxStaticBoxSizer( wxVERTICAL, this, _("Language selector") );