From 5c4741430a900a9046fb0467fd416863c89c35a6 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 4 Nov 2018 16:10:23 +0100 Subject: [PATCH] CMake: move find_package for lzma and secretstore to init.cmake --- build/cmake/init.cmake | 14 ++++++++++++++ build/cmake/lib/base/CMakeLists.txt | 9 --------- build/cmake/options.cmake | 3 --- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index cb40abc5b8..740cfa17cd 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -154,6 +154,20 @@ if(wxUSE_THREADS) find_package(Threads REQUIRED) endif() +if(wxUSE_LIBLZMA) + find_package(LibLZMA REQUIRED) +endif() + +if(UNIX AND wxUSE_SECRETSTORE) + # The required APIs are always available under MSW and OS X but we must + # have GNOME libsecret under Unix to be able to compile this class. + find_package(Libsecret REQUIRED) + if(NOT LIBSECRET_FOUND) + message(WARNING "libsecret not found, wxSecretStore won't be available") + wx_option_force_value(wxUSE_SECRETSTORE OFF) + endif() +endif() + if(wxUSE_GUI) if(WXMSW AND wxUSE_METAFILE) # this one should probably be made separately configurable diff --git a/build/cmake/lib/base/CMakeLists.txt b/build/cmake/lib/base/CMakeLists.txt index 28377c4772..ec38b8947a 100644 --- a/build/cmake/lib/base/CMakeLists.txt +++ b/build/cmake/lib/base/CMakeLists.txt @@ -24,15 +24,6 @@ elseif(APPLE) endif() elseif(UNIX) wx_append_sources(BASE_FILES BASE_UNIX) - if(wxUSE_SECRETSTORE) - # The required APIs are always available under MSW and OS X but we must - # have GNOME libsecret under Unix to be able to compile this class. - find_package(Libsecret REQUIRED) - if(NOT LIBSECRET_FOUND) - message(WARNING "libsecret not found, wxSecretStore won't be available") - wx_option_force_value(wxUSE_SECRETSTORE OFF) - endif() - endif() endif() wx_add_library(base IS_BASE ${BASE_FILES}) diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 19c7344b80..0e2401a18c 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -71,9 +71,6 @@ wx_add_thirdparty_library(wxUSE_LIBPNG PNG "use libpng (PNG image format)") wx_add_thirdparty_library(wxUSE_LIBTIFF TIFF "use libtiff (TIFF file format)") wx_option(wxUSE_LIBLZMA "use LZMA compression" OFF) -if(wxUSE_LIBLZMA) - find_package(LibLZMA REQUIRED) -endif() set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBLZMA "use liblzma for LZMA compression") wx_option(wxUSE_OPENGL "use OpenGL (or Mesa)")