Revert the upper-case PROJECT_NAME nonsense that was part of #2402
authorsfan5 <sfan5@live.de>
Mon, 27 Apr 2015 14:17:10 +0000 (16:17 +0200)
committersfan5 <sfan5@live.de>
Mon, 27 Apr 2015 14:24:49 +0000 (16:24 +0200)
13 files changed:
CMakeLists.txt
misc/winresource.rc
src/CMakeLists.txt
src/client/clientlauncher.cpp
src/cmake_config.h.in
src/config.h
src/defaultsettings.cpp
src/emerge.cpp
src/game.cpp
src/guiEngine.cpp
src/httpfetch.cpp
src/main.cpp
src/porting.cpp

index 2561d1917ba22b13100985af7af1e0bd0503eec2..639c070777229f03746650beac31aebdd69362ff 100644 (file)
@@ -6,8 +6,8 @@ if(${CMAKE_VERSION} STREQUAL "2.8.2")
 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
@@ -65,11 +65,11 @@ if(WIN32)
        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
@@ -84,15 +84,15 @@ 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()
 
index 5f214391a7a95ff00a3f44fb6956716ed7aee16a..6b82e261b233695461d1c4ef56abd9ceb0f99088 100644 (file)
@@ -37,15 +37,15 @@ BEGIN
         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
index 3a8a432eaecbcd3c6b85745354a3032656b00e3d..66c8170cbc0c4649f739405cd0a9ba238fef8a3a 100644 (file)
@@ -1,7 +1,6 @@
 cmake_minimum_required(VERSION 2.6)
 
-project(Minetest)
-string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
+project(minetest)
 
 INCLUDE(CheckIncludeFiles)
 
@@ -465,10 +464,10 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
 
 
 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}
@@ -497,37 +496,37 @@ if(BUILD_CLIENT)
        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}
@@ -535,17 +534,17 @@ if(BUILD_SERVER)
                ${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()
@@ -646,7 +645,7 @@ if(WIN32)
 endif()
 
 if(BUILD_CLIENT)
-       install(TARGETS ${PROJECT_NAME_LOWER}
+       install(TARGETS ${PROJECT_NAME}
                RUNTIME DESTINATION ${BINDIR}
                LIBRARY DESTINATION ${BINDIR}
                ARCHIVE DESTINATION ${BINDIR}
@@ -664,7 +663,7 @@ if(BUILD_CLIENT)
        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()
@@ -685,16 +684,16 @@ if(BUILD_CLIENT)
 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}
index 5307ccd4bc02647490de048073d196e8b16af50d..d6327e25915123498d7ecb86a704376b6a36b213 100644 (file)
@@ -110,7 +110,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
                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.
@@ -183,7 +183,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
        {
                // 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
index 7d446d17872cb4928f6146f81e64114327b666d4..c5ca2c80307ed28138d1bd90019f0ee2791f8301 100644 (file)
@@ -4,6 +4,7 @@
 #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@
index df7429be0cb83c242a41efd6472096ad3f610ab7..0955ea8f5463180eea2f1a912b756e7388a1ee78 100644 (file)
@@ -13,7 +13,8 @@
 #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
index 7f3122314617ab24f1c37463b364dfb3ca76fcc4..e629377ee06d64c1a95f39ac1723828a9be069c7 100644 (file)
@@ -322,7 +322,7 @@ void set_default_settings(Settings *settings)
        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");
index 9c5ee452ef6f0bd6389f5f181582bfdef3b2b6ee..de9a16ac749c0500def8413d335c376f4b2edbf3 100644 (file)
@@ -522,7 +522,7 @@ void *EmergeThread::Thread()
                        << "----" << 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());
        }
index 706f118cb56e31700996a82b883c1aec1bac0423..af68a2571b191367abbf3eb4336623187b02e1a9 100644 (file)
@@ -1134,7 +1134,7 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec,
        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;]";
@@ -2029,7 +2029,7 @@ bool Game::createClient(const std::string &playername,
 
        /* 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"]";
@@ -2054,7 +2054,7 @@ bool Game::initGui()
 {
        // 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);
 
@@ -4018,7 +4018,7 @@ void Game::updateGui(float *statustext_time, const RunStats &stats,
 
                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)
@@ -4034,7 +4034,7 @@ void Game::updateGui(float *statustext_time, const RunStats &stats,
                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 {
@@ -4267,7 +4267,7 @@ void the_game(bool *kill,
        } 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();
index 6989ffa35415fe917e3a427b94ae6b20fa0c8f2e..752f9ddd25af8fd44fe591bbb515c215e1d5b6c8 100644 (file)
@@ -172,7 +172,7 @@ GUIEngine::GUIEngine(       irr::IrrlichtDevice* dev,
                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());
@@ -572,7 +572,7 @@ bool GUIEngine::downloadFile(std::string url, std::string target)
 /******************************************************************************/
 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 != "")
index 50ad9e4afe69d7263586a8977dd5003aa95480f7..c60e141fc087fbdcd40fc09d1ec2a437db1a88da 100644 (file)
@@ -47,7 +47,7 @@ HTTPFetchRequest::HTTPFetchRequest()
        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() + ")";
 }
 
 
index 7223522cc44c61828c025a0b72be2176f7e7bb36..79daa7b8cdea7408402890e95ac3e5e19d0c0675 100644 (file)
@@ -347,7 +347,7 @@ static void print_allowed_options(const OptionList &allowed_options)
 
 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
index 1fa451d10100dd85b8d47de8e0ac2a9a1a38d14d..29c82fe24252b3ca11c722f80276568ce7b580cb 100644 (file)
@@ -479,7 +479,7 @@ bool setSystemPaths()
        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;
 }
 
@@ -511,7 +511,7 @@ bool setSystemPaths()
                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__
@@ -540,7 +540,7 @@ bool setSystemPaths()
 
 #ifndef __ANDROID__
        path_user = std::string(getenv("HOME")) + DIR_DELIM "."
-               + lowercase(PROJECT_NAME);
+               + PROJECT_NAME;
 #endif
 
        return true;
@@ -565,7 +565,7 @@ bool setSystemPaths()
 
        path_user = std::string(getenv("HOME"))
                + "/Library/Application Support/"
-               + lowercase(PROJECT_NAME);
+               + PROJECT_NAME;
        return true;
 }