2023-01-02 16:12:39 +01:00
# Copyright (c) 2014-2023, The Monero Project
2014-09-11 08:25:07 +02:00
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list of
# conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this list
# of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors may be
# used to endorse or promote products derived from this software without specific
# prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
2014-09-11 08:22:49 +02:00
2014-10-06 15:00:06 +02:00
# This is broken up into two parts: first we check for miniupnp, compile it if we can't
# find it, and thereafter we check for libunbound, and compile it if we can't find it.
# We always compile if we are building statically to reduce static dependency issues...
# ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with
# others.
2014-09-24 21:23:23 +02:00
2018-04-21 11:30:55 +02:00
find_package ( Miniupnpc REQUIRED )
2014-09-11 08:22:49 +02:00
2018-04-21 11:30:55 +02:00
message ( STATUS "Using in-tree miniupnpc" )
2021-01-12 14:00:42 +01:00
set ( UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE )
2018-04-21 11:30:55 +02:00
add_subdirectory ( miniupnp/miniupnpc )
set_property ( TARGET libminiupnpc-static PROPERTY FOLDER "external" )
2021-01-12 14:00:42 +01:00
set_property ( TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON )
2018-04-21 11:30:55 +02:00
if ( MSVC )
set_property ( TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267" )
elseif ( NOT MSVC )
set_property ( TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value" )
2014-09-10 18:14:57 +02:00
endif ( )
2018-09-02 16:51:23 +02:00
if ( CMAKE_SYSTEM_NAME MATCHES "NetBSD" )
set_property ( TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE" )
endif ( )
2014-10-06 15:00:06 +02:00
2018-04-21 11:30:55 +02:00
set ( UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE )
2014-10-06 18:51:03 +02:00
find_package ( Unbound )
2014-10-06 15:00:06 +02:00
2021-07-07 02:51:14 +02:00
if ( NOT UNBOUND_INCLUDE_DIR )
die ( "Could not find libunbound" )
2014-10-22 21:17:32 +02:00
else ( )
message ( STATUS "Found libunbound include (unbound.h) in ${UNBOUND_INCLUDE_DIR}" )
if ( UNBOUND_LIBRARIES )
2021-07-07 02:51:14 +02:00
message ( STATUS "Found libunbound library" )
2014-10-22 21:17:32 +02:00
else ( )
2014-10-21 19:33:26 +02:00
die ( "Found libunbound includes, but could not find libunbound library. Please make sure you have installed libunbound or libunbound-dev or the equivalent" )
2014-10-22 21:17:32 +02:00
endif ( )
endif ( )
2015-03-17 23:55:24 +01:00
add_subdirectory ( db_drivers )
2017-03-25 20:06:14 +01:00
add_subdirectory ( easylogging++ )
2020-04-29 17:53:29 +02:00
add_subdirectory ( qrcodegen )
2019-04-23 21:32:27 +02:00
add_subdirectory ( randomx EXCLUDE_FROM_ALL )