CMake: move find_package for lzma and secretstore to init.cmake

This commit is contained in:
Maarten Bent
2018-11-04 16:10:23 +01:00
parent e1b725d5be
commit 5c4741430a
3 changed files with 14 additions and 12 deletions

View File

@@ -154,6 +154,20 @@ if(wxUSE_THREADS)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
endif() 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(wxUSE_GUI)
if(WXMSW AND wxUSE_METAFILE) if(WXMSW AND wxUSE_METAFILE)
# this one should probably be made separately configurable # this one should probably be made separately configurable

View File

@@ -24,15 +24,6 @@ elseif(APPLE)
endif() endif()
elseif(UNIX) elseif(UNIX)
wx_append_sources(BASE_FILES BASE_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() endif()
wx_add_library(base IS_BASE ${BASE_FILES}) wx_add_library(base IS_BASE ${BASE_FILES})

View File

@@ -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_add_thirdparty_library(wxUSE_LIBTIFF TIFF "use libtiff (TIFF file format)")
wx_option(wxUSE_LIBLZMA "use LZMA compression" OFF) 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") set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} wxUSE_LIBLZMA "use liblzma for LZMA compression")
wx_option(wxUSE_OPENGL "use OpenGL (or Mesa)") wx_option(wxUSE_OPENGL "use OpenGL (or Mesa)")