cmake: add a PACKAGE_MODE option to reduce the burden of packaging

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4289 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut@gmail.com 2011-02-12 10:37:44 +00:00
parent 77f392edac
commit db948003df
4 changed files with 30 additions and 23 deletions

View File

@ -9,15 +9,18 @@ set(TOP_CMAKE_WAS_SOURCED TRUE)
# Print a clear message that 64bits is not supported # Print a clear message that 64bits is not supported
# It would avoid compilation failure later. # It would avoid compilation failure later.
if(CMAKE_SIZEOF_VOID_P MATCHES "8") # Note: disable the failure in package mode
message(FATAL_ERROR " if(NOT PACKAGE_MODE)
PCSX2 does not support 64bits environment. Please install a 32bits chroot or a 32bits OS. if(CMAKE_SIZEOF_VOID_P MATCHES "8")
PCSX2 have neither no plan to support the 64bits architecture in the future. message(FATAL_ERROR "
It will need a complete rewrite of the core emulator and a lots of time PCSX2 does not support 64bits environment. Please install a 32bits chroot or a 32bits OS.
PCSX2 have neither no plan to support the 64bits architecture in the future.
However when linux distribution will support properly multi-arch package, it will It will need a complete rewrite of the core emulator and a lots of time
be at least possible to easily compile and install PCSX2 witout too much hassle (the chroot environment)")
endif(CMAKE_SIZEOF_VOID_P MATCHES "8") However when linux distribution will support properly multi-arch package, it will
be at least possible to easily compile and install PCSX2 witout too much hassle (the chroot environment)")
endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
endif(NOT PACKAGE_MODE)
# set module path # set module path

View File

@ -11,6 +11,7 @@
# control C flags : -DUSER_CMAKE_C_FLAGS="cflags" # control C flags : -DUSER_CMAKE_C_FLAGS="cflags"
# control C++ flags : -DUSER_CMAKE_CXX_FLAGS="cxxflags" # control C++ flags : -DUSER_CMAKE_CXX_FLAGS="cxxflags"
# control link flags : -DUSER_CMAKE_LD_FLAGS="ldflags" # control link flags : -DUSER_CMAKE_LD_FLAGS="ldflags"
# Special mode to ease package: -DPACKAGE_MODE=TRUE
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -114,6 +115,13 @@ endif(DEFINED USER_CMAKE_CXX_FLAGS)
# Use some default machine flags # Use some default machine flags
string(STRIP "${CMAKE_CXX_FLAGS} -m32 -msse -msse2 -march=i686 -pthread" CMAKE_CXX_FLAGS) string(STRIP "${CMAKE_CXX_FLAGS} -m32 -msse -msse2 -march=i686 -pthread" CMAKE_CXX_FLAGS)
#-------------------------------------------------------------------------------
# By default use the standard compilation mode
#-------------------------------------------------------------------------------
if(NOT DEFINED PACKAGE_MODE)
set(PACKAGE_MODE FALSE)
endif(NOT DEFINED PACKAGE_MODE)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Select library system vs 3rdparty # Select library system vs 3rdparty
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View File

@ -61,7 +61,7 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 _potFile _firstPoFileArg)
IF (L10N_PORTABLE) IF (L10N_PORTABLE)
INSTALL(FILES ${_gmoFile} DESTINATION ${PROJECT_SOURCE_DIR}/bin/Langs/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) INSTALL(FILES ${_gmoFile} DESTINATION ${PROJECT_SOURCE_DIR}/bin/Langs/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
ELSE (L10N_PORTABLE) ELSE (L10N_PORTABLE)
INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) INSTALL(FILES ${_gmoFile} DESTINATION share/locale/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
ENDIF (L10N_PORTABLE) ENDIF (L10N_PORTABLE)
SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) SET(_gmoFiles ${_gmoFiles} ${_gmoFile})

View File

@ -69,34 +69,30 @@ set(OptimizationFlags
# Debug - Build # Debug - Build
if(CMAKE_BUILD_TYPE STREQUAL Debug) if(CMAKE_BUILD_TYPE STREQUAL Debug)
set(Output pcsx2-dbg)
# executable name
set(Output pcsx2-dbg)
# add defines
add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP) add_definitions(${CommonFlags} ${DebugFlags} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -DWX_PRECOMP)
endif(CMAKE_BUILD_TYPE STREQUAL Debug) endif(CMAKE_BUILD_TYPE STREQUAL Debug)
# Devel - Build # Devel - Build
if(CMAKE_BUILD_TYPE STREQUAL Devel) if(CMAKE_BUILD_TYPE STREQUAL Devel)
# executable name
set(Output pcsx2-dev) set(Output pcsx2-dev)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD -DWX_PRECOMP -DNDEBUG) add_definitions(${CommonFlags} ${OptimizationFlags} -DPCSX2_DEVBUILD -DWX_PRECOMP -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Devel) endif(CMAKE_BUILD_TYPE STREQUAL Devel)
# Release - Build # Release - Build
if(CMAKE_BUILD_TYPE STREQUAL Release) if(CMAKE_BUILD_TYPE STREQUAL Release)
# executable name
set(Output pcsx2) set(Output pcsx2)
# add defines
add_definitions(${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG) add_definitions(${CommonFlags} ${OptimizationFlags} -DWX_PRECOMP -DNDEBUG)
endif(CMAKE_BUILD_TYPE STREQUAL Release) endif(CMAKE_BUILD_TYPE STREQUAL Release)
# In package mode always use pcsx2
if(PACKAGE_MODE)
set(Output pcsx2)
endif(PACKAGE_MODE)
# you must have both svn client executable and a source that contains svn metadata # you must have both svn client executable and a source that contains svn metadata
if(Subversion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn") if(Subversion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn")
# execute subversion # execute subversion