Commit 09af0e40 authored by Pino Toscano's avatar Pino Toscano

cmake: remove obsolete/leftover cmake modules

parent 2ea59ef8
# KADMOS_FOUND - system has KADMOS libs
# KADMOS_INCLUDE_DIR - the KADMOS include directory
# KADMOS_LIBRARIES - The libraries needed to use KADMOS
# Copyright (c) 2006, 2007 Laurent Montel, <montel@kde.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
if (KADMOS_INCLUDE_DIR AND KADMOS_LIBRARY)
# Already in cache, be silent
set(Kadmos_FIND_QUIETLY TRUE)
endif (KADMOS_INCLUDE_DIR AND KADMOS_LIBRARY)
FIND_PATH(KADMOS_INCLUDE_DIR kadmos.h)
FIND_PATH(KADMOS_LIBRARY NAMES librep.a)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Kadmos DEFAULT_MSG KADMOS_INCLUDE_DIR KADMOS_LIBRARY )
MARK_AS_ADVANCED(KADMOS_INCLUDE_DIR KADMOS_LIBRARIES KADMOS_LIBRARY)
# - Try to find the libgs library
# Once done this will define
#
# LIBGS_FOUND - system has libgs
# LIBGS_LIBRARY - Link this to use libgs
#
# Copyright (c) 2006, Albert Astals Cid, <aacid@kde.org>
# Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(CheckLibraryExists)
include(CheckCSourceRuns)
if (LIBGS_LIBRARY)
# in cache already
set(LIBGS_FOUND TRUE)
else (LIBGS_LIBRARY)
set(CMAKE_LIBRARY_PATH "${LIB_INSTALL_DIR}")
find_library(LIBGS_LIBRARY NAMES gs gs-esp
PATHS
${GNUWIN32_DIR}/lib
)
if(LIBGS_LIBRARY)
check_library_exists(${LIBGS_LIBRARY} gsapi_new_instance "" LIBGS_HAVE_GSAPI_NEW_INSTANCE)
if(LIBGS_HAVE_GSAPI_NEW_INSTANCE)
set(LIBGS_FOUND TRUE)
endif(LIBGS_HAVE_GSAPI_NEW_INSTANCE)
endif(LIBGS_LIBRARY)
set(CMAKE_LIBRARY_PATH)
if (LIBGS_MINIMUM_VERSION)
string(REPLACE "." "" mingsver "${LIBGS_MINIMUM_VERSION}")
set(CMAKE_REQUIRED_LIBRARIES "${LIBGS_LIBRARY}")
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/spectre/libspectre")
check_c_source_runs("
#include <ghostscript/iapi.h>
int main(int argc, char **argv)
{
gsapi_revision_t gsrev;
if (gsapi_revision(&gsrev, sizeof(gsrev)) != 0)
return 1;
if (gsrev.revision < ${mingsver})
return 1;
return 0;
}
" HAVE_LIBGS_MINIMUM_VERSION)
set(CMAKE_REQUIRED_LIBRARIES)
set(CMAKE_REQUIRED_INCLUDES)
if (NOT HAVE_LIBGS_MINIMUM_VERSION)
set(LIBGS_FOUND FALSE)
endif (NOT HAVE_LIBGS_MINIMUM_VERSION)
endif (LIBGS_MINIMUM_VERSION)
if (LIBGS_MINIMUM_VERSION)
set(gsLibraryMessage " (v${LIBGS_MINIMUM_VERSION})")
else (LIBGS_MINIMUM_VERSION)
set(gsLibraryMessage "")
endif (LIBGS_MINIMUM_VERSION)
if (LIBGS_FOUND)
if (NOT LIBGS_FIND_QUIETLY)
message(STATUS "Found the GS library${gsLibraryMessage}: ${LIBGS_LIBRARY}")
endif (NOT LIBGS_FIND_QUIETLY)
else (LIBGS_FOUND)
if (LIBGS_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find the GS library${gsLibraryMessage}")
endif (LIBGS_FIND_REQUIRED)
endif (LIBGS_FOUND)
set(LIBGS_LIBRARY ${LIBGS_LIBRARY} CACHE INTERNAL "The GhostScript library")
endif (LIBGS_LIBRARY)
# install the cmake files
#install_files(/share/apps/cmake/modules FILES FindQGS.cmake )
# - Try to find the chm library
# Once done this will define
#
# CHM_FOUND - system has the chm library
# CHM_INCLUDE_DIR - the chm include directory
# CHM_LIBRARY - Link this to use the chm library
#
include(CheckLibraryExists)
# reset vars
set(CHM_INCLUDE_DIR)
set(CHM_LIBRARY)
FIND_PATH(CHM_INCLUDE_DIR chm_lib.h
/usr/local/include
/usr/include
${GNUWIN32_DIR}/include
)
find_library(CHM_LIBRARY NAMES chm
PATHS
/usr/lib
/usr/local/lib
${GNUWIN32_DIR}/lib
)
if(CHM_INCLUDE_DIR AND CHM_LIBRARY)
set(CHM_FOUND TRUE)
endif(CHM_INCLUDE_DIR AND CHM_LIBRARY)
if (CHM_FOUND)
if (NOT CHM_FIND_QUIETLY)
message(STATUS "Found CHM: ${CHM_LIBRARY}")
endif (NOT CHM_FIND_QUIETLY)
else (CHM_FOUND)
if (CHM_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find CHM")
endif (CHM_FIND_REQUIRED)
endif (CHM_FOUND)
MARK_AS_ADVANCED(CHM_INCLUDE_DIR CHM_LIBRARY)
# - Try to find the DjVuLibre library
# Once done this will define
#
# DJVULIBRE_FOUND - system has the DjVuLibre library
# DJVULIBRE_INCLUDE_DIR - the DjVuLibre include directory
# DJVULIBRE_LIBRARY - Link this to use the DjVuLibre library
if (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
# in cache already
set(DJVULIBRE_FOUND TRUE)
else (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
include(UsePkgConfig)
pkgconfig(ddjvuapi _ddjvuIncDir _ddjvuLinkDir ddjvuLinkFlags _ddjvuCflags)
if(_ddjvuIncDir)
find_path(DJVULIBRE_INCLUDE_DIR libdjvu/ddjvuapi.h
${_ddjvuIncDir}
/usr/local/include
/usr/include
${GNUWIN32_DIR}/include
)
find_library(DJVULIBRE_LIBRARY NAMES djvulibre
PATHS
${_ddjvuLinkDir}
/usr/lib
/usr/local/lib
${GNUWIN32_DIR}/lib
)
endif(_ddjvuIncDir)
if(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
set(DJVULIBRE_FOUND TRUE)
endif(DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
if (DJVULIBRE_FOUND)
if (NOT DJVULIBRE_FIND_QUIETLY)
message(STATUS "Found DjVuLibre: ${DJVULIBRE_LIBRARY}")
endif (NOT DJVULIBRE_FIND_QUIETLY)
else (DJVULIBRE_FOUND)
if (DJVULIBRE_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find DjVuLibre")
endif (DJVULIBRE_FIND_REQUIRED)
endif (DJVULIBRE_FOUND)
mark_as_advanced(DJVULIBRE_INCLUDE_DIR DJVULIBRE_LIBRARY)
endif (DJVULIBRE_INCLUDE_DIR AND DJVULIBRE_LIBRARY)
# - Try to find the libgs library
# Once done this will define
#
# LIBGS_FOUND - system has libgs
# LIBGS_LIBRARY - Link this to use libgs
#
include(CheckLibraryExists)
# reset vars
set(LIBGS_LIBRARY)
set(CMAKE_LIBRARY_PATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
find_library(LIBGS_LIBRARY NAMES gs
PATHS
/usr/lib
/usr/local/lib
${GNUWIN32_DIR}/lib
)
if(LIBGS_LIBRARY)
check_library_exists(${LIBGS_LIBRARY} gsapi_new_instance "" LIBGS_HAVE_GSAPI_NEW_INSTANCE)
if(LIBGS_HAVE_GSAPI_NEW_INSTANCE)
set(LIBGS_FOUND TRUE)
endif(LIBGS_HAVE_GSAPI_NEW_INSTANCE)
endif(LIBGS_LIBRARY)
set(CMAKE_LIBRARY_PATH)
if (LIBGS_FOUND)
if (NOT LIBGS_FIND_QUIETLY)
message(STATUS "Found the GS library: ${LIBGS_LIBRARY}")
endif (NOT LIBGS_FIND_QUIETLY)
else (LIBGS_FOUND)
if (LIBGS_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find the GS library")
endif (LIBGS_FIND_REQUIRED)
endif (LIBGS_FOUND)
MARK_AS_ADVANCED(LIBGS_LIBRARY)
# - Try to find the poppler PDF library
# Once done this will define
#
# POPPLER_FOUND - system has poppler
# POPPLER_INCLUDE_DIR - the poppler include directory
# POPPLER_LIBRARY - Link this to use poppler
#
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
INCLUDE(UsePkgConfig)
PKGCONFIG(poppler-qt4 _PopplerIncDir _PopplerLinkDir _PopplerLinkFlags _PopplerCflags)
if(_PopplerLinkFlags)
# find again pkg-config, to query it about poppler version
FIND_PROGRAM(PKGCONFIG_EXECUTABLE NAMES pkg-config PATHS /usr/bin/ /usr/local/bin )
# query pkg-config asking for a poppler-qt4 >= 0.5.2
EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.5.2 poppler-qt4 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
if(_return_VALUE STREQUAL "0")
set(POPPLER_FOUND TRUE)
endif(_return_VALUE STREQUAL "0")
endif(_PopplerLinkFlags)
if (POPPLER_FOUND)
set(POPPLER_INCLUDE_DIR ${_PopplerIncDir})
set(POPPLER_LIBRARY ${_PopplerLinkFlags})
if (NOT POPPLER_FIND_QUIETLY)
message(STATUS "Found Poppler-qt4: ${POPPLER_LIBRARY}")
endif (NOT POPPLER_FIND_QUIETLY)
else (POPPLER_FOUND)
if (POPPLER_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find Poppler-qt4")
endif (POPPLER_FIND_REQUIRED)
endif (POPPLER_FOUND)
MARK_AS_ADVANCED(POPPLER_INCLUDE_DIR POPPLER_LIBRARY)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment