From 5c046180a1dcd49c165b48b72d069dab7a93dd42 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 17 May 2015 21:57:33 +0200 Subject: [PATCH] cmake: properly add detection of lzma Code is 100% optional. Code will allow be enabled if lzma-dev is installed at compile time --- cmake/SearchForStuff.cmake | 2 ++ cmake/SelectPcsx2Plugins.cmake | 2 +- plugins/GSdx/CMakeLists.txt | 13 +++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 349edf2b96..487d660e01 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -7,6 +7,8 @@ find_package(BZip2) find_package(Gettext) # translation tool find_package(Git) find_package(JPEG) +find_package(LibLZMA) +find_package(PNG) find_package(OpenGL) # The requirement of wxWidgets is checked in SelectPcsx2Plugins module # Does not require the module (allow to compile non-wx plugins) diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake index 1e7b7ca8df..5bd548d9b6 100644 --- a/cmake/SelectPcsx2Plugins.cmake +++ b/cmake/SelectPcsx2Plugins.cmake @@ -144,7 +144,7 @@ endif() # requires: -OpenGL # -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) elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/plugins/GSdx") set(GSdx FALSE) diff --git a/plugins/GSdx/CMakeLists.txt b/plugins/GSdx/CMakeLists.txt index 0ce2db6461..0998238075 100644 --- a/plugins/GSdx/CMakeLists.txt +++ b/plugins/GSdx/CMakeLists.txt @@ -40,6 +40,10 @@ if(EGL_API AND EGL_FOUND) set(GSdxFinalFlags ${GSdxFinalFlags} -DEGL_SUPPORTED) endif() +if(LIBLZMA_FOUND) + set(GSdxFinalFlags ${GSdxFinalFlags} -DLZMA_SUPPORTED) +endif() + #Clang doesn't support a few common flags that GCC does. if(NOT USE_CLANG) set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6) @@ -203,8 +207,7 @@ set(GSdxFinalLibs ${GSdxFinalLibs} ${OPENGL_LIBRARIES} ${GTK2_LIBRARIES} ${LIBC_LIBRARIES} - "-lpng" # yes it sucks - "-llzma" + ${PNG_LIBRARY} ) if(EGL_API AND EGL_FOUND) @@ -213,6 +216,12 @@ if(EGL_API AND EGL_FOUND) ) endif() +if(LIBLZMA_FOUND) + set(GSdxFinalLibs ${GSdxFinalLibs} + ${LIBLZMA_LIBRARIES} + ) +endif() + # Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL if (REBUILD_SHADER) add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)