* add some check on libsparsehash
* print more informative message when a depency miss


git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3256 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2010-06-21 11:05:30 +00:00
parent 900c3105c8
commit 3628784ab6
4 changed files with 53 additions and 13 deletions

View File

@ -0,0 +1,18 @@
# Try to find SparseHash
# Once done, this will define
#
# SPARSEHASH_FOUND - system has SparseHash
# SPARSEHASH_INCLUDE_DIR - the SparseHash include directories
if(SPARSEHASH_INCLUDE_DIR)
set(SPARSEHASH_FIND_QUIETLY TRUE)
endif(SPARSEHASH_INCLUDE_DIR)
find_path(SPARSEHASH_INCLUDE_DIR google/sparsehash/sparsehashtable.h)
# handle the QUIETLY and REQUIRED arguments and set SPARSEHASH_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SparseHash DEFAULT_MSG SPARSEHASH_INCLUDE_DIR)
mark_as_advanced(SPARSEHASH_INCLUDE_DIR)

View File

@ -28,6 +28,7 @@ include(FindCg)
include(FindGlew)
include(FindPortAudio)
include(FindSoundTouch)
include(FindSparseHash)
# Note for include_directory: The order is important to avoid a mess between include file from your system and the one of pcsx2
# If you include first 3rdparty, all 3rdpary include will have a higer priority...
@ -118,13 +119,10 @@ if(SOUNDTOUCH_FOUND AND NOT projectSoundTouch)
include_directories(${SOUNDTOUCH_INCLUDE_DIR})
endif(SOUNDTOUCH_FOUND AND NOT projectSoundTouch)
# Note: subversion it only used to detect the current revision of your build
# Subversion optional
if(Subversion_FOUND)
set(SVN TRUE)
else(Subversion_FOUND)
set(SVN FALSE)
endif(Subversion_FOUND)
# SPARSEHASH
if(SPARSEHASH_FOUND)
include_directories(${SPARSEHASH_INCLUDE_DIR})
endif(SPARSEHASH_FOUND)
# Wx
if(wxWidgets_FOUND)

View File

@ -1,3 +1,16 @@
#-------------------------------------------------------------------------------
# Dependency message print
#-------------------------------------------------------------------------------
set(msg_dep_common_libs "check these libraries -> wxWidgets (>=2.8.10), sparsehash (>=1.5)")
set(msg_dep_pcsx2 "check these libraries -> wxWidgets (>=2.8.10), gtk2 (>=2.16), zlib (>=1.2.4), pcsx2 common libs")
set(msg_dep_cdvdiso "check these libraries -> bzip2 (>=1.0.5)")
set(msg_dep_zerogs "check these libraries -> glew (>=1.5), opengl, X11, nvidia-cg-toolkit (>=2.1)")
set(msg_dep_zzogl "check these libraries -> glew (>=1.5), opengl, X11, nvidia-cg-toolkit (>=2.1), pcsx2 common libs")
set(msg_dep_onepad "check these libraries -> sdl (>=1.2)")
set(msg_dep_zeropad "check these libraries -> sdl (>=1.2)")
set(msg_dep_spu2x "check these libraries -> soundtouch (>=1.5), alsa, portaudio (>=1.9), a52 (>= 0.7.4), pcsx2 common libs")
set(msg_dep_zerospu2 "check these libraries -> soundtouch (>=1.5), alsa")
#-------------------------------------------------------------------------------
# Pcsx2 core & common libs
#-------------------------------------------------------------------------------
@ -8,13 +21,15 @@
#---------------------------------------
# Common libs
# requires: -wx
# -sparsehash
#---------------------------------------
if(wxWidgets_FOUND)
if(wxWidgets_FOUND AND SPARSEHASH_FOUND)
set(common_libs TRUE)
else(wxWidgets_FOUND)
else(wxWidgets_FOUND AND SPARSEHASH_FOUND)
set(common_libs FALSE)
message(STATUS "Skip build of common libraries: miss some dependencies")
endif(wxWidgets_FOUND)
message(STATUS "${msg_dep_common_libs}")
endif(wxWidgets_FOUND AND SPARSEHASH_FOUND)
#---------------------------------------
# Pcsx2 core
@ -29,11 +44,13 @@ if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs)
else(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs)
set(pcsx2_core FALSE)
message(STATUS "Skip build of pcsx2 core: miss some dependencies")
message(STATUS "${msg_dep_pcsx2}")
endif(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs)
# Linux need also gtk2
if(Linux AND NOT GTK2_FOUND)
set(pcsx2_core FALSE)
message(STATUS "Skip build of pcsx2 core: miss some dependencies")
message(STATUS "${msg_dep_pcsx2}")
endif(Linux AND NOT GTK2_FOUND)
@ -61,6 +78,7 @@ if(BZIP2_FOUND)
else(BZIP2_FOUND)
set(CDVDiso FALSE)
message(STATUS "Skip build of CDVDiso: miss some dependencies")
message(STATUS "${msg_dep_cdvdiso}")
endif(BZIP2_FOUND)
#---------------------------------------
@ -94,6 +112,7 @@ if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
else(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
set(zerogs FALSE)
message(STATUS "Skip build of zerogs: miss some dependencies")
message(STATUS "${msg_dep_zerogs}")
endif(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
#---------------------------------------
@ -111,6 +130,7 @@ if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND AND common_libs)
else(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND AND common_libs)
set(zzogl FALSE)
message(STATUS "Skip build of zzogl: miss some dependencies")
message(STATUS "${msg_dep_zzogl}")
endif(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND AND common_libs)
#---------------------------------------
@ -130,6 +150,7 @@ if(SDL_FOUND)
else(SDL_FOUND)
set(onepad FALSE)
message(STATUS "Skip build of onepad: miss some dependencies")
message(STATUS "${msg_dep_onepad}")
endif(SDL_FOUND)
#---------------------------------------
@ -143,6 +164,7 @@ if(SDL_FOUND)
else(SDL_FOUND)
set(zeropad FALSE)
message(STATUS "Skip build of zeropad: miss some dependencies")
message(STATUS "${msg_dep_zeropad}")
endif(SDL_FOUND)
#---------------------------------------
@ -166,6 +188,7 @@ if(A52_FOUND AND ALSA_FOUND AND PORTAUDIO_FOUND AND SOUNDTOUCH_FOUND AND common_
else(A52_FOUND AND ALSA_FOUND AND PORTAUDIO_FOUND AND SOUNDTOUCH_FOUND AND common_libs)
set(spu2-x FALSE)
message(STATUS "Skip build of spu2-x: miss some dependencies")
message(STATUS "${msg_dep_spu2x}")
endif(A52_FOUND AND ALSA_FOUND AND PORTAUDIO_FOUND AND SOUNDTOUCH_FOUND AND common_libs)
#---------------------------------------
@ -181,6 +204,7 @@ if(SOUNDTOUCH_FOUND AND ALSA_FOUND)
else(SOUNDTOUCH_FOUND AND ALSA_FOUND)
set(zerospu2 FALSE)
message(STATUS "Skip build of zerospu2: miss some dependencies")
message(STATUS "${msg_dep_zerospu2}")
endif(SOUNDTOUCH_FOUND AND ALSA_FOUND)
#---------------------------------------

View File

@ -104,16 +104,16 @@ if(CMAKE_BUILD_TYPE STREQUAL Release)
endif(CMAKE_BUILD_TYPE STREQUAL Release)
# you must have both svn client executable and a source that contains svn metadata
if((SVN) AND (EXISTS "${CMAKE_SOURCE_DIR}/.svn"))
if(Suvbersion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn")
# execute subversion
Subversion_WC_INFO(${CMAKE_SOURCE_DIR} tmpvar)
# write svnrev.h
file(WRITE ${CMAKE_BINARY_DIR}/pcsx2/svnrev.h "#define SVN_REV ${tmpvar_WC_REVISION} \n#define SVN_MODS 0")
else((SVN) AND (EXISTS "${CMAKE_SOURCE_DIR}/.svn"))
else(Suvbersion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn")
# write svnrev.h
file(WRITE ${CMAKE_BINARY_DIR}/pcsx2/svnrev.h "#define SVN_REV 0 \n#define SVN_MODS 0")
endif((SVN) AND (EXISTS "${CMAKE_SOURCE_DIR}/.svn"))
endif(Suvbersion_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.svn")
# variable with sources of this executable
set(pcsx2Sources