cmake: properly add detection of lzma

Code is 100% optional.

Code will allow be enabled if lzma-dev is installed at compile time
This commit is contained in:
Gregory Hainaut 2015-05-17 21:57:33 +02:00
parent 98dde32dc0
commit 5c046180a1
3 changed files with 14 additions and 3 deletions

View File

@ -7,6 +7,8 @@ find_package(BZip2)
find_package(Gettext) # translation tool find_package(Gettext) # translation tool
find_package(Git) find_package(Git)
find_package(JPEG) find_package(JPEG)
find_package(LibLZMA)
find_package(PNG)
find_package(OpenGL) find_package(OpenGL)
# The requirement of wxWidgets is checked in SelectPcsx2Plugins module # The requirement of wxWidgets is checked in SelectPcsx2Plugins module
# Does not require the module (allow to compile non-wx plugins) # Does not require the module (allow to compile non-wx plugins)

View File

@ -144,7 +144,7 @@ endif()
# requires: -OpenGL # requires: -OpenGL
# -X11 # -X11
#--------------------------------------- #---------------------------------------
if(OPENGL_FOUND AND X11_FOUND AND PNGPP_FOUND AND GTKn_FOUND AND (EGL_FOUND OR NOT EGL_API)) if(OPENGL_FOUND AND X11_FOUND AND PNGPP_FOUND AND GTKn_FOUND AND PNG_FOUND AND (EGL_FOUND OR NOT EGL_API))
set(GSdx TRUE) set(GSdx TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx") elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx")
set(GSdx FALSE) set(GSdx FALSE)

View File

@ -40,6 +40,10 @@ if(EGL_API AND EGL_FOUND)
set(GSdxFinalFlags ${GSdxFinalFlags} -DEGL_SUPPORTED) set(GSdxFinalFlags ${GSdxFinalFlags} -DEGL_SUPPORTED)
endif() endif()
if(LIBLZMA_FOUND)
set(GSdxFinalFlags ${GSdxFinalFlags} -DLZMA_SUPPORTED)
endif()
#Clang doesn't support a few common flags that GCC does. #Clang doesn't support a few common flags that GCC does.
if(NOT USE_CLANG) if(NOT USE_CLANG)
set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6) set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6)
@ -203,8 +207,7 @@ set(GSdxFinalLibs ${GSdxFinalLibs}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GTK2_LIBRARIES} ${GTK2_LIBRARIES}
${LIBC_LIBRARIES} ${LIBC_LIBRARIES}
"-lpng" # yes it sucks ${PNG_LIBRARY}
"-llzma"
) )
if(EGL_API AND EGL_FOUND) if(EGL_API AND EGL_FOUND)
@ -213,6 +216,12 @@ if(EGL_API AND EGL_FOUND)
) )
endif() endif()
if(LIBLZMA_FOUND)
set(GSdxFinalLibs ${GSdxFinalLibs}
${LIBLZMA_LIBRARIES}
)
endif()
# Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL # Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL
if (REBUILD_SHADER) if (REBUILD_SHADER)
add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl) add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)