mirror of
http://172.16.200.102/MOISE/Timed-Altarica-To-Fiacre-Translator.git
synced 2025-11-26 02:57:59 +01:00
Initial commit.
This commit is contained in:
39
config/FindGlib.cmake
Normal file
39
config/FindGlib.cmake
Normal file
@@ -0,0 +1,39 @@
|
||||
# - Try to find Glib-2.0 (with gobject)
|
||||
# Once done, this will define
|
||||
#
|
||||
# Glib_FOUND - system has Glib
|
||||
# Glib_INCLUDE_DIRS - the Glib include directories
|
||||
# Glib_LIBRARIES - link these to use Glib
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
# Use pkg-config to get hints about paths
|
||||
libfind_pkg_check_modules(Glib_PKGCONF glib-2.0)
|
||||
|
||||
# Main include dir
|
||||
find_path(Glib_INCLUDE_DIR
|
||||
NAMES glib.h
|
||||
PATHS ${Glib_PKGCONF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES glib-2.0
|
||||
)
|
||||
|
||||
# Glib-related libraries also use a separate config header, which is in lib dir
|
||||
find_path(GlibConfig_INCLUDE_DIR
|
||||
NAMES glibconfig.h
|
||||
PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr
|
||||
PATH_SUFFIXES lib/glib-2.0/include
|
||||
)
|
||||
|
||||
# Finally the library itself
|
||||
find_library(Glib_LIBRARY
|
||||
NAMES glib-2.0
|
||||
PATHS ${Glib_PKGCONF_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||
set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
|
||||
set(Glib_PROCESS_LIBS Glib_LIBRARY)
|
||||
libfind_process(Glib)
|
||||
|
||||
|
||||
38
config/FindGlibmm.cmake
Normal file
38
config/FindGlibmm.cmake
Normal file
@@ -0,0 +1,38 @@
|
||||
# - Try to find Glibmm-2.4
|
||||
# Once done, this will define
|
||||
#
|
||||
# Glibmm_FOUND - system has Glibmm
|
||||
# Glibmm_INCLUDE_DIRS - the Glibmm include directories
|
||||
# Glibmm_LIBRARIES - link these to use Glibmm
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
# Dependencies
|
||||
libfind_package(Glibmm Glib)
|
||||
libfind_package(Glibmm SigC++)
|
||||
|
||||
# Use pkg-config to get hints about paths
|
||||
libfind_pkg_check_modules(Glibmm_PKGCONF glibmm-2.4)
|
||||
|
||||
# Main include dir
|
||||
find_path(Glibmm_INCLUDE_DIR
|
||||
NAMES glibmm/main.h
|
||||
PATHS ${Glibmm_PKGCONF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES glibmm-2.4
|
||||
)
|
||||
|
||||
# Glib-related libraries also use a separate config header, which is in lib dir
|
||||
find_path(GlibmmConfig_INCLUDE_DIR
|
||||
NAMES glibmmconfig.h
|
||||
PATHS ${Glibmm_PKGCONF_INCLUDE_DIRS} /usr
|
||||
PATH_SUFFIXES lib/glibmm-2.4/include
|
||||
)
|
||||
|
||||
libfind_library(Glibmm glibmm 2.4)
|
||||
|
||||
# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||
set(Glibmm_PROCESS_INCLUDES Glibmm_INCLUDE_DIR GlibmmConfig_INCLUDE_DIR Glib_INCLUDE_DIRS SigC++_INCLUDE_DIRS)
|
||||
set(Glibmm_PROCESS_LIBS Glibmm_LIBRARY Glib_LIBRARIES SigC++_LIBRARIES)
|
||||
libfind_process(Glibmm)
|
||||
|
||||
41
config/FindLibXML++.cmake
Normal file
41
config/FindLibXML++.cmake
Normal file
@@ -0,0 +1,41 @@
|
||||
# - Try to find LibXML++ 2.6
|
||||
# Once done, this will define
|
||||
#
|
||||
# LibXML++_FOUND - system has LibXML++
|
||||
# LibXML++_INCLUDE_DIRS - the LibXML++ include directories
|
||||
# LibXML++_LIBRARIES - link these to use LibXML++
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
# Dependencies
|
||||
libfind_package(LibXML++ LibXML2)
|
||||
libfind_package(LibXML++ Glibmm)
|
||||
|
||||
# Use pkg-config to get hints about paths
|
||||
libfind_pkg_check_modules(LibXML++_PKGCONF libxml++-2.6)
|
||||
|
||||
# Main include dir
|
||||
find_path(LibXML++_INCLUDE_DIR
|
||||
NAMES libxml++/libxml++.h
|
||||
PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES libxml++-2.6
|
||||
)
|
||||
|
||||
# Glib-related libraries also use a separate config header, which is in lib dir
|
||||
find_path(LibXML++Config_INCLUDE_DIR
|
||||
NAMES libxml++config.h
|
||||
PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS} /usr
|
||||
PATH_SUFFIXES lib/libxml++-2.6/include
|
||||
)
|
||||
|
||||
# Finally the library itself
|
||||
find_library(LibXML++_LIBRARY
|
||||
NAMES xml++-2.6
|
||||
PATHS ${LibXML++_PKGCONF_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||
set(LibXML++_PROCESS_INCLUDES LibXML++_INCLUDE_DIR LibXML++Config_INCLUDE_DIR LibXML2_INCLUDE_DIRS Glibmm_INCLUDE_DIRS)
|
||||
set(LibXML++_PROCESS_LIBS LibXML++_LIBRARY LibXML2_LIBRARIES Glibmm_LIBRARIES)
|
||||
libfind_process(LibXML++)
|
||||
90
config/FindLibXML2.cmake
Normal file
90
config/FindLibXML2.cmake
Normal file
@@ -0,0 +1,90 @@
|
||||
# - Try to find libxml2
|
||||
# Once done this will define
|
||||
#
|
||||
# LibXML2_FOUND - system has xml2
|
||||
# LibXML2_INCLUDE_DIRS - the xml2 include directory
|
||||
# LibXML2_LIBRARIES - Link these to use xml2
|
||||
# LibXML2_DEFINITIONS - Compiler switches required for using xml2
|
||||
#
|
||||
# Copyright (c) 2008 Andreas Schneider <mail@cynapses.org>
|
||||
# Modified for other libraries by Lasse Kärkkäinen <tronic>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
|
||||
if (LibXML2_LIBRARIES AND LibXML2_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(LibXML2_FOUND TRUE)
|
||||
else (LibXML2_LIBRARIES AND LibXML2_INCLUDE_DIRS)
|
||||
# use pkg-config to get the directories and then use these values
|
||||
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
include(UsePkgConfig)
|
||||
pkgconfig(libxml-2.0 _LibXML2_INCLUDEDIR _LibXML2_LIBDIR _LibXML2_LDFLAGS _LibXML2_CFLAGS)
|
||||
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_LIBXML2 libxml-2.0)
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_path(LibXML2_INCLUDE_DIR
|
||||
NAMES
|
||||
libxml/xpath.h
|
||||
PATHS
|
||||
${_LibXML2_INCLUDEDIR}
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
PATH_SUFFIXES
|
||||
libxml2
|
||||
)
|
||||
|
||||
find_library(LibXML2_LIBRARY
|
||||
NAMES
|
||||
xml2
|
||||
PATHS
|
||||
${_LibXML2_LIBDIR}
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
)
|
||||
|
||||
if (LibXML2_LIBRARY)
|
||||
set(LibXML2_FOUND TRUE)
|
||||
endif (LibXML2_LIBRARY)
|
||||
|
||||
set(LibXML2_INCLUDE_DIRS
|
||||
${LibXML2_INCLUDE_DIR}
|
||||
)
|
||||
|
||||
if (LibXML2_FOUND)
|
||||
set(LibXML2_LIBRARIES
|
||||
${LibXML2_LIBRARIES}
|
||||
${LibXML2_LIBRARY}
|
||||
)
|
||||
endif (LibXML2_FOUND)
|
||||
|
||||
if (LibXML2_INCLUDE_DIRS AND LibXML2_LIBRARIES)
|
||||
set(LibXML2_FOUND TRUE)
|
||||
endif (LibXML2_INCLUDE_DIRS AND LibXML2_LIBRARIES)
|
||||
|
||||
if (LibXML2_FOUND)
|
||||
if (NOT LibXML2_FIND_QUIETLY)
|
||||
message(STATUS "Found libxml2: ${LibXML2_LIBRARY}")
|
||||
endif (NOT LibXML2_FIND_QUIETLY)
|
||||
else (LibXML2_FOUND)
|
||||
if (LibXML2_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find libxml2")
|
||||
endif (LibXML2_FIND_REQUIRED)
|
||||
endif (LibXML2_FOUND)
|
||||
|
||||
# show the LibXML2_INCLUDE_DIRS and LibXML2_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(LibXML2_INCLUDE_DIRS LibXML2_LIBRARIES)
|
||||
|
||||
endif (LibXML2_LIBRARIES AND LibXML2_INCLUDE_DIRS)
|
||||
|
||||
75
config/FindPLplot.cmake
Normal file
75
config/FindPLplot.cmake
Normal file
@@ -0,0 +1,75 @@
|
||||
# Find PLplot header and library.
|
||||
|
||||
# This module defines the following uncached variables:
|
||||
# PLplot_FOUND, if false, do not try to use PLplot.
|
||||
# PLplot_INCLUDE_DIRS, where to find plplot.h.
|
||||
# PLplot_LIBRARIES, the libraries to link against to use PLplot
|
||||
# PLplot_LIBRARY_DIRS, the directory where the PLplot library is found.
|
||||
|
||||
FIND_PATH(
|
||||
PLplot_INCLUDE_DIR
|
||||
NAMES plplot.h
|
||||
PATHS /usr/local/include /usr/include
|
||||
PATH_SUFFIXES plplot
|
||||
)
|
||||
|
||||
IF( PLplot_INCLUDE_DIR )
|
||||
find_library( PLplot_LIBRARY
|
||||
NAMES plplotd
|
||||
PATHS /usr/local/lib /usr/lib
|
||||
)
|
||||
if(PLplot_LIBRARY)
|
||||
set( PLplot_LIBRARY_DIR "" )
|
||||
get_filename_component(PLplot_LIBRARY_DIRS ${PLplot_LIBRARY} PATH)
|
||||
# Set uncached variables as per standard.
|
||||
set(PLplot_FOUND ON)
|
||||
set(PLplot_INCLUDE_DIRS ${PLplot_INCLUDE_DIR})
|
||||
set(PLplot_LIBRARIES ${PLplot_LIBRARY})
|
||||
endif(PLplot_LIBRARY)
|
||||
|
||||
# find cxx bindings
|
||||
find_library( PLplot_cxx_LIBRARY
|
||||
NAMES plplotcxxd
|
||||
PATHS /usr/local/lib /usr/lib
|
||||
)
|
||||
if( PLplot_cxx_LIBRARY )
|
||||
set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_cxx_LIBRARY} )
|
||||
endif( PLplot_cxx_LIBRARY )
|
||||
|
||||
# find f77 bindings
|
||||
find_library( PLplot_f77_LIBRARY
|
||||
NAMES plplotf77d
|
||||
PATHS /usr/local/lib /usr/lib
|
||||
)
|
||||
if( PLplot_f77_LIBRARY )
|
||||
set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_f77_LIBRARY} )
|
||||
endif( PLplot_f77_LIBRARY )
|
||||
|
||||
# find f90 bindings
|
||||
find_library( PLplot_f90_LIBRARY
|
||||
NAMES plplotf90d
|
||||
PATHS /usr/local/lib /usr/lib
|
||||
)
|
||||
if( PLplot_f90_LIBRARY )
|
||||
set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_f90_LIBRARY} )
|
||||
endif( PLplot_f90_LIBRARY )
|
||||
|
||||
# find wxwidgets bindings
|
||||
find_library( PLplot_wxwidgets_LIBRARY
|
||||
NAMES plplotwxwidgetsd
|
||||
PATHS /usr/local/lib /usr/lib
|
||||
)
|
||||
if( PLplot_wxwidgets_LIBRARY )
|
||||
set( PLplot_LIBRARIES ${PLplot_LIBRARIES} ${PLplot_wxwidgets_LIBRARY} )
|
||||
endif( PLplot_wxwidgets_LIBRARY )
|
||||
endif(PLplot_INCLUDE_DIR)
|
||||
|
||||
if(PLplot_FOUND)
|
||||
if(NOT PLplot_FIND_QUIETLY)
|
||||
message(STATUS "FindPLplot: Found both PLplot headers and library")
|
||||
endif(NOT PLplot_FIND_QUIETLY)
|
||||
else(PLplot_FOUND)
|
||||
if(PLplot_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "FindPLplot: Could not find PLplot headers or library")
|
||||
endif(PLplot_FIND_REQUIRED)
|
||||
endif(PLplot_FOUND)
|
||||
34
config/FindSigC++.cmake
Normal file
34
config/FindSigC++.cmake
Normal file
@@ -0,0 +1,34 @@
|
||||
# - Try to find SigC++-2.0
|
||||
# Once done, this will define
|
||||
#
|
||||
# SigC++_FOUND - system has SigC++
|
||||
# SigC++_INCLUDE_DIRS - the SigC++ include directories
|
||||
# SigC++_LIBRARIES - link these to use SigC++
|
||||
|
||||
include(LibFindMacros)
|
||||
|
||||
# Use pkg-config to get hints about paths
|
||||
libfind_pkg_check_modules(SigC++_PKGCONF sigc++-2.0)
|
||||
|
||||
# Main include dir
|
||||
find_path(SigC++_INCLUDE_DIR
|
||||
NAMES sigc++/sigc++.h
|
||||
PATHS ${SigC++_PKGCONF_INCLUDE_DIRS}
|
||||
PATH_SUFFIXES sigc++-2.0
|
||||
)
|
||||
|
||||
# Glib-related libraries also use a separate config header, which is in lib dir
|
||||
find_path(SigC++Config_INCLUDE_DIR
|
||||
NAMES sigc++config.h
|
||||
PATHS ${SigC++_PKGCONF_INCLUDE_DIRS} /usr
|
||||
PATH_SUFFIXES lib/sigc++-2.0/include
|
||||
)
|
||||
|
||||
libfind_library(SigC++ sigc 2.0)
|
||||
|
||||
# Set the include dir variables and the libraries and let libfind_process do the rest.
|
||||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
|
||||
set(SigC++_PROCESS_INCLUDES SigC++_INCLUDE_DIR SigC++Config_INCLUDE_DIR)
|
||||
set(SigC++_PROCESS_LIBS SigC++_LIBRARY)
|
||||
libfind_process(SigC++)
|
||||
|
||||
100
config/FindUMFPACK.cmake
Normal file
100
config/FindUMFPACK.cmake
Normal file
@@ -0,0 +1,100 @@
|
||||
SET( UMFPACK_FOUND "NO" )
|
||||
|
||||
if (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
|
||||
set(UMFPACK_FIND_QUIETLY TRUE)
|
||||
endif (UMFPACK_INCLUDES AND UMFPACK_LIBRARIES)
|
||||
|
||||
find_package(BLAS REQUIRED)
|
||||
|
||||
if(BLAS_FOUND)
|
||||
|
||||
find_path(UMFPACK_INCLUDES
|
||||
NAMES
|
||||
umfpack.h
|
||||
PATHS
|
||||
$ENV{UMFPACKDIR}
|
||||
${INCLUDE_INSTALL_DIR}
|
||||
PATH_SUFFIXES
|
||||
suitesparse
|
||||
)
|
||||
|
||||
find_library(UMFPACK_LIBRARIES umfpack PATHS $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
|
||||
if(UMFPACK_LIBRARIES)
|
||||
|
||||
get_filename_component(UMFPACK_LIBDIR ${UMFPACK_LIBRARIES} PATH)
|
||||
|
||||
find_library(AMD_LIBRARY amd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (AMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${AMD_LIBRARY})
|
||||
else (AMD_LIBRARY)
|
||||
MESSAGE ( FATAL_ERROR "AMD library not found!" )
|
||||
set(UMFPACK_LIBRARIES)
|
||||
endif (AMD_LIBRARY)
|
||||
|
||||
find_library(CHOLMOD_LIBRARY cholmod PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (CHOLMOD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CHOLMOD_LIBRARY})
|
||||
else (CHOLMOD_LIBRARY)
|
||||
MESSAGE ( FATAL_ERROR "CHOLAMD library not found!" )
|
||||
set(UMFPACK_LIBRARIES)
|
||||
endif (CHOLMOD_LIBRARY)
|
||||
|
||||
find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (COLAMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
|
||||
else (COLAMD_LIBRARY)
|
||||
MESSAGE ( FATAL_ERROR "COLAMD library not found!" )
|
||||
set(UMFPACK_LIBRARIES)
|
||||
endif (COLAMD_LIBRARY)
|
||||
|
||||
find_library(CAMD_LIBRARY camd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (CAMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CAMD_LIBRARY})
|
||||
else (CAMD_LIBRARY)
|
||||
MESSAGE ( FATAL_ERROR "CAMD library not found!" )
|
||||
set(UMFPACK_LIBRARIES)
|
||||
endif (CAMD_LIBRARY)
|
||||
|
||||
find_library(CCOLAMD_LIBRARY ccolamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (CCOLAMD_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${CCOLAMD_LIBRARY})
|
||||
else (CCOLAMD_LIBRARY)
|
||||
MESSAGE ( FATAL_ERROR "CCOLAMD library not found!" )
|
||||
set(UMFPACK_LIBRARIES)
|
||||
endif (CCOLAMD_LIBRARY)
|
||||
|
||||
find_library(METIS_LIBRARY metis PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (METIS_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${METIS_LIBRARY})
|
||||
else (METIS_LIBRARY)
|
||||
MESSAGE ( STATUS "METIS library not found!" )
|
||||
# set(UMFPACK_LIBRARIES)
|
||||
endif (METIS_LIBRARY)
|
||||
|
||||
find_library(SPARSECONFIG_LIBRARY suitesparseconfig PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
|
||||
if (SPARSECONFIG_LIBRARY)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SPARSECONFIG_LIBRARY})
|
||||
else (SPARSECONFIG_LIBRARY)
|
||||
message ("paths : " ${PATHS})
|
||||
MESSAGE ( FATAL_ERROR "SPARSECONFIG library not found!" )
|
||||
set(UMFPACK_LIBRARIES)
|
||||
endif (SPARSECONFIG_LIBRARY)
|
||||
|
||||
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
|
||||
if(UMFPACK_LIBRARIES)
|
||||
set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${BLAS_LIBRARIES} gfortran)
|
||||
SET( UMFPACK_FOUND "YES" )
|
||||
endif(UMFPACK_LIBRARIES)
|
||||
|
||||
endif(BLAS_FOUND)
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(UMFPACK DEFAULT_MSG
|
||||
UMFPACK_INCLUDES UMFPACK_LIBRARIES)
|
||||
|
||||
mark_as_advanced(UMFPACK_INCLUDES UMFPACK_LIBRARIES AMD_LIBRARY COLAMD_LIBRARY)
|
||||
|
||||
1086
config/FindwxWidgetsCustom.cmake
Normal file
1086
config/FindwxWidgetsCustom.cmake
Normal file
File diff suppressed because it is too large
Load Diff
101
config/LibFindMacros.cmake
Normal file
101
config/LibFindMacros.cmake
Normal file
@@ -0,0 +1,101 @@
|
||||
# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
|
||||
# used for the current package. For this to work, the first parameter must be the
|
||||
# prefix of the current package, then the prefix of the new package etc, which are
|
||||
# passed to find_package.
|
||||
macro (libfind_package PREFIX)
|
||||
set (LIBFIND_PACKAGE_ARGS ${ARGN})
|
||||
if (${PREFIX}_FIND_QUIETLY)
|
||||
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
|
||||
endif (${PREFIX}_FIND_QUIETLY)
|
||||
if (${PREFIX}_FIND_REQUIRED)
|
||||
set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
|
||||
endif (${PREFIX}_FIND_REQUIRED)
|
||||
find_package(${LIBFIND_PACKAGE_ARGS})
|
||||
endmacro (libfind_package)
|
||||
|
||||
# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
|
||||
# where they added pkg_check_modules. Consequently I need to support both in my scripts
|
||||
# to avoid those deprecated warnings. Here's a helper that does just that.
|
||||
# Works identically to pkg_check_modules, except that no checks are needed prior to use.
|
||||
macro (libfind_pkg_check_modules PREFIX PKGNAME)
|
||||
if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
include(UsePkgConfig)
|
||||
pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
|
||||
else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(${PREFIX} ${PKGNAME})
|
||||
endif (PKG_CONFIG_FOUND)
|
||||
endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
|
||||
endmacro (libfind_pkg_check_modules)
|
||||
|
||||
# Do the final processing once the paths have been detected.
|
||||
# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
|
||||
# all the variables, each of which contain one include directory.
|
||||
# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
|
||||
# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
|
||||
# Also handles errors in case library detection was required, etc.
|
||||
macro (libfind_process PREFIX)
|
||||
# Skip processing if already processed during this run
|
||||
if (NOT ${PREFIX}_FOUND)
|
||||
# Start with the assumption that the library was found
|
||||
set (${PREFIX}_FOUND TRUE)
|
||||
|
||||
# Process all includes and set _FOUND to false if any are missing
|
||||
foreach (i ${${PREFIX}_PROCESS_INCLUDES})
|
||||
if (${i})
|
||||
set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
|
||||
mark_as_advanced(${i})
|
||||
else (${i})
|
||||
message(STATUS "Missing ${i}")
|
||||
set (${PREFIX}_FOUND FALSE)
|
||||
endif (${i})
|
||||
endforeach (i)
|
||||
|
||||
# Process all libraries and set _FOUND to false if any are missing
|
||||
foreach (i ${${PREFIX}_PROCESS_LIBS})
|
||||
if (${i})
|
||||
set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
|
||||
mark_as_advanced(${i})
|
||||
else (${i})
|
||||
message(STATUS "Missing ${i}")
|
||||
set (${PREFIX}_FOUND FALSE)
|
||||
endif (${i})
|
||||
endforeach (i)
|
||||
|
||||
# Print message and/or exit on fatal error
|
||||
if (${PREFIX}_FOUND)
|
||||
if (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
|
||||
endif (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
else (${PREFIX}_FOUND)
|
||||
if (${PREFIX}_FIND_REQUIRED)
|
||||
foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
|
||||
message("${i}=${${i}}")
|
||||
endforeach (i)
|
||||
message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
|
||||
endif (${PREFIX}_FIND_REQUIRED)
|
||||
endif (${PREFIX}_FOUND)
|
||||
endif (NOT ${PREFIX}_FOUND)
|
||||
endmacro (libfind_process)
|
||||
|
||||
macro(libfind_library PREFIX basename)
|
||||
set(TMP "")
|
||||
if(MSVC80)
|
||||
set(TMP -vc80)
|
||||
endif(MSVC80)
|
||||
if(MSVC90)
|
||||
set(TMP -vc90)
|
||||
endif(MSVC90)
|
||||
set(${PREFIX}_LIBNAMES ${basename}${TMP})
|
||||
if(${ARGC} GREATER 2)
|
||||
set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
|
||||
string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
|
||||
set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
|
||||
endif(${ARGC} GREATER 2)
|
||||
find_library(${PREFIX}_LIBRARY
|
||||
NAMES ${${PREFIX}_LIBNAMES}
|
||||
PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
|
||||
)
|
||||
endmacro(libfind_library)
|
||||
|
||||
Reference in New Issue
Block a user