kdelibs/cmake/modules/FindGMP.cmake
Ivailo Monev 3eb17fdf2b cmake: review modules rewritten so far by me
using pkg-config search as primary method with fallback to path lookup,
this may result in overlinking however if libraries require additional
include paths (as is the case with PulseAudio) with this change that will
not be a problem.

it will also reduce the lookups done during configuration/build since path
lookups will not be done, unless pkg-config lookup does not set the
required variables.

Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
2020-02-10 20:52:45 +00:00

31 lines
721 B
CMake

# - Try to find GMP
# Once done this will define
#
# GMP_FOUND - system has GMP
# GMP_INCLUDE_DIR - the GMP include directory
# GMP_LIBRARIES - The libraries needed to use GMP
#
# Copyright (c) 2020, Ivailo Monev, <xakepa10@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
if(GMP_INCLUDE_DIR AND GMP_LIBRARIES)
set(GMP_FIND_QUIETLY TRUE)
endif()
find_path(GMP_INCLUDE_DIR
NAMES gmp.h
HINTS $ENV{GMPDIR}/include
)
find_library(GMP_LIBRARIES
NAMES gmp
HINTS $ENV{GMPDIR}/lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GMP
REQUIRED_VARS GMP_LIBRARIES GMP_INCLUDE_DIR
)
mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)