aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-06-01 08:08:41 -0700
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2011-06-01 08:08:41 -0700
commit15b375827ee57137d91e49d5fc902c0f1c66e189 (patch)
tree99d16deda79234710507bded7685403d4b56d8d8
parent60578e0950d3235401d3a7504d602d5e398b7122 (diff)
parent28234f6e54d91dbc8f3ec23b514a6d6ffe3a78a9 (diff)
downloadminetest-15b375827ee57137d91e49d5fc902c0f1c66e189.tar.gz
minetest-15b375827ee57137d91e49d5fc902c0f1c66e189.tar.bz2
minetest-15b375827ee57137d91e49d5fc902c0f1c66e189.zip
Merge pull request #5 from bucket-T/master
MacOSX build support
-rw-r--r--CMakeLists.txt2
-rw-r--r--src/CMakeLists.txt23
2 files changed, 21 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d5b8028f6..b1803bc9e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -104,7 +104,7 @@ elseif(APPLE)
set(CPACK_BUNDLE_ICON "")
set(CPACK_BUNDLE_PLIST "")
set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest")
- set(CPACK_GENERATOR BUNDLE)
+ set(CPACK_GENERATOR "Bundle")
else()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux")
set(CPACK_GENERATOR TGZ)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 49982d310..617a452b6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -35,13 +35,24 @@ else()
find_package(JPEG REQUIRED)
find_package(BZip2 REQUIRED)
find_package(PNG REQUIRED)
+ if(APPLE)
+ FIND_LIBRARY(CARBON_LIB Carbon)
+ FIND_LIBRARY(COCOA_LIB Cocoa)
+ FIND_LIBRARY(IOKIT_LIB IOKit)
+ mark_as_advanced(
+ CARBON_LIB
+ COCOA_LIB
+ IOKIT_LIB
+ )
+ SET(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${CARBON_LIB} ${COCOA_LIB} ${IOKIT_LIB})
+ endif(APPLE)
endif(BUILD_CLIENT)
find_package(ZLIB REQUIRED)
set(PLATFORM_LIBS -lpthread)
#set(CLIENT_PLATFORM_LIBS -lXxf86vm)
# This way Xxf86vm is found on OpenBSD too
find_library(XXF86VM_LIBRARY Xxf86vm)
- set(CLIENT_PLATFORM_LIBS ${XXF86VM_LIBRARY})
+ set(CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY})
endif()
configure_file(
@@ -174,8 +185,14 @@ else()
set(WARNING_FLAGS "")
endif()
- set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable")
-
+ if(NOT APPLE)
+ set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-unused-but-set-variable")
+ endif()
+ if(APPLE)
+ set(CMAKE_OSX_ARCHITECTURES i386 CACHE STRING "do not build for 64-bit" FORCE)
+ set(ARCH i386)
+ endif()
+
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall")