2020-02-19 16:48:14 +00:00
|
|
|
# - Try to find Qalculate
|
2015-11-05 10:05:41 +02:00
|
|
|
#
|
|
|
|
# Once done this will define
|
|
|
|
#
|
2020-02-19 16:48:14 +00:00
|
|
|
# QALCULATE_FOUND - system has Qalculate
|
|
|
|
# QALCULATE_INCLUDE_DIR - Qalculate include directory
|
|
|
|
# QALCULATE_LIBRARIES - Qalculate libraries
|
2015-11-05 10:05:41 +02:00
|
|
|
#
|
2020-02-19 16:48:14 +00:00
|
|
|
# Copyright (c) 2020, Ivailo Monev, <xakepa10@gmail.com>
|
2015-11-05 10:05:41 +02:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
if(QALCULATE_INCLUDE_DIR AND QALCULATE_LIBRARIES)
|
|
|
|
set(QALCULATE_FIND_QUIETLY TRUE)
|
|
|
|
endif()
|
2015-11-05 10:05:41 +02:00
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_QALCULATE QUIET libqalculate)
|
2015-11-05 10:05:41 +02:00
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
set(QALCULATE_INCLUDE_DIR ${PC_QALCULATE_INCLUDE_DIRS})
|
|
|
|
set(QALCULATE_LIBRARIES ${PC_QALCULATE_LIBRARIES})
|
|
|
|
endif()
|
2015-11-05 10:05:41 +02:00
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
set(QALCULATE_VERSION ${PC_QALCULATE_VERSION})
|
2015-11-05 10:05:41 +02:00
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
if(NOT QALCULATE_INCLUDE_DIR OR NOT QALCULATE_LIBRARIES)
|
|
|
|
find_path(QALCULATE_INCLUDE_DIR
|
|
|
|
NAMES qalculate.h
|
|
|
|
PATH_SUFFIXES libqalculate
|
|
|
|
HINTS $ENV{QALCULATEDIR}/include
|
|
|
|
)
|
2015-11-05 10:05:41 +02:00
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
find_library(QALCULATE_LIBRARIES
|
|
|
|
NAMES qalculate
|
|
|
|
HINTS $ENV{QALCULATEDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2015-11-05 10:05:41 +02:00
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Qalculate
|
|
|
|
VERSION_VAR QALCULATE_VERSION
|
|
|
|
REQUIRED_VARS QALCULATE_LIBRARIES QALCULATE_INCLUDE_DIR
|
|
|
|
)
|
2015-11-05 10:05:41 +02:00
|
|
|
|
2020-02-19 16:48:14 +00:00
|
|
|
mark_as_advanced(QALCULATE_INCLUDE_DIR QALCULATE_LIBRARIES)
|