aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authormydesktop <dev.mc2@gmail.com>2014-04-30 16:50:06 -0400
committermydesktop <dev.mc2@gmail.com>2014-04-30 16:50:06 -0400
commit79a4bedc3669dfd3a3845e78ede144b5d7be7d1c (patch)
treeb34d971740ab96625267b6d2fd3f03fa6ac81977 /CMakeLists.txt
parentvarious fixes to allow mac osx compilation (diff)
downloadmonero-79a4bedc3669dfd3a3845e78ede144b5d7be7d1c.tar.xz
mac osx building fixes
Diffstat (limited to '')
-rw-r--r--CMakeLists.txt21
1 files changed, 13 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8510b3690..69f0ef3eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,20 +3,20 @@ cmake_minimum_required(VERSION 2.8.6)
set(VERSION "0.1")
# $Format:Packaged from commit %H%nset(COMMIT %h)%nset(REFS "%d")$
-function(set_static_flags)
-if (NOT APPLE)
- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
-endif()
-endfunction(set_static_flags)
-
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
enable_testing()
+function(set_static_flags)
+ if (NOT APPLE)
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
+ endif()
+endfunction(set_static_flags)
+
include_directories(src contrib/epee/include external "${CMAKE_BINARY_DIR}/version")
if(APPLE)
-include_directories(SYSTEM /usr/include/malloc)
+ include_directories(SYSTEM /usr/include/malloc)
endif()
set(STATIC ${MSVC} CACHE BOOL "Link libraries statically")
@@ -61,6 +61,9 @@ else()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -D_GNU_SOURCE ${MINGW_FLAG} ${STATIC_ASSERT_FLAG} ${WARNINGS} ${C_WARNINGS} ${ARCH_FLAG}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -D_GNU_SOURCE ${MINGW_FLAG} ${WARNINGS} ${CXX_WARNINGS} ${ARCH_FLAG}")
+ if(APPLE)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGTEST_HAS_TR1_TUPLE=0")
+ endif()
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8))
set(DEBUG_FLAGS "-g3 -Og")
else()
@@ -90,8 +93,10 @@ endif()
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(MINGW)
set(Boost_LIBRARIES "${Boost_LIBRARIES};ws2_32;mswsock")
-elseif(NOT MSVC)
+elseif(APPLE)
set(Boost_LIBRARIES "${Boost_LIBRARIES}")
+elseif(NOT MSVC)
+ set(Boost_LIBRARIES "${Boost_LIBRARIES};rt")
endif()
set(COMMIT_ID_IN_VERSION ON CACHE BOOL "Include commit ID in version")