* use the standard 3 step flow: cmake, make, make install
* Remove L10N_PORTABLE option, superseeded by PACKAGE_MODE
* Extend PACKAGE_MODE to select the install directory (FHS or local bin)


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4805 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut@gmail.com 2011-07-14 09:02:37 +00:00
parent 3eef469dfb
commit 83b3ac85d3
15 changed files with 81 additions and 68 deletions

View File

@ -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)

View File

@ -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})

View File

@ -634,9 +634,6 @@ include_directories(.
x86
${CMAKE_BINARY_DIR}/pcsx2)
# set runtime output directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
# add executable
add_executable(${Output}
${Common}
@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)