cmake: git compilation issue + useless warning message

* avoid compilation failure when git -C isn't supported
* don't print missing dependency when EXTRA_PLUGINS isn't activated
* sed /endif(.*)/endif/ because I don't like it
This commit is contained in:
Gregory Hainaut 2014-04-17 20:24:12 +02:00
parent e39db3f9ad
commit c37d9c10f7
6 changed files with 74 additions and 79 deletions

View File

@ -92,7 +92,7 @@ set(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
# Set some default compiler flags
#-------------------------------------------------------------------------------
set(DEFAULT_WARNINGS "-Wno-write-strings -Wno-format -Wno-unused-parameter -Wno-unused-value -Wstrict-aliasing -Wno-unused-function -Wno-attributes -Wno-unused-result -Wno-missing-field-initializers -Wno-unused-local-typedefs -Wno-parentheses")
set (HARDEING_OPT "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security")
set(HARDEING_OPT "-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security")
set(DEFAULT_GCC_FLAG "-m32 -msse -msse2 -march=i686 -pthread ${DEFAULT_WARNINGS} ${HARDEING_OPT}")
if(CMAKE_BUILD_TYPE MATCHES "Debug|Devel")
set(DEFAULT_GCC_FLAG "-g ${DEFAULT_GCC_FLAG}")

View File

@ -46,7 +46,12 @@ function(write_svnrev_h)
string(REGEX REPLACE "[%:\\-]" "" tmpvar_WC_INFO "${tmpvar_WC_INFO}")
string(REGEX REPLACE "([0-9]+) ([0-9]+).*" "\\1\\2" tmpvar_WC_INFO "${tmpvar_WC_INFO}")
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${tmpvar_WC_INFO}ll \n#define SVN_MODS 0")
if ("${tmpvar_WC_INFO}" STREQUAL "")
# For people with an older GIT version that migth not support '-C'
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV 0ll \n#define SVN_MODS 0")
else()
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${tmpvar_WC_INFO}ll \n#define SVN_MODS 0")
endif()
else()
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV_UNKNOWN\n#define SVN_REV 0ll \n#define SVN_MODS 0")
endif()

View File

@ -18,11 +18,11 @@ if(Linux)
set(GTK2_INCLUDE_DIRS "${GDK_PIXBUF_INCLUDE_DIRS}" "${GTK2_INCLUDE_DIRS}")
# Remove duplicates when cmake will be fixed
list(REMOVE_DUPLICATES GTK2_INCLUDE_DIRS)
endif (GDK_PIXBUF_INCLUDE_DIRS)
endif(GTK2_FOUND)
endif()
endif()
find_package(X11)
endif(Linux)
endif()
## Use cmake package to find module
find_package(ALSA)
@ -54,7 +54,7 @@ include(FindAio)
## Include cg because of zzogl-cg and zerogs
#if(NOT GLSL_API)
include(FindCg)
#endif(NOT GLSL_API)
#endif()
include(FindEGL)
include(FindGLES2)
include(FindGlew)
@ -80,12 +80,12 @@ include(FindSparseHash)
if(Linux)
if(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
endif(GTK2_FOUND)
endif()
if(X11_FOUND)
include_directories(${X11_INCLUDE_DIR})
endif(X11_FOUND)
endif(Linux)
endif()
endif()
if(AIO_FOUND)
include_directories(${AIO_INCLUDE_DIR})
@ -93,15 +93,15 @@ endif()
if(ALSA_FOUND)
include_directories(${ALSA_INCLUDE_DIRS})
endif(ALSA_FOUND)
endif()
if(BZIP2_FOUND)
include_directories(${BZIP2_INCLUDE_DIR})
endif(BZIP2_FOUND)
endif()
if(CG_FOUND)
include_directories(${CG_INCLUDE_DIRS})
endif(CG_FOUND)
endif()
if (EGL_FOUND)
include_directories(${EGL_INCLUDE_DIR})
@ -109,11 +109,11 @@ endif()
if(JPEG_FOUND)
include_directories(${JPEG_INCLUDE_DIR})
endif(JPEG_FOUND)
endif()
if(GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIR})
endif(GLEW_FOUND)
endif()
if(GLESV2_FOUND)
include_directories(${GLESV2_INCLUDE_DIR})
@ -121,28 +121,23 @@ endif()
if(OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
endif(OPENGL_FOUND)
endif()
if(PORTAUDIO_FOUND)
include_directories(${PORTAUDIO_INCLUDE_DIR})
endif(PORTAUDIO_FOUND)
endif()
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
endif(SDL_FOUND)
endif()
if(SOUNDTOUCH_FOUND)
include_directories(${SOUNDTOUCH_INCLUDE_DIR})
endif(SOUNDTOUCH_FOUND)
endif()
if(SPARSEHASH_FOUND)
include_directories(${SPARSEHASH_INCLUDE_DIR})
endif(SPARSEHASH_FOUND)
if(SPARSEHASH_NEW_FOUND)
include_directories(${SPARSEHASH_NEW_INCLUDE_DIR})
# allow to build parts that depend on sparsehash
set(SPARSEHASH_FOUND TRUE)
endif(SPARSEHASH_NEW_FOUND)
endif()
if(wxWidgets_FOUND)
if(Linux)
@ -163,7 +158,7 @@ if(wxWidgets_FOUND)
endif (EXISTS "/usr/lib/wx")
# Multiarch ubuntu/debian
STRING(REGEX REPLACE "/usr/lib/x86_64-linux-gnu" "/usr/lib/i386-linux-gnu" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
endif()
# Some people are trying to compile with wx 3.0 ...
### 3.0
@ -178,11 +173,11 @@ if(wxWidgets_FOUND)
STRING(REGEX REPLACE "3\\.0" "2.8" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}")
STRING(REGEX REPLACE "3\\.0" "2.8" wxWidgets_LIBRARIES "${wxWidgets_LIBRARIES}")
endif()
endif(Linux)
endif()
include(${wxWidgets_USE_FILE})
endif(wxWidgets_FOUND)
endif()
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
endif(ZLIB_FOUND)
endif()

View File

@ -13,7 +13,7 @@ if(GLSL_API)
set(msg_dep_zzogl "check these libraries -> glew (>=1.6), jpeg (>=6.2), opengl, X11, pcsx2 common libs")
else(GLSL_API)
set(msg_dep_zzogl "check these libraries -> glew (>=1.6), jpeg (>=6.2), opengl, X11, nvidia-cg-toolkit (>=2.1), pcsx2 common libs")
endif(GLSL_API)
endif()
#-------------------------------------------------------------------------------
# Pcsx2 core & common libs
@ -31,11 +31,11 @@ if(wxWidgets_FOUND AND SPARSEHASH_FOUND)
set(common_libs TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/common/src")
set(common_libs FALSE)
else(wxWidgets_FOUND AND SPARSEHASH_FOUND)
else()
set(common_libs FALSE)
message(STATUS "Skip build of common libraries: miss some dependencies")
message(STATUS "${msg_dep_common_libs}")
endif(wxWidgets_FOUND AND SPARSEHASH_FOUND)
endif()
#---------------------------------------
# Pcsx2 core
@ -76,7 +76,7 @@ endif()
#---------------------------------------
if(GTK2_FOUND)
set(CDVDnull TRUE)
endif(GTK2_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -85,21 +85,23 @@ endif(GTK2_FOUND)
# requires: -BZip2
# -gtk2 (linux)
#---------------------------------------
if(BZIP2_FOUND AND GTK2_FOUND AND EXTRA_PLUGINS)
set(CDVDiso TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDiso")
set(CDVDiso FALSE)
else()
set(CDVDiso FALSE)
message(STATUS "Skip build of CDVDiso: miss some dependencies")
message(STATUS "${msg_dep_cdvdiso}")
if(EXTRA_PLUGINS)
if(BZIP2_FOUND AND GTK2_FOUND)
set(CDVDiso TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/CDVDiso")
set(CDVDiso FALSE)
else()
set(CDVDiso FALSE)
message(STATUS "Skip build of CDVDiso: miss some dependencies")
message(STATUS "${msg_dep_cdvdiso}")
endif()
endif()
#---------------------------------------
# CDVDlinuz
#---------------------------------------
if(EXTRA_PLUGINS)
set(CDVDlinuz TRUE)
set(CDVDlinuz TRUE)
endif()
#---------------------------------------
@ -107,7 +109,7 @@ endif()
#---------------------------------------
if(GTK2_FOUND)
set(dev9null TRUE)
endif(GTK2_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -115,7 +117,7 @@ endif(GTK2_FOUND)
#---------------------------------------
if(GTK2_FOUND)
set(FWnull TRUE)
endif(GTK2_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -136,11 +138,11 @@ if(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND)
set(GSdx TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx")
set(GSdx FALSE)
else(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND)
else()
set(GSdx FALSE)
message(STATUS "Skip build of GSdx: miss some dependencies")
message(STATUS "${msg_dep_gsdx}")
endif(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -151,14 +153,16 @@ endif(OPENGL_FOUND AND X11_FOUND AND EGL_FOUND)
# -X11
# -CG
#---------------------------------------
if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND AND EXTRA_PLUGINS)
set(zerogs TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerogs")
set(zerogs FALSE)
else()
set(zerogs FALSE)
message(STATUS "Skip build of zerogs: miss some dependencies")
message(STATUS "${msg_dep_zerogs}")
if(EXTRA_PLUGINS)
if(GLEW_FOUND AND OPENGL_FOUND AND X11_FOUND AND CG_FOUND)
set(zerogs TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerogs")
set(zerogs FALSE)
else()
set(zerogs FALSE)
message(STATUS "Skip build of zerogs: miss some dependencies")
message(STATUS "${msg_dep_zerogs}")
endif()
endif()
#---------------------------------------
@ -209,11 +213,11 @@ if(SDL_FOUND)
set(onepad TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/onepad")
set(onepad FALSE)
else(SDL_FOUND)
else()
set(onepad FALSE)
message(STATUS "Skip build of onepad: miss some dependencies")
message(STATUS "${msg_dep_onepad}")
endif(SDL_FOUND)
endif()
#---------------------------------------
#---------------------------------------
@ -251,17 +255,19 @@ endif()
# -ALSA
# -PortAudio
#---------------------------------------
if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND AND EXTRA_PLUGINS)
set(zerospu2 TRUE)
# Comment the next line, if you want to compile zerospu2
set(zerospu2 FALSE)
message(STATUS "Don't build zerospu2. It is super-seeded by spu2x")
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2")
set(zerospu2 FALSE)
else()
set(zerospu2 FALSE)
message(STATUS "Skip build of zerospu2: miss some dependencies")
message(STATUS "${msg_dep_zerospu2}")
if(EXTRA_PLUGINS)
if(EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2" AND SOUNDTOUCH_FOUND AND ALSA_FOUND)
set(zerospu2 TRUE)
# Comment the next line, if you want to compile zerospu2
set(zerospu2 FALSE)
message(STATUS "Don't build zerospu2. It is super-seeded by spu2x")
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/zerospu2")
set(zerospu2 FALSE)
else()
set(zerospu2 FALSE)
message(STATUS "Skip build of zerospu2: miss some dependencies")
message(STATUS "${msg_dep_zerospu2}")
endif()
endif()
#---------------------------------------
@ -270,7 +276,7 @@ endif()
#---------------------------------------
if(GTK2_FOUND)
set(USBnull TRUE)
endif(GTK2_FOUND)
endif()
#---------------------------------------
#-------------------------------------------------------------------------------

View File

@ -20,10 +20,6 @@ set(CommonFlags
-pipe
-Wunused-variable)
if (SPARSEHASH_NEW_FOUND)
set(CommonFlags "${CommonFlags} -DSPARSEHASH_NEW_INCLUDE_DIR ")
endif (SPARSEHASH_NEW_FOUND)
# set warning flags
set(DebugFlags
-g

View File

@ -22,10 +22,6 @@ set(CommonFlags
-std=c++0x
-pipe)
if (SPARSEHASH_NEW_FOUND)
set(CommonFlags "${CommonFlags} -DSPARSEHASH_NEW_INCLUDE_DIR ")
endif (SPARSEHASH_NEW_FOUND)
# set warning flags
set(DebugFlags
-W
@ -684,10 +680,7 @@ foreach(res_file IN ITEMS
ConfigIcon_Appearance ConfigIcon_Cpu ConfigIcon_Gamefixes ConfigIcon_MemoryCard
ConfigIcon_Paths ConfigIcon_Plugins ConfigIcon_Speedhacks ConfigIcon_Video Breakpoint_Active Breakpoint_Inactive)
add_custom_command(OUTPUT "${res_bin}/${res_file}.h" COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${res_src}/${res_file}.png" "${res_bin}/${res_file}" )
endforeach(res_file IN ITEMS
AppIcon16 AppIcon32 AppIcon64 BackgroundLogo ButtonIcon_Camera
ConfigIcon_Appearance ConfigIcon_Cpu ConfigIcon_Gamefixes ConfigIcon_MemoryCard
ConfigIcon_Paths ConfigIcon_Plugins ConfigIcon_Speedhacks ConfigIcon_Video Breakpoint_Active Breakpoint_Inactive)
endforeach()
# Suppress all the system-specific predefined macros outside the reserved namespace.
# Needed when stringifying macros.