From 792517ddb4d4eea95748d7ea52dc19a253f84e0a Mon Sep 17 00:00:00 2001 From: HeroCC Date: Wed, 27 Jun 2018 10:14:14 -0400 Subject: [PATCH] Fix compiling on MacOSX Systems Setting those options made OSX quite upset for some reason, so disable them when on Macs. I haven't been able to find any issues with this, so hopefully it doesn't subtly break anything. Additionally, this will add the default MacPorts library directory to the LD Path, which fixes linking against Log4CPP. --- CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4e177f..6408971 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,12 @@ cmake_minimum_required(VERSION 2.8.0) project(mumlib) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -add_definitions(-DOPT_TLS_GNUTLS -D_POSIX_C_SOURCE=200112L) + +if (NOT APPLE) + add_definitions(-DOPT_TLS_GNUTLS -D_POSIX_C_SOURCE=200112L) +else() + LINK_DIRECTORIES(/opt/local/lib) # Include the default MacPorts library directory +endif() INCLUDE(FindPkgConfig) find_package(PkgConfig REQUIRED)