diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 4a92d9a597..cf0ca5b973 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -12,7 +12,7 @@ # control C flags : -DUSER_CMAKE_C_FLAGS="cflags" # control C++ flags : -DUSER_CMAKE_CXX_FLAGS="cxxflags" # control link flags : -DUSER_CMAKE_LD_FLAGS="ldflags" -# Special mode to ease package: -DPACKAGE_MODE=TRUE +# Special mode to ease package: -DPACKAGE_MODE=TRUE(follow FHS)|FALSE(local bin/) #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -151,11 +151,3 @@ if (FORCE_INTERNAL_SDL) message(STATUS "Internal SDL is a development snapshot of libsdl 1.3 Crashes can be expected and no support will be provided") endif (FORCE_INTERNAL_SDL) - -#------------------------------------------------------------------------------- -# Select library system vs 3rdparty -#------------------------------------------------------------------------------- -if(NOT DEFINED L10N_PORTABLE) - set(L10N_PORTABLE TRUE) - message(STATUS "Install localization file in bin/Langs by default") -endif(NOT DEFINED L10N_PORTABLE) diff --git a/cmake/Translation.cmake b/cmake/Translation.cmake index 7078fccf8d..236cccf074 100644 --- a/cmake/Translation.cmake +++ b/cmake/Translation.cmake @@ -58,11 +58,11 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 _potFile _firstPoFileArg) COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile} DEPENDS ${_absPotFile} ${_absFile} ) - IF (L10N_PORTABLE) - INSTALL(FILES ${_gmoFile} DESTINATION ${PROJECT_SOURCE_DIR}/bin/Langs/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) - ELSE (L10N_PORTABLE) + IF (PACKAGE_MODE) INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) - ENDIF (L10N_PORTABLE) + ELSE (PACKAGE_MODE) + INSTALL(FILES ${_gmoFile} DESTINATION ${PROJECT_SOURCE_DIR}/bin/Langs/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) + ENDIF (PACKAGE_MODE) SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) diff --git a/pcsx2/CMakeLists.txt b/pcsx2/CMakeLists.txt index 183c639221..ecb95ade57 100644 --- a/pcsx2/CMakeLists.txt +++ b/pcsx2/CMakeLists.txt @@ -632,10 +632,7 @@ endif(MacOSX) include_directories(. gui x86 - ${CMAKE_BINARY_DIR}/pcsx2) - -# set runtime output directory -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin) + ${CMAKE_BINARY_DIR}/pcsx2) # add executable add_executable(${Output} @@ -676,3 +673,9 @@ target_link_libraries(${Output} ${ZLIB_LIBRARIES}) if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION bin) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin) +endif(PACKAGE_MODE) diff --git a/plugins/CDVDiso/src/CMakeLists.txt b/plugins/CDVDiso/src/CMakeLists.txt index 1fb3fe162e..4abfabfb7d 100644 --- a/plugins/CDVDiso/src/CMakeLists.txt +++ b/plugins/CDVDiso/src/CMakeLists.txt @@ -73,10 +73,6 @@ add_library(${Output} SHARED ${CDVDisoLinuxSources} ${CDVDisoLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # Link with bz2 target_link_libraries(${Output} ${BZIP2_LIBRARIES}) @@ -84,3 +80,9 @@ target_link_libraries(${Output} ${BZIP2_LIBRARIES}) if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/CDVDnull/CMakeLists.txt b/plugins/CDVDnull/CMakeLists.txt index 8d063d22a1..297a2bcde8 100644 --- a/plugins/CDVDnull/CMakeLists.txt +++ b/plugins/CDVDnull/CMakeLists.txt @@ -63,11 +63,13 @@ add_library(${Output} SHARED ${CDVDnullHeaders} ) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # User flags options if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/FWnull/CMakeLists.txt b/plugins/FWnull/CMakeLists.txt index f9c9943509..2301fb0b55 100644 --- a/plugins/FWnull/CMakeLists.txt +++ b/plugins/FWnull/CMakeLists.txt @@ -75,11 +75,13 @@ add_library(${Output} SHARED ${FWnullLinuxSources} ${FWnullLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # User flags options if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 06674b57bc..f66acb66e2 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -176,10 +176,6 @@ add_library(${Output} SHARED ${GSdxHeaders} ) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # link target with X11 target_link_libraries(${Output} ${X11_LIBRARIES}) @@ -190,3 +186,9 @@ target_link_libraries(${Output} ${SDL_LIBRARY}) if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/PadNull/CMakeLists.txt b/plugins/PadNull/CMakeLists.txt index a5d11495cb..5e195f3e57 100644 --- a/plugins/PadNull/CMakeLists.txt +++ b/plugins/PadNull/CMakeLists.txt @@ -77,11 +77,13 @@ add_library(${Output} SHARED ${PadNullLinuxSources} ${PadNullLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # User flags options if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/SPU2null/CMakeLists.txt b/plugins/SPU2null/CMakeLists.txt index 4f0bdad78b..8633ba7c8e 100644 --- a/plugins/SPU2null/CMakeLists.txt +++ b/plugins/SPU2null/CMakeLists.txt @@ -74,11 +74,13 @@ add_library(${Output} SHARED ${SPU2nullLinuxSources} ${SPU2nullLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # User flags options if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/USBnull/CMakeLists.txt b/plugins/USBnull/CMakeLists.txt index 587ab3a03b..ff3154a7ce 100644 --- a/plugins/USBnull/CMakeLists.txt +++ b/plugins/USBnull/CMakeLists.txt @@ -76,11 +76,13 @@ add_library(${Output} SHARED ${USBnullLinuxSources} ${USBnullLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # User flags options if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/dev9null/CMakeLists.txt b/plugins/dev9null/CMakeLists.txt index d3150a4872..4005fb84cb 100644 --- a/plugins/dev9null/CMakeLists.txt +++ b/plugins/dev9null/CMakeLists.txt @@ -73,11 +73,13 @@ add_library(${Output} SHARED ${dev9nullLinuxSources} ${dev9nullLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # User flags options if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/onepad/CMakeLists.txt b/plugins/onepad/CMakeLists.txt index 831e8f01ab..bf3da05eec 100644 --- a/plugins/onepad/CMakeLists.txt +++ b/plugins/onepad/CMakeLists.txt @@ -82,10 +82,6 @@ add_library(${Output} SHARED ${onepadLinuxSources} ${onepadLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # link target with SDL target_link_libraries(${Output} ${SDL_LIBRARY}) @@ -93,3 +89,9 @@ target_link_libraries(${Output} ${SDL_LIBRARY}) if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/spu2-x/src/CMakeLists.txt b/plugins/spu2-x/src/CMakeLists.txt index f2e54569cb..cf377041ba 100644 --- a/plugins/spu2-x/src/CMakeLists.txt +++ b/plugins/spu2-x/src/CMakeLists.txt @@ -108,10 +108,6 @@ add_library(${Output} SHARED ${spu2xLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - # link target with project internal libraries target_link_libraries(${Output} Utilities Utilities) @@ -128,3 +124,9 @@ target_link_libraries(${Output} ${SOUNDTOUCH_LIBRARIES}) if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/plugins/zzogl-pg/opengl/CMakeLists.txt b/plugins/zzogl-pg/opengl/CMakeLists.txt index 1ed03278fc..14d68f9354 100644 --- a/plugins/zzogl-pg/opengl/CMakeLists.txt +++ b/plugins/zzogl-pg/opengl/CMakeLists.txt @@ -144,15 +144,6 @@ add_library(${Output} SHARED ${zzoglLinuxSources} ${zzoglLinuxHeaders}) -# set output directory -set_target_properties(${Output} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin/plugins) - -# WARNING can conflict with zerogs plugin -# copy ps2hw.dat to plugins folder -add_custom_command(TARGET ${Output} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat ${PROJECT_SOURCE_DIR}/bin/plugins) - # link target with project internal libraries target_link_libraries(${Output} Utilities) @@ -175,3 +166,11 @@ target_link_libraries(${Output} ${JPEG_LIBRARIES}) if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") target_link_libraries(${Output} "${USER_CMAKE_LD_FLAGS}") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") + +if(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION lib/games/pcsx2) + install(FILES ${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION share/games/pcsx2/shaders) +else(PACKAGE_MODE) + install(TARGETS ${Output} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) + install(FILES ${PROJECT_SOURCE_DIR}/plugins/zzogl-pg/opengl/ps2hw.dat DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) +endif(PACKAGE_MODE) diff --git a/tools/bin2cpp/CMakeLists.txt b/tools/bin2cpp/CMakeLists.txt index 8ccb025aba..e2ceb0603a 100644 --- a/tools/bin2cpp/CMakeLists.txt +++ b/tools/bin2cpp/CMakeLists.txt @@ -32,6 +32,5 @@ set(bin2cppHeaders add_executable(${bin2cppName} ${bin2cppSources} ${bin2cppHeaders}) # set output directory -set_target_properties(${bin2cppName} PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/tools/bin) +# set_target_properties(${bin2cppName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/tools/bin)