2017-02-04 01:00:25 +01:00
|
|
|
#
|
|
|
|
# Copyright (c) 2017 Håvard Pettersson <mail@haavard.me>.
|
|
|
|
#
|
|
|
|
# This file is part of Tox-WeeChat.
|
|
|
|
#
|
|
|
|
# Tox-WeeChat is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# Tox-WeeChat is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with Tox-WeeChat. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
2015-09-02 22:43:36 +02:00
|
|
|
set(Tox_INCLUDE_DIRS)
|
|
|
|
set(Tox_LIBRARIES)
|
|
|
|
|
2015-09-02 22:34:10 +02:00
|
|
|
find_path(Tox_CORE_INCLUDE_DIR tox/tox.h)
|
|
|
|
find_library(Tox_CORE_LIBRARY toxcore)
|
2015-01-30 14:54:25 +01:00
|
|
|
|
2015-09-02 22:34:10 +02:00
|
|
|
find_path(Tox_AV_INCLUDE_DIR tox/toxav.h)
|
|
|
|
|
2015-09-02 22:43:36 +02:00
|
|
|
find_path(Tox_ENCRYPTSAVE_INCLUDE_DIR tox/toxencryptsave.h)
|
2015-09-02 22:34:10 +02:00
|
|
|
|
2015-09-02 22:43:36 +02:00
|
|
|
if(Tox_CORE_INCLUDE_DIR AND Tox_CORE_LIBRARY)
|
|
|
|
set(Tox_CORE_FOUND TRUE)
|
2017-02-11 04:08:26 +01:00
|
|
|
list(APPEND Tox_INCLUDE_DIRS "${Tox_CORE_INCLUDE_DIR}")
|
|
|
|
list(APPEND Tox_LIBRARIES "${Tox_CORE_LIBRARY}")
|
2015-09-02 22:34:10 +02:00
|
|
|
endif()
|
|
|
|
|
2018-04-12 23:23:49 +02:00
|
|
|
if(Tox_AV_INCLUDE_DIR)
|
2015-09-02 22:43:36 +02:00
|
|
|
set(Tox_AV_FOUND TRUE)
|
2017-02-11 04:08:26 +01:00
|
|
|
list(APPEND Tox_INCLUDE_DIRS "${Tox_AV_INCLUDE_DIR}")
|
2015-09-02 22:34:10 +02:00
|
|
|
endif()
|
2015-01-30 14:54:25 +01:00
|
|
|
|
2018-04-12 23:23:49 +02:00
|
|
|
if(Tox_ENCRYPTSAVE_INCLUDE_DIR)
|
2015-09-02 22:43:36 +02:00
|
|
|
set(Tox_ENCRYPTSAVE_FOUND TRUE)
|
2017-02-11 04:08:26 +01:00
|
|
|
list(APPEND Tox_INCLUDE_DIRS "${Tox_ENCRYPTSAVE_INCLUDE_DIR}")
|
2015-09-02 22:43:36 +02:00
|
|
|
endif()
|
|
|
|
|
2017-02-11 04:08:26 +01:00
|
|
|
list(REMOVE_DUPLICATES Tox_INCLUDE_DIRS)
|
|
|
|
list(REMOVE_DUPLICATES Tox_LIBRARIES)
|
|
|
|
|
2015-01-30 14:54:25 +01:00
|
|
|
include(FindPackageHandleStandardArgs)
|
2016-05-11 08:24:54 +02:00
|
|
|
find_package_handle_standard_args(Tox
|
|
|
|
FOUND_VAR Tox_FOUND
|
|
|
|
REQUIRED_VARS Tox_INCLUDE_DIRS Tox_LIBRARIES
|
|
|
|
HANDLE_COMPONENTS)
|