3 # Once done this will define
5 # LIBGSF_FOUND - System has LibGSF
6 # LIBGSF_INCLUDE_DIR - The LibGSF include directory
7 # LIBGSF_LIBRARIES - The libraries needed to use LibGSF
8 # LIBGSF_DEFINITIONS - Compiler switches required for using LibGSF
9 # LIBGSF_GSF_EXECUTABLE - The archive utility
10 # LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE - The office files thumbnailer for the GNOME desktop
11 # LIBGSF_GSFVBADUMP_EXECUTABLE - The utility to extract Visual Basic for Applications macros
13 # Copyright (c) 2009, Pau Garcia i Quiles <pgquiles@elpauer.org>
14 # Based off FindLibXml2.cmake from CMake 2.6.4 by Alexander Neundorf <neundorf@kde.org>
16 # Redistribution and use is allowed according to the terms of the BSD license.
17 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
20 IF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
22 SET(LIBGSF_FIND_QUIETLY TRUE)
23 ENDIF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
26 # use pkg-config to get the directories and then use these values
27 # in the FIND_PATH() and FIND_LIBRARY() calls
28 FIND_PACKAGE(PkgConfig)
29 PKG_CHECK_MODULES(PC_LIBGSF libgsf-1)
30 SET(LIBGSF_DEFINITIONS ${PC_LIBGSF_CFLAGS_OTHER})
33 FIND_PATH(LIBGSF_INCLUDE_DIR gsf/gsf.h
35 ${PC_LIBGSF_INCLUDEDIR}
36 ${PC_LIBGSF_INCLUDE_DIRS}
37 PATH_SUFFIXES libgsf-1
40 FIND_LIBRARY(LIBGSF_LIBRARIES NAMES gsf-1 libgsf-1
43 ${PC_LIBGSF_LIBRARY_DIRS}
46 FIND_PROGRAM(LIBGSF_GSF_EXECUTABLE gsf)
47 FIND_PROGRAM(LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE gsf-office-thumbnailer)
48 FIND_PROGRAM(LIBGSF_GSFVBADUMP_EXECUTABLE gsf-vba-dump)
50 INCLUDE(FindPackageHandleStandardArgs)
52 # handle the QUIETLY and REQUIRED arguments and set LIBGSF_FOUND to TRUE if
53 # all listed variables are TRUE
54 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGSF DEFAULT_MSG LIBGSF_LIBRARIES LIBGSF_INCLUDE_DIR)
56 MARK_AS_ADVANCED(LIBGSF_INCLUDE_DIR LIBGSF_LIBRARIES LIBGSF_GSF_EXECUTABLE LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE LIBGSF_GSFVBADUMP_EXECUTABLE )