diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c5a7220e9..e93c278da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,33 @@ +# Copyright (c) 2014, The Monero Project +# +# 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 + cmake_minimum_required(VERSION 2.8.6) set(VERSION "0.1") @@ -7,6 +37,23 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CMAKE_CONFIGURATION_TYPES "Debug;Release") enable_testing() +# Check if we're on FreeBSD so we can exclude the local miniupnpc (it should be installed from ports instead) +# CMAKE_SYSTEM_NAME checks are commonly known, but specifically taken from libsdl's CMakeLists +if(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD.*") + set(FREEBSD TRUE) +elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD") + set(FREEBSD TRUE) +endif() + +# TODO: check bsdi, NetBSD, OpenBSD, to see if they need the same FreeBSD changes +# +# elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*") +# set(NETBSD TRUE) +# elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") +# set(OPENBSD TRUE) +# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*") +# set(BSDI TRUE) + function(set_static_flags) if (NOT APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") @@ -140,5 +187,14 @@ else() endif() add_subdirectory(external) + +# Final setup for miniupnpc +if(UPNP_STATIC) + add_definitions("-DUPNP_STATIC") +else() + add_definitions("-DUPNP_DYNAMIC") + include_directories(${UPNP_INCLUDE}) +endif() + add_subdirectory(src) add_subdirectory(tests) |