# HG changeset patch # User unc0rr # Date 1315849874 -14400 # Node ID 42cf124c305b70bb59c9e062c787d83d9683cb14 # Parent 404ca990793a94b299ac46a380008342c49aed01 This should check if Qt provides zlib functions, and adds zlib dependency in case of zlibless Qt. Tested with Qt providing zlib functions only. diff -r 404ca990793a -r 42cf124c305b QTfrontend/CMakeLists.txt --- a/QTfrontend/CMakeLists.txt Mon Sep 12 18:53:28 2011 +0200 +++ b/QTfrontend/CMakeLists.txt Mon Sep 12 21:51:14 2011 +0400 @@ -12,6 +12,16 @@ find_package(Qt4 REQUIRED) include(${QT_USE_FILE}) +# Check if we need zlib +check_library_exists(${QT_QTCORE_LIBRARY} inflateInit2_ ${QT_LIBRARY_DIR} QT_PROVIDES_ZLIB_FUNCTIONS) + +if(NOT QT_PROVIDES_ZLIB_FUNCTIONS) + find_package(ZLIB REQUIRED) + + set(HW_LINK_LIBS ${ZLIB_LIBRARIES} ${HW_LINK_LIBS}) +endif() + + # Configure for SDL find_package(SDL REQUIRED) find_package(SDL_mixer REQUIRED) @@ -216,7 +226,7 @@ if(APPLE) set(hwfr_src ${hwfr_src} InstallController.cpp CocoaInitializer.mm M3Panel.mm M3InstallController.m NSWorkspace_RBAdditions.m) - set(HW_LINK_LIBS IOKit) + set(HW_LINK_LIBS IOKit ${HW_LINK_LIBS}) if(NOT NOAUTOUPDATE) find_package(Sparkle)