mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 05:13:59 +02:00
- step #1 towards a working make install via cmake
This commit is contained in:
@@ -190,3 +190,47 @@ TARGET_LINK_LIBRARIES(${TARGET_NAME} libmegaglest)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
TARGET_LINK_LIBRARIES(${TARGET_NAME} ${EXTERNAL_LIBS})
|
||||||
|
|
||||||
|
# Installation of the program
|
||||||
|
INSTALL(TARGETS
|
||||||
|
${TARGET_NAME}
|
||||||
|
DESTINATION bin/megaglest)
|
||||||
|
|
||||||
|
# Installation of the program config and image files
|
||||||
|
INSTALL(FILES
|
||||||
|
"${PROJECT_SOURCE_DIR}/mk/linux/glest.ini"
|
||||||
|
"${PROJECT_SOURCE_DIR}/mk/linux/glestkeys.ini"
|
||||||
|
"${PROJECT_SOURCE_DIR}/mk/linux/megaglest.bmp"
|
||||||
|
"${PROJECT_SOURCE_DIR}/data/glest_game/megaglest.ico"
|
||||||
|
DESTINATION bin/megaglest)
|
||||||
|
|
||||||
|
# Installation of the tools
|
||||||
|
#INSTALL(TARGETS
|
||||||
|
# "${PROJECT_SOURCE_DIR}/mk/linux/megaglest_configurator"
|
||||||
|
# "${PROJECT_SOURCE_DIR}/mk/linux/megaglest_editor"
|
||||||
|
# "${PROJECT_SOURCE_DIR}/mk/linux/megaglest_g3dviewer"
|
||||||
|
# DESTINATION bin/megaglest)
|
||||||
|
|
||||||
|
# Installation of the program config and image files
|
||||||
|
#INSTALL(FILES
|
||||||
|
# "${PROJECT_SOURCE_DIR}/mk/linux/g3dviewer.ico"
|
||||||
|
# "${PROJECT_SOURCE_DIR}/mk/linux/editor.ico"
|
||||||
|
# "${PROJECT_SOURCE_DIR}/mk/linux/configuration.xml"
|
||||||
|
# DESTINATION bin/megaglest)
|
||||||
|
|
||||||
|
# Installation of data files from outside normal data folder
|
||||||
|
INSTALL(DIRECTORY "${PROJECT_SOURCE_DIR}/source/masterserver/flags"
|
||||||
|
DESTINATION share/megaglest/data/core/misc_textures
|
||||||
|
OPTIONAL REGEX "/.svn" EXCLUDE)
|
||||||
|
|
||||||
|
# Installation of the data
|
||||||
|
install(
|
||||||
|
DIRECTORY "${PROJECT_SOURCE_DIR}/data/glest_game/data"
|
||||||
|
"${PROJECT_SOURCE_DIR}/data/glest_game/docs"
|
||||||
|
"${PROJECT_SOURCE_DIR}/data/glest_game/maps"
|
||||||
|
"${PROJECT_SOURCE_DIR}/data/glest_game/scenarios"
|
||||||
|
"${PROJECT_SOURCE_DIR}/data/glest_game/techs"
|
||||||
|
"${PROJECT_SOURCE_DIR}/data/glest_game/tilesets"
|
||||||
|
"${PROJECT_SOURCE_DIR}/data/glest_game/tutorials"
|
||||||
|
DESTINATION share/megaglest
|
||||||
|
OPTIONAL REGEX "/.svn" EXCLUDE)
|
||||||
|
|
||||||
|
@@ -2724,7 +2724,7 @@ int glestMainWrapper(int argc, char** argv) {
|
|||||||
#ifdef WIN32_STACK_TRACE
|
#ifdef WIN32_STACK_TRACE
|
||||||
__try {
|
__try {
|
||||||
#endif
|
#endif
|
||||||
application_binary= executable_path(argv[0]);
|
application_binary= executable_path(argv[0],true);
|
||||||
//printf("\n\nargv0 [%s] application_binary [%s]\n\n",argv[0],application_binary.c_str());
|
//printf("\n\nargv0 [%s] application_binary [%s]\n\n",argv[0],application_binary.c_str());
|
||||||
|
|
||||||
#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__FreeBSD__) && !defined(BSD)
|
#if defined(__GNUC__) && !defined(__MINGW32__) && !defined(__FreeBSD__) && !defined(BSD)
|
||||||
|
@@ -195,9 +195,6 @@ std::vector<std::string> FactionType::validateFactionType() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//const SoundContainer & getCommandSounds() const { return commandSounds; }
|
|
||||||
|
|
||||||
|
|
||||||
for(int j = 0; j < unitType.getCommandTypeCount(); ++j) {
|
for(int j = 0; j < unitType.getCommandTypeCount(); ++j) {
|
||||||
const CommandType *cmdType = unitType.getCommandType(j);
|
const CommandType *cmdType = unitType.getCommandType(j);
|
||||||
if(cmdType != NULL) {
|
if(cmdType != NULL) {
|
||||||
|
@@ -701,7 +701,7 @@ void UnitUpdater::updateBuild(Unit *unit, int frameIndex) {
|
|||||||
builtUnit->create();
|
builtUnit->create();
|
||||||
|
|
||||||
if(builtUnitType->hasSkillClass(scBeBuilt) == false) {
|
if(builtUnitType->hasSkillClass(scBeBuilt) == false) {
|
||||||
throw runtime_error("Unit [" + builtUnitType->getName() + "] has no be_built skill.");
|
throw runtime_error("Unit [" + builtUnitType->getName() + "] has no be_built skill, producer was [" + intToStr(unit->getId()) + " - " + unit->getType()->getName() + "].");
|
||||||
}
|
}
|
||||||
|
|
||||||
builtUnit->setCurrSkill(scBeBuilt);
|
builtUnit->setCurrSkill(scBeBuilt);
|
||||||
|
@@ -209,7 +209,7 @@ inline string trim (const string & s, const string & t = SPACES) {
|
|||||||
string getFullFileArchiveExtractCommand(string fileArchiveExtractCommand,
|
string getFullFileArchiveExtractCommand(string fileArchiveExtractCommand,
|
||||||
string fileArchiveExtractCommandParameters, string outputpath, string archivename);
|
string fileArchiveExtractCommandParameters, string outputpath, string archivename);
|
||||||
bool executeShellCommand(string cmd,int expectedResult=IGNORE_CMD_RESULT_VALUE);
|
bool executeShellCommand(string cmd,int expectedResult=IGNORE_CMD_RESULT_VALUE);
|
||||||
string executable_path(string exeName);
|
string executable_path(string exeName,bool includeExeNameInPath=false);
|
||||||
|
|
||||||
class ValueCheckerVault {
|
class ValueCheckerVault {
|
||||||
|
|
||||||
|
@@ -1678,24 +1678,44 @@ off_t getFileSize(string filename) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
string executable_path(string exeName) {
|
string executable_path(string exeName, bool includeExeNameInPath) {
|
||||||
string value = "";
|
string value = "";
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
char path[MAX_PATH]="";
|
char path[MAX_PATH]="";
|
||||||
if( GetModuleFileName(NULL,path,MAX_PATH) == 0 ) {
|
if( GetModuleFileName(NULL,path,MAX_PATH) == 0 ) {
|
||||||
value = extractDirectoryPathFromFile(exeName);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = exeName;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(exeName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = extractDirectoryPathFromFile(path);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#elif __APPLE__
|
#elif __APPLE__
|
||||||
char path[MAXPATHLEN+1]="";
|
char path[MAXPATHLEN+1]="";
|
||||||
uint32_t path_len = MAXPATHLEN;
|
uint32_t path_len = MAXPATHLEN;
|
||||||
if ( _NSGetExecutablePath(path, &path_len) ) {
|
if ( _NSGetExecutablePath(path, &path_len) ) {
|
||||||
value = extractDirectoryPathFromFile(exeName);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = exeName;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(exeName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = extractDirectoryPathFromFile(path);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
char exe_link_path[200]="";
|
char exe_link_path[200]="";
|
||||||
@@ -1703,23 +1723,43 @@ string executable_path(string exeName) {
|
|||||||
if(length < 0 || length >= 200 ) {
|
if(length < 0 || length >= 200 ) {
|
||||||
char *argv0_path = realpath(exeName.c_str(),NULL);
|
char *argv0_path = realpath(exeName.c_str(),NULL);
|
||||||
if(argv0_path != NULL) {
|
if(argv0_path != NULL) {
|
||||||
value = extractDirectoryPathFromFile(argv0_path);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = argv0_path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(argv0_path);
|
||||||
|
}
|
||||||
free(argv0_path);
|
free(argv0_path);
|
||||||
argv0_path = NULL;
|
argv0_path = NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const char *shell_path = getenv("_");
|
const char *shell_path = getenv("_");
|
||||||
if(shell_path != NULL) {
|
if(shell_path != NULL) {
|
||||||
value = extractDirectoryPathFromFile(shell_path);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = shell_path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(shell_path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value = extractDirectoryPathFromFile(exeName);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = exeName;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(exeName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
exe_link_path[length] = '\0';
|
exe_link_path[length] = '\0';
|
||||||
value = extractDirectoryPathFromFile(exe_link_path);
|
if(includeExeNameInPath == true) {
|
||||||
|
value = exe_link_path;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
value = extractDirectoryPathFromFile(exe_link_path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return value;
|
return value;
|
||||||
|
Reference in New Issue
Block a user