Lots of small stuff

master
Perttu Ahola 2011-01-08 19:35:14 +02:00
parent 340de48dbf
commit eb476f1ce2
5 changed files with 20 additions and 10 deletions

View File

@ -7,6 +7,10 @@ endif(${CMAKE_VERSION} STREQUAL "2.8.2")
# This can be read from ${PROJECT_NAME} after project() is called # This can be read from ${PROJECT_NAME} after project() is called
project(minetest) project(minetest)
set(VERSION_MAJOR 0)
set(VERSION_MINOR 0)
set(VERSION_PATCH 1)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
include(${CMAKE_SOURCE_DIR}/cmake/Modules/misc.cmake) include(${CMAKE_SOURCE_DIR}/cmake/Modules/misc.cmake)
@ -52,6 +56,7 @@ install(FILES "minetest.conf.example" DESTINATION "${DOCDIR}")
# #
# Subdirectories # Subdirectories
# Be sure to add all relevant definitions above this
# #
add_subdirectory(src) add_subdirectory(src)
@ -59,11 +64,10 @@ add_subdirectory(src)
# CPack # CPack
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game")
set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR 0) set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH 0) set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
set(CPACK_PACKAGE_VENDOR "celeron55") set(CPACK_PACKAGE_VENDOR "celeron55")
set(CPACK_PACKAGE_FILE_NAME "minetest-${BUILD_DATE}")
if(WIN32) if(WIN32)
# For some reason these aren't copied otherwise # For some reason these aren't copied otherwise
@ -74,6 +78,8 @@ if(WIN32)
install(FILES bin/minetestserver.exe DESTINATION bin) install(FILES bin/minetestserver.exe DESTINATION bin)
endif() endif()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-win32")
set(CPACK_GENERATOR ZIP) set(CPACK_GENERATOR ZIP)
# This might be needed for some installer # This might be needed for some installer
@ -81,7 +87,7 @@ if(WIN32)
elseif(APPLE) elseif(APPLE)
# TODO # TODO
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29 # see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}) set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-osx")
set(CPACK_PACKAGE_ICON "") set(CPACK_PACKAGE_ICON "")
set(CPACK_BUNDLE_NAME ${PROJECT_NAME}) set(CPACK_BUNDLE_NAME ${PROJECT_NAME})
set(CPACK_BUNDLE_ICON "") set(CPACK_BUNDLE_ICON "")
@ -89,6 +95,7 @@ elseif(APPLE)
set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest") set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest")
set(CPACK_GENERATOR BUNDLE) set(CPACK_GENERATOR BUNDLE)
else() else()
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-linux")
set(CPACK_GENERATOR TGZ) set(CPACK_GENERATOR TGZ)
set(CPACK_SOURCE_GENERATOR TGZ) set(CPACK_SOURCE_GENERATOR TGZ)
endif() endif()

View File

@ -135,7 +135,9 @@ endif(BUILD_SERVER)
if( UNIX ) if( UNIX )
# Unix # Unix
set(UNIX_FLAGS "-Wall") # NOTE: -Wall gets applied automatically to debug builds
#set(UNIX_FLAGS "")
if(BUILD_CLIENT) if(BUILD_CLIENT)
set_target_properties(minetest PROPERTIES COMPILE_FLAGS set_target_properties(minetest PROPERTIES COMPILE_FLAGS

View File

@ -4,7 +4,8 @@
#define CONFIG_H #define CONFIG_H
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@" #define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define BUILD_INFO "BUILD_DATE=@BUILD_DATE@ RUN_IN_PLACE=@RUN_IN_PLACE@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@" #define VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
#define BUILD_INFO "VER="VERSION_STRING" BUILD_DATE=@BUILD_DATE@ RUN_IN_PLACE=@RUN_IN_PLACE@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@"
#endif #endif

View File

@ -76,7 +76,7 @@ public:
if(g_debugstreams[i] == stderr && m_disable_stderr) if(g_debugstreams[i] == stderr && m_disable_stderr)
continue; continue;
if(g_debugstreams[i] != NULL) if(g_debugstreams[i] != NULL)
fwrite(&c, 1, 1, g_debugstreams[i]); (void)fwrite(&c, 1, 1, g_debugstreams[i]);
//TODO: Is this slow? //TODO: Is this slow?
fflush(g_debugstreams[i]); fflush(g_debugstreams[i]);
} }
@ -90,7 +90,7 @@ public:
if(g_debugstreams[i] == stderr && m_disable_stderr) if(g_debugstreams[i] == stderr && m_disable_stderr)
continue; continue;
if(g_debugstreams[i] != NULL) if(g_debugstreams[i] != NULL)
fwrite(s, 1, n, g_debugstreams[i]); (void)fwrite(s, 1, n, g_debugstreams[i]);
//TODO: Is this slow? //TODO: Is this slow?
fflush(g_debugstreams[i]); fflush(g_debugstreams[i]);
} }

View File

@ -1804,7 +1804,7 @@ continue_generating:
/* /*
Don't always generate dungeon Don't always generate dungeon
*/ */
if(found_existing || rand() % 3 == 0) if(found_existing || rand() % 2 == 0)
{ {
/* /*
Generate some tunnel starting from orp and ors Generate some tunnel starting from orp and ors