endif()
# This can be read from ${PROJECT_NAME} after project() is called
-project(Minetest)
-string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
+project(minetest)
+set(PROJECT_NAME_CAPITALIZED "Minetest")
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
set(EXAMPLE_CONF_DIR ".")
set(LOCALEDIR "locale")
elseif(APPLE)
- set(BUNDLE_NAME ${PROJECT_NAME_LOWER}.app)
+ set(BUNDLE_NAME ${PROJECT_NAME}.app)
set(BUNDLE_PATH "${BUNDLE_NAME}")
set(BINDIR ${BUNDLE_NAME}/Contents/MacOS)
set(SHAREDIR ${BUNDLE_NAME}/Contents/Resources)
- set(DOCDIR "${SHAREDIR}/${PROJECT_NAME_LOWER}")
+ set(DOCDIR "${SHAREDIR}/${PROJECT_NAME}")
set(EXAMPLE_CONF_DIR ${DOCDIR})
set(LOCALEDIR "${SHAREDIR}/locale")
elseif(UNIX) # Linux, BSD etc
set(ICONDIR "unix/icons")
set(LOCALEDIR "locale")
else()
- set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}")
+ set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
- set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME_LOWER}")
+ set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
set(EXAMPLE_CONF_DIR ${DOCDIR})
set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/appdata")
set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
- set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/locale")
+ set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/locale")
endif()
endif()
BLOCK "040904b0"\r
BEGIN\r
VALUE "Comments", ""\r
- VALUE "CompanyName", PROJECT_NAME " community"\r
- VALUE "FileDescription", PROJECT_NAME " engine main executable"\r
+ VALUE "CompanyName", PROJECT_NAME_C " community"\r
+ VALUE "FileDescription", PROJECT_NAME_C " engine"\r
VALUE "FileVersion", VERSION_STRING\r
VALUE "InternalName", PROJECT_NAME\r
- VALUE "LegalCopyright", "(c) 2014 celeron55"\r
+ VALUE "LegalCopyright", "(c) 2011-2015 celeron55"\r
VALUE "LegalTrademarks", """Minetest"" is the property of the Minetest community, don't use it without permission!"\r
VALUE "OriginalFilename", "minetest.exe"\r
VALUE "PrivateBuild", VERSION_EXTRA\r
- VALUE "ProductName", PROJECT_NAME\r
+ VALUE "ProductName", PROJECT_NAME_C\r
VALUE "ProductVersion", PRODUCT_VERSION_STRING\r
VALUE "SpecialBuild", BUILDMODE\r
END\r
cmake_minimum_required(VERSION 2.6)
-project(Minetest)
-string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
+project(minetest)
INCLUDE(CheckIncludeFiles)
if(BUILD_CLIENT)
- add_executable(${PROJECT_NAME_LOWER} ${client_SRCS})
- add_dependencies(${PROJECT_NAME_LOWER} GenerateVersion)
+ add_executable(${PROJECT_NAME} ${client_SRCS})
+ add_dependencies(${PROJECT_NAME} GenerateVersion)
set(client_LIBS
- ${PROJECT_NAME_LOWER}
+ ${PROJECT_NAME}
${ZLIB_LIBRARIES}
${IRRLICHT_LIBRARY}
${OPENGL_LIBRARIES}
endif()
if(USE_CURL)
target_link_libraries(
- ${PROJECT_NAME_LOWER}
+ ${PROJECT_NAME}
${CURL_LIBRARY}
)
endif()
if(USE_FREETYPE)
if(FREETYPE_PKGCONFIG_FOUND)
- set_target_properties(${PROJECT_NAME_LOWER}
+ set_target_properties(${PROJECT_NAME}
PROPERTIES
COMPILE_FLAGS "${FREETYPE_CFLAGS_STR}"
)
endif()
target_link_libraries(
- ${PROJECT_NAME_LOWER}
+ ${PROJECT_NAME}
${FREETYPE_LIBRARY}
${CGUITTFONT_LIBRARY}
)
endif()
if (USE_LEVELDB)
- target_link_libraries(${PROJECT_NAME_LOWER} ${LEVELDB_LIBRARY})
+ target_link_libraries(${PROJECT_NAME} ${LEVELDB_LIBRARY})
endif()
if (USE_REDIS)
- target_link_libraries(${PROJECT_NAME_LOWER} ${REDIS_LIBRARY})
+ target_link_libraries(${PROJECT_NAME} ${REDIS_LIBRARY})
endif()
endif(BUILD_CLIENT)
if(BUILD_SERVER)
- add_executable(${PROJECT_NAME_LOWER}server ${server_SRCS})
- add_dependencies(${PROJECT_NAME_LOWER}server GenerateVersion)
+ add_executable(${PROJECT_NAME}server ${server_SRCS})
+ add_dependencies(${PROJECT_NAME}server GenerateVersion)
target_link_libraries(
- ${PROJECT_NAME_LOWER}server
+ ${PROJECT_NAME}server
${ZLIB_LIBRARIES}
${SQLITE3_LIBRARY}
${JSON_LIBRARY}
${LUA_LIBRARY}
${PLATFORM_LIBS}
)
- set_target_properties(${PROJECT_NAME_LOWER}server PROPERTIES
+ set_target_properties(${PROJECT_NAME}server PROPERTIES
COMPILE_DEFINITIONS "SERVER")
if (USE_LEVELDB)
- target_link_libraries(${PROJECT_NAME_LOWER}server ${LEVELDB_LIBRARY})
+ target_link_libraries(${PROJECT_NAME}server ${LEVELDB_LIBRARY})
endif()
if (USE_REDIS)
- target_link_libraries(${PROJECT_NAME_LOWER}server ${REDIS_LIBRARY})
+ target_link_libraries(${PROJECT_NAME}server ${REDIS_LIBRARY})
endif()
if(USE_CURL)
target_link_libraries(
- ${PROJECT_NAME_LOWER}server
+ ${PROJECT_NAME}server
${CURL_LIBRARY}
)
endif()
endif()
if(BUILD_CLIENT)
- install(TARGETS ${PROJECT_NAME_LOWER}
+ install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${BINDIR}
LIBRARY DESTINATION ${BINDIR}
ARCHIVE DESTINATION ${BINDIR}
if(USE_GETTEXT)
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
- set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME_LOWER}.mo")
+ set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH})
endforeach()
endif()
endif(BUILD_CLIENT)
if(BUILD_SERVER)
- install(TARGETS ${PROJECT_NAME_LOWER}server DESTINATION ${BINDIR})
+ install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR})
endif()
if (USE_GETTEXT)
set(MO_FILES)
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
- set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME_LOWER}.po")
+ set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME}.po")
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
- set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME_LOWER}.mo")
+ set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
add_custom_command(OUTPUT ${MO_BUILD_PATH}
COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH}
return false;
}
- porting::setXorgClassHint(video_driver->getExposedVideoData(), PROJECT_NAME);
+ porting::setXorgClassHint(video_driver->getExposedVideoData(), PROJECT_NAME_C);
/*
This changes the minimum allowed number of vertices in a VBO.
{
// Set the window caption
const wchar_t *text = wgettext("Main Menu");
- device->setWindowCaption((narrow_to_wide(PROJECT_NAME) + L" [" + text + L"]").c_str());
+ device->setWindowCaption((narrow_to_wide(PROJECT_NAME_C) + L" [" + text + L"]").c_str());
delete[] text;
try { // This is used for catching disconnects
#define CMAKE_CONFIG_H
#define PROJECT_NAME "@PROJECT_NAME@"
+#define PROJECT_NAME_C "@PROJECT_NAME_CAPITALIZED@"
#define VERSION_MAJOR @VERSION_MAJOR@
#define VERSION_MINOR @VERSION_MINOR@
#define VERSION_PATCH @VERSION_PATCH@
#if defined USE_CMAKE_CONFIG_H
#include "cmake_config.h"
#elif defined (__ANDROID__) || defined (ANDROID)
- #define PROJECT_NAME "Minetest"
+ #define PROJECT_NAME "minetest"
+ #define PROJECT_NAME_C "Minetest"
#define STATIC_SHAREDIR ""
#include "android_version.h"
#ifdef NDEBUG
settings->setDefault("enable_particles", "false");
settings->setDefault("video_driver", "ogles1");
settings->setDefault("touchtarget", "true");
- settings->setDefault("TMPFolder","/sdcard/" PROJECT_NAME "/tmp/");
+ settings->setDefault("TMPFolder","/sdcard/" PROJECT_NAME_C "/tmp/");
settings->setDefault("touchscreen_threshold","20");
settings->setDefault("smooth_lighting", "false");
settings->setDefault("max_simultaneous_block_sends_per_client", "3");
<< "----" << std::endl
<< "\"" << e.what() << "\"" << std::endl
<< "See debug.txt." << std::endl
- << "World probably saved by a newer version of " PROJECT_NAME "."
+ << "World probably saved by a newer version of " PROJECT_NAME_C "."
<< std::endl;
m_server->setAsyncFatalError(err.str());
}
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;"
<< wide_to_narrow(wstrgettext("Exit to OS")) << "]"
<< "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]"
- << "textarea[0.4,0.25;3.5,6;;" << PROJECT_NAME "\n"
+ << "textarea[0.4,0.25;3.5,6;;" << PROJECT_NAME_C "\n"
<< g_build_info << "\n"
<< "path_user = " << wrap_rows(porting::path_user, 20)
<< "\n;]";
/* Set window caption
*/
- std::wstring str = narrow_to_wide(PROJECT_NAME);
+ std::wstring str = narrow_to_wide(PROJECT_NAME_C);
str += L" [";
str += driver->getName();
str += L"]";
{
// First line of debug text
guitext = guienv->addStaticText(
- narrow_to_wide(PROJECT_NAME).c_str(),
+ narrow_to_wide(PROJECT_NAME_C).c_str(),
core::rect<s32>(0, 0, 0, 0),
false, false, guiroot);
std::ostringstream os(std::ios_base::binary);
os << std::fixed
- << PROJECT_NAME " " << g_version_hash
+ << PROJECT_NAME_C " " << g_version_hash
<< " FPS = " << fps
<< " (R: range_all=" << draw_control->range_all << ")"
<< std::setprecision(0)
guitext->setVisible(true);
} else if (flags.show_hud || flags.show_chat) {
std::ostringstream os(std::ios_base::binary);
- os << PROJECT_NAME " " << g_version_hash;
+ os << PROJECT_NAME_C " " << g_version_hash;
guitext->setText(narrow_to_wide(os.str()).c_str());
guitext->setVisible(true);
} else {
} catch (SerializationError &e) {
error_message = std::string("A serialization error occurred:\n")
+ e.what() + "\n\nThe server is probably "
- " running a different version of " PROJECT_NAME ".";
+ " running a different version of " PROJECT_NAME_C ".";
errorstream << error_message << std::endl;
} catch (ServerError &e) {
error_message = e.what();
m_sound_manager = &dummySoundManager;
//create topleft header
- std::wstring t = narrow_to_wide(std::string(PROJECT_NAME " ") +
+ std::wstring t = narrow_to_wide(std::string(PROJECT_NAME_C " ") +
g_version_hash);
core::rect<s32> rect(0, 0, g_fontengine->getTextWidth(t), g_fontengine->getTextHeight());
/******************************************************************************/
void GUIEngine::setTopleftText(std::string append)
{
- std::wstring toset = narrow_to_wide(std::string(PROJECT_NAME " ") +
+ std::wstring toset = narrow_to_wide(std::string(PROJECT_NAME_C " ") +
g_version_hash);
if (append != "")
connect_timeout = timeout;
multipart = false;
- useragent = std::string(PROJECT_NAME "/") + g_version_hash + " (" + porting::get_sysinfo() + ")";
+ useragent = std::string(PROJECT_NAME_C "/") + g_version_hash + " (" + porting::get_sysinfo() + ")";
}
static void print_version()
{
- dstream << PROJECT_NAME " " << g_version_hash << std::endl;
+ dstream << PROJECT_NAME_C " " << g_version_hash << std::endl;
#ifndef SERVER
dstream << "Using Irrlicht " << IRRLICHT_SDK_VERSION << std::endl;
#endif
DWORD len = GetEnvironmentVariable("APPDATA", buf, sizeof(buf));
FATAL_ERROR_IF(len == 0 || len > sizeof(buf), "Failed to get APPDATA");
- path_user = std::string(buf) + DIR_DELIM + lowercase(PROJECT_NAME);
+ path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME;
return true;
}
trylist.push_back(static_sharedir);
trylist.push_back(bindir + DIR_DELIM ".." DIR_DELIM "share"
- DIR_DELIM + lowercase(PROJECT_NAME));
+ DIR_DELIM + PROJECT_NAME);
trylist.push_back(bindir + DIR_DELIM "..");
#ifdef __ANDROID__
#ifndef __ANDROID__
path_user = std::string(getenv("HOME")) + DIR_DELIM "."
- + lowercase(PROJECT_NAME);
+ + PROJECT_NAME;
#endif
return true;
path_user = std::string(getenv("HOME"))
+ "/Library/Application Support/"
- + lowercase(PROJECT_NAME);
+ + PROJECT_NAME;
return true;
}