From 5a6599148018aa6b3557834acd47465064ad3bfc Mon Sep 17 00:00:00 2001 From: fluffypony Date: Tue, 9 Sep 2014 14:03:42 +0200 Subject: exclude local miniupnpc for FreeBSD, install from ports instead --- CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c5a7220e9..9614d7028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,6 +7,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++") -- cgit v1.2.3 From 0e343ecfdf862452933f2f5c10d4a93603a7de14 Mon Sep 17 00:00:00 2001 From: fluffypony Date: Wed, 10 Sep 2014 13:25:34 +0200 Subject: make FreeBSD use -lcompat till we can fix ftime() --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9614d7028..ea5a094f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,6 +130,10 @@ elseif(NOT MSVC) set(Boost_LIBRARIES "${Boost_LIBRARIES};rt;pthread") endif() +if(FREEBSD) + set(BSD_COMPAT "compat") +endif() + set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version") file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version") if (NOT COMMIT_ID_IN_VERSION) -- cgit v1.2.3 From a8d043b6dd58a15bb21448db8e141a76e5c8276e Mon Sep 17 00:00:00 2001 From: fluffypony Date: Wed, 10 Sep 2014 13:55:39 +0200 Subject: replace ftime with gettimeofday on FreeBSD because lcompat is stupid --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index ea5a094f7..9614d7028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,10 +130,6 @@ elseif(NOT MSVC) set(Boost_LIBRARIES "${Boost_LIBRARIES};rt;pthread") endif() -if(FREEBSD) - set(BSD_COMPAT "compat") -endif() - set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version") file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/version") if (NOT COMMIT_ID_IN_VERSION) -- cgit v1.2.3 From 81490d2aeae80ef3c3ab8ca209675ae2a950ac37 Mon Sep 17 00:00:00 2001 From: fluffypony Date: Wed, 10 Sep 2014 14:19:42 +0200 Subject: miniupnpc changes for freebsd --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9614d7028..11273adca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,6 +113,10 @@ else() endif() endif() +if(NOT FREEBSD) + set(UPNP_LIBRARIES "upnpc-static") +endif() + if(STATIC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) -- cgit v1.2.3 From 7d01dad8f4fdef18936977defab18c13dc32d19b Mon Sep 17 00:00:00 2001 From: fluffypony Date: Wed, 10 Sep 2014 18:14:57 +0200 Subject: use external miniupnpc if available --- CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 11273adca..9614d7028 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,10 +113,6 @@ else() endif() endif() -if(NOT FREEBSD) - set(UPNP_LIBRARIES "upnpc-static") -endif() - if(STATIC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) -- cgit v1.2.3 From 8d8b47e69f6bd1cfbd8f94c8ffc30b0ad3f19fc0 Mon Sep 17 00:00:00 2001 From: fluffypony Date: Wed, 10 Sep 2014 20:01:30 +0200 Subject: more dynamic miniupnp fixes --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9614d7028..3b07a96eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,14 @@ if (UNIX AND NOT APPLE) find_package(Threads) endif() +if(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER) + add_definitions("-DUPNP_DYNAMIC") + set(UPNP_LIBRARIES "miniupnpc") +else() + add_definitions("-DUPNP_STATIC") + set(UPNP_LIBRARIES "upnpc-static") +endif() + if(MSVC) add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__") # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline") -- cgit v1.2.3 From 36c7ea9f778f8cd6a5f2b58d5e3f9d49430eb0fa Mon Sep 17 00:00:00 2001 From: fluffypony Date: Thu, 11 Sep 2014 08:22:49 +0200 Subject: more CMake tweaks to allow detection on OS X --- CMakeLists.txt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b07a96eb..2353a6c08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,14 +43,6 @@ if (UNIX AND NOT APPLE) find_package(Threads) endif() -if(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER) - add_definitions("-DUPNP_DYNAMIC") - set(UPNP_LIBRARIES "miniupnpc") -else() - add_definitions("-DUPNP_STATIC") - set(UPNP_LIBRARIES "upnpc-static") -endif() - if(MSVC) add_definitions("/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__") # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Dinline=__inline") @@ -165,5 +157,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) -- cgit v1.2.3 From d21cf293e14060a7a640237c943a1b083cbb66d2 Mon Sep 17 00:00:00 2001 From: fluffypony Date: Thu, 11 Sep 2014 08:25:07 +0200 Subject: added license to CMake --- CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2353a6c08..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") -- cgit v1.2.3