Skip to content

Commit 4ea5a96

Browse files
committedApr 27, 2015
Revert the upper-case PROJECT_NAME nonsense that was part of #2402
1 parent 558d715 commit 4ea5a96

13 files changed

+53
-52
lines changed
 

‎CMakeLists.txt

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ if(${CMAKE_VERSION} STREQUAL "2.8.2")
66
endif()
77

88
# This can be read from ${PROJECT_NAME} after project() is called
9-
project(Minetest)
10-
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
9+
project(minetest)
10+
set(PROJECT_NAME_CAPITALIZED "Minetest")
1111

1212

1313
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
@@ -65,11 +65,11 @@ if(WIN32)
6565
set(EXAMPLE_CONF_DIR ".")
6666
set(LOCALEDIR "locale")
6767
elseif(APPLE)
68-
set(BUNDLE_NAME ${PROJECT_NAME_LOWER}.app)
68+
set(BUNDLE_NAME ${PROJECT_NAME}.app)
6969
set(BUNDLE_PATH "${BUNDLE_NAME}")
7070
set(BINDIR ${BUNDLE_NAME}/Contents/MacOS)
7171
set(SHAREDIR ${BUNDLE_NAME}/Contents/Resources)
72-
set(DOCDIR "${SHAREDIR}/${PROJECT_NAME_LOWER}")
72+
set(DOCDIR "${SHAREDIR}/${PROJECT_NAME}")
7373
set(EXAMPLE_CONF_DIR ${DOCDIR})
7474
set(LOCALEDIR "${SHAREDIR}/locale")
7575
elseif(UNIX) # Linux, BSD etc
@@ -84,15 +84,15 @@ elseif(UNIX) # Linux, BSD etc
8484
set(ICONDIR "unix/icons")
8585
set(LOCALEDIR "locale")
8686
else()
87-
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}")
87+
set(SHAREDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}")
8888
set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
89-
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME_LOWER}")
89+
set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}")
9090
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
9191
set(EXAMPLE_CONF_DIR ${DOCDIR})
9292
set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
9393
set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/appdata")
9494
set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
95-
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME_LOWER}/locale")
95+
set(LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/locale")
9696
endif()
9797
endif()
9898

‎misc/winresource.rc

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ BEGIN
3737
BLOCK "040904b0"
3838
BEGIN
3939
VALUE "Comments", ""
40-
VALUE "CompanyName", PROJECT_NAME " community"
41-
VALUE "FileDescription", PROJECT_NAME " engine main executable"
40+
VALUE "CompanyName", PROJECT_NAME_C " community"
41+
VALUE "FileDescription", PROJECT_NAME_C " engine"
4242
VALUE "FileVersion", VERSION_STRING
4343
VALUE "InternalName", PROJECT_NAME
44-
VALUE "LegalCopyright", "(c) 2014 celeron55"
44+
VALUE "LegalCopyright", "(c) 2011-2015 celeron55"
4545
VALUE "LegalTrademarks", """Minetest"" is the property of the Minetest community, don't use it without permission!"
4646
VALUE "OriginalFilename", "minetest.exe"
4747
VALUE "PrivateBuild", VERSION_EXTRA
48-
VALUE "ProductName", PROJECT_NAME
48+
VALUE "ProductName", PROJECT_NAME_C
4949
VALUE "ProductVersion", PRODUCT_VERSION_STRING
5050
VALUE "SpecialBuild", BUILDMODE
5151
END

‎src/CMakeLists.txt

+21-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
cmake_minimum_required(VERSION 2.6)
22

3-
project(Minetest)
4-
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
3+
project(minetest)
54

65
INCLUDE(CheckIncludeFiles)
76

@@ -465,10 +464,10 @@ set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
465464

466465

467466
if(BUILD_CLIENT)
468-
add_executable(${PROJECT_NAME_LOWER} ${client_SRCS})
469-
add_dependencies(${PROJECT_NAME_LOWER} GenerateVersion)
467+
add_executable(${PROJECT_NAME} ${client_SRCS})
468+
add_dependencies(${PROJECT_NAME} GenerateVersion)
470469
set(client_LIBS
471-
${PROJECT_NAME_LOWER}
470+
${PROJECT_NAME}
472471
${ZLIB_LIBRARIES}
473472
${IRRLICHT_LIBRARY}
474473
${OPENGL_LIBRARIES}
@@ -497,55 +496,55 @@ if(BUILD_CLIENT)
497496
endif()
498497
if(USE_CURL)
499498
target_link_libraries(
500-
${PROJECT_NAME_LOWER}
499+
${PROJECT_NAME}
501500
${CURL_LIBRARY}
502501
)
503502
endif()
504503
if(USE_FREETYPE)
505504
if(FREETYPE_PKGCONFIG_FOUND)
506-
set_target_properties(${PROJECT_NAME_LOWER}
505+
set_target_properties(${PROJECT_NAME}
507506
PROPERTIES
508507
COMPILE_FLAGS "${FREETYPE_CFLAGS_STR}"
509508
)
510509
endif()
511510
target_link_libraries(
512-
${PROJECT_NAME_LOWER}
511+
${PROJECT_NAME}
513512
${FREETYPE_LIBRARY}
514513
${CGUITTFONT_LIBRARY}
515514
)
516515
endif()
517516
if (USE_LEVELDB)
518-
target_link_libraries(${PROJECT_NAME_LOWER} ${LEVELDB_LIBRARY})
517+
target_link_libraries(${PROJECT_NAME} ${LEVELDB_LIBRARY})
519518
endif()
520519
if (USE_REDIS)
521-
target_link_libraries(${PROJECT_NAME_LOWER} ${REDIS_LIBRARY})
520+
target_link_libraries(${PROJECT_NAME} ${REDIS_LIBRARY})
522521
endif()
523522
endif(BUILD_CLIENT)
524523

525524

526525
if(BUILD_SERVER)
527-
add_executable(${PROJECT_NAME_LOWER}server ${server_SRCS})
528-
add_dependencies(${PROJECT_NAME_LOWER}server GenerateVersion)
526+
add_executable(${PROJECT_NAME}server ${server_SRCS})
527+
add_dependencies(${PROJECT_NAME}server GenerateVersion)
529528
target_link_libraries(
530-
${PROJECT_NAME_LOWER}server
529+
${PROJECT_NAME}server
531530
${ZLIB_LIBRARIES}
532531
${SQLITE3_LIBRARY}
533532
${JSON_LIBRARY}
534533
${GETTEXT_LIBRARY}
535534
${LUA_LIBRARY}
536535
${PLATFORM_LIBS}
537536
)
538-
set_target_properties(${PROJECT_NAME_LOWER}server PROPERTIES
537+
set_target_properties(${PROJECT_NAME}server PROPERTIES
539538
COMPILE_DEFINITIONS "SERVER")
540539
if (USE_LEVELDB)
541-
target_link_libraries(${PROJECT_NAME_LOWER}server ${LEVELDB_LIBRARY})
540+
target_link_libraries(${PROJECT_NAME}server ${LEVELDB_LIBRARY})
542541
endif()
543542
if (USE_REDIS)
544-
target_link_libraries(${PROJECT_NAME_LOWER}server ${REDIS_LIBRARY})
543+
target_link_libraries(${PROJECT_NAME}server ${REDIS_LIBRARY})
545544
endif()
546545
if(USE_CURL)
547546
target_link_libraries(
548-
${PROJECT_NAME_LOWER}server
547+
${PROJECT_NAME}server
549548
${CURL_LIBRARY}
550549
)
551550
endif()
@@ -646,7 +645,7 @@ if(WIN32)
646645
endif()
647646

648647
if(BUILD_CLIENT)
649-
install(TARGETS ${PROJECT_NAME_LOWER}
648+
install(TARGETS ${PROJECT_NAME}
650649
RUNTIME DESTINATION ${BINDIR}
651650
LIBRARY DESTINATION ${BINDIR}
652651
ARCHIVE DESTINATION ${BINDIR}
@@ -664,7 +663,7 @@ if(BUILD_CLIENT)
664663
if(USE_GETTEXT)
665664
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
666665
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
667-
set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME_LOWER}.mo")
666+
set(MO_BUILD_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
668667
install(FILES ${MO_BUILD_PATH} DESTINATION ${MO_DEST_PATH})
669668
endforeach()
670669
endif()
@@ -685,16 +684,16 @@ if(BUILD_CLIENT)
685684
endif(BUILD_CLIENT)
686685

687686
if(BUILD_SERVER)
688-
install(TARGETS ${PROJECT_NAME_LOWER}server DESTINATION ${BINDIR})
687+
install(TARGETS ${PROJECT_NAME}server DESTINATION ${BINDIR})
689688
endif()
690689

691690
if (USE_GETTEXT)
692691
set(MO_FILES)
693692

694693
foreach(LOCALE ${GETTEXT_AVAILABLE_LOCALES})
695-
set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME_LOWER}.po")
694+
set(PO_FILE_PATH "${GETTEXT_PO_PATH}/${LOCALE}/${PROJECT_NAME}.po")
696695
set_mo_paths(MO_BUILD_PATH MO_DEST_PATH ${LOCALE})
697-
set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME_LOWER}.mo")
696+
set(MO_FILE_PATH "${MO_BUILD_PATH}/${PROJECT_NAME}.mo")
698697

699698
add_custom_command(OUTPUT ${MO_BUILD_PATH}
700699
COMMAND ${CMAKE_COMMAND} -E make_directory ${MO_BUILD_PATH}

‎src/client/clientlauncher.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ bool ClientLauncher::run(GameParams &game_params, const Settings &cmd_args)
110110
return false;
111111
}
112112

113-
porting::setXorgClassHint(video_driver->getExposedVideoData(), PROJECT_NAME);
113+
porting::setXorgClassHint(video_driver->getExposedVideoData(), PROJECT_NAME_C);
114114

115115
/*
116116
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)
183183
{
184184
// Set the window caption
185185
const wchar_t *text = wgettext("Main Menu");
186-
device->setWindowCaption((narrow_to_wide(PROJECT_NAME) + L" [" + text + L"]").c_str());
186+
device->setWindowCaption((narrow_to_wide(PROJECT_NAME_C) + L" [" + text + L"]").c_str());
187187
delete[] text;
188188

189189
try { // This is used for catching disconnects

‎src/cmake_config.h.in

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#define CMAKE_CONFIG_H
55

66
#define PROJECT_NAME "@PROJECT_NAME@"
7+
#define PROJECT_NAME_C "@PROJECT_NAME_CAPITALIZED@"
78
#define VERSION_MAJOR @VERSION_MAJOR@
89
#define VERSION_MINOR @VERSION_MINOR@
910
#define VERSION_PATCH @VERSION_PATCH@

‎src/config.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
#if defined USE_CMAKE_CONFIG_H
1414
#include "cmake_config.h"
1515
#elif defined (__ANDROID__) || defined (ANDROID)
16-
#define PROJECT_NAME "Minetest"
16+
#define PROJECT_NAME "minetest"
17+
#define PROJECT_NAME_C "Minetest"
1718
#define STATIC_SHAREDIR ""
1819
#include "android_version.h"
1920
#ifdef NDEBUG

‎src/defaultsettings.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ void set_default_settings(Settings *settings)
322322
settings->setDefault("enable_particles", "false");
323323
settings->setDefault("video_driver", "ogles1");
324324
settings->setDefault("touchtarget", "true");
325-
settings->setDefault("TMPFolder","/sdcard/" PROJECT_NAME "/tmp/");
325+
settings->setDefault("TMPFolder","/sdcard/" PROJECT_NAME_C "/tmp/");
326326
settings->setDefault("touchscreen_threshold","20");
327327
settings->setDefault("smooth_lighting", "false");
328328
settings->setDefault("max_simultaneous_block_sends_per_client", "3");

‎src/emerge.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ void *EmergeThread::Thread()
522522
<< "----" << std::endl
523523
<< "\"" << e.what() << "\"" << std::endl
524524
<< "See debug.txt." << std::endl
525-
<< "World probably saved by a newer version of " PROJECT_NAME "."
525+
<< "World probably saved by a newer version of " PROJECT_NAME_C "."
526526
<< std::endl;
527527
m_server->setAsyncFatalError(err.str());
528528
}

‎src/game.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ static void show_pause_menu(GUIFormSpecMenu **cur_formspec,
11341134
os << "button_exit[4," << (ypos++) << ";3,0.5;btn_exit_os;"
11351135
<< wide_to_narrow(wstrgettext("Exit to OS")) << "]"
11361136
<< "textarea[7.5,0.25;3.9,6.25;;" << control_text << ";]"
1137-
<< "textarea[0.4,0.25;3.5,6;;" << PROJECT_NAME "\n"
1137+
<< "textarea[0.4,0.25;3.5,6;;" << PROJECT_NAME_C "\n"
11381138
<< g_build_info << "\n"
11391139
<< "path_user = " << wrap_rows(porting::path_user, 20)
11401140
<< "\n;]";
@@ -2029,7 +2029,7 @@ bool Game::createClient(const std::string &playername,
20292029

20302030
/* Set window caption
20312031
*/
2032-
std::wstring str = narrow_to_wide(PROJECT_NAME);
2032+
std::wstring str = narrow_to_wide(PROJECT_NAME_C);
20332033
str += L" [";
20342034
str += driver->getName();
20352035
str += L"]";
@@ -2054,7 +2054,7 @@ bool Game::initGui()
20542054
{
20552055
// First line of debug text
20562056
guitext = guienv->addStaticText(
2057-
narrow_to_wide(PROJECT_NAME).c_str(),
2057+
narrow_to_wide(PROJECT_NAME_C).c_str(),
20582058
core::rect<s32>(0, 0, 0, 0),
20592059
false, false, guiroot);
20602060

@@ -4018,7 +4018,7 @@ void Game::updateGui(float *statustext_time, const RunStats &stats,
40184018

40194019
std::ostringstream os(std::ios_base::binary);
40204020
os << std::fixed
4021-
<< PROJECT_NAME " " << g_version_hash
4021+
<< PROJECT_NAME_C " " << g_version_hash
40224022
<< " FPS = " << fps
40234023
<< " (R: range_all=" << draw_control->range_all << ")"
40244024
<< std::setprecision(0)
@@ -4034,7 +4034,7 @@ void Game::updateGui(float *statustext_time, const RunStats &stats,
40344034
guitext->setVisible(true);
40354035
} else if (flags.show_hud || flags.show_chat) {
40364036
std::ostringstream os(std::ios_base::binary);
4037-
os << PROJECT_NAME " " << g_version_hash;
4037+
os << PROJECT_NAME_C " " << g_version_hash;
40384038
guitext->setText(narrow_to_wide(os.str()).c_str());
40394039
guitext->setVisible(true);
40404040
} else {
@@ -4267,7 +4267,7 @@ void the_game(bool *kill,
42674267
} catch (SerializationError &e) {
42684268
error_message = std::string("A serialization error occurred:\n")
42694269
+ e.what() + "\n\nThe server is probably "
4270-
" running a different version of " PROJECT_NAME ".";
4270+
" running a different version of " PROJECT_NAME_C ".";
42714271
errorstream << error_message << std::endl;
42724272
} catch (ServerError &e) {
42734273
error_message = e.what();

‎src/guiEngine.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
172172
m_sound_manager = &dummySoundManager;
173173

174174
//create topleft header
175-
std::wstring t = narrow_to_wide(std::string(PROJECT_NAME " ") +
175+
std::wstring t = narrow_to_wide(std::string(PROJECT_NAME_C " ") +
176176
g_version_hash);
177177

178178
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)
572572
/******************************************************************************/
573573
void GUIEngine::setTopleftText(std::string append)
574574
{
575-
std::wstring toset = narrow_to_wide(std::string(PROJECT_NAME " ") +
575+
std::wstring toset = narrow_to_wide(std::string(PROJECT_NAME_C " ") +
576576
g_version_hash);
577577

578578
if (append != "")

‎src/httpfetch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ HTTPFetchRequest::HTTPFetchRequest()
4747
connect_timeout = timeout;
4848
multipart = false;
4949

50-
useragent = std::string(PROJECT_NAME "/") + g_version_hash + " (" + porting::get_sysinfo() + ")";
50+
useragent = std::string(PROJECT_NAME_C "/") + g_version_hash + " (" + porting::get_sysinfo() + ")";
5151
}
5252

5353

‎src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ static void print_allowed_options(const OptionList &allowed_options)
347347

348348
static void print_version()
349349
{
350-
dstream << PROJECT_NAME " " << g_version_hash << std::endl;
350+
dstream << PROJECT_NAME_C " " << g_version_hash << std::endl;
351351
#ifndef SERVER
352352
dstream << "Using Irrlicht " << IRRLICHT_SDK_VERSION << std::endl;
353353
#endif

‎src/porting.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ bool setSystemPaths()
479479
DWORD len = GetEnvironmentVariable("APPDATA", buf, sizeof(buf));
480480
FATAL_ERROR_IF(len == 0 || len > sizeof(buf), "Failed to get APPDATA");
481481

482-
path_user = std::string(buf) + DIR_DELIM + lowercase(PROJECT_NAME);
482+
path_user = std::string(buf) + DIR_DELIM + PROJECT_NAME;
483483
return true;
484484
}
485485

@@ -511,7 +511,7 @@ bool setSystemPaths()
511511
trylist.push_back(static_sharedir);
512512

513513
trylist.push_back(bindir + DIR_DELIM ".." DIR_DELIM "share"
514-
DIR_DELIM + lowercase(PROJECT_NAME));
514+
DIR_DELIM + PROJECT_NAME);
515515
trylist.push_back(bindir + DIR_DELIM "..");
516516

517517
#ifdef __ANDROID__
@@ -540,7 +540,7 @@ bool setSystemPaths()
540540

541541
#ifndef __ANDROID__
542542
path_user = std::string(getenv("HOME")) + DIR_DELIM "."
543-
+ lowercase(PROJECT_NAME);
543+
+ PROJECT_NAME;
544544
#endif
545545

546546
return true;
@@ -565,7 +565,7 @@ bool setSystemPaths()
565565

566566
path_user = std::string(getenv("HOME"))
567567
+ "/Library/Application Support/"
568-
+ lowercase(PROJECT_NAME);
568+
+ PROJECT_NAME;
569569
return true;
570570
}
571571

0 commit comments

Comments
 (0)
Please sign in to comment.