mirror of
https://github.com/glest/glest-source.git
synced 2025-08-26 01:23:35 +02:00
Make snapcraft build work.
This commit is contained in:
@@ -10,6 +10,9 @@ IF(BUILD_GLEST)
|
||||
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++11")
|
||||
add_definitions("-DDATADIR=${INSTALL_DIR_DATA}")
|
||||
|
||||
# This is an environment var that pops up when building with snapcraft.
|
||||
# Use this to activate snapcraft path...
|
||||
|
||||
FIND_PACKAGE(${SDL_VERSION_NAME} REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${${SDL_VERSION_NAME}_INCLUDE_DIR})
|
||||
@@ -23,13 +26,13 @@ IF(BUILD_GLEST)
|
||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${OPENGL_LIBRARY})
|
||||
ENDIF()
|
||||
|
||||
IF(WANT_USE_XercesC)
|
||||
FIND_PACKAGE(XercesC REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${XERCESC_INCLUDE})
|
||||
IF(UNIX)
|
||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${XERCESC_LIBRARY})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
IF(WANT_USE_XercesC)
|
||||
FIND_PACKAGE(XercesC REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${XERCESC_INCLUDE})
|
||||
IF(UNIX)
|
||||
SET(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${XERCESC_LIBRARY})
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
FIND_PACKAGE(OpenAL REQUIRED)
|
||||
INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR})
|
||||
@@ -69,9 +72,9 @@ IF(BUILD_GLEST)
|
||||
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
|
||||
include(FindOpenSSL)
|
||||
IF(OPENSSL_FOUND)
|
||||
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
|
||||
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
|
||||
ELSE()
|
||||
MESSAGE(STATUS "**NOTE: OpenSSL is usually not required.")
|
||||
MESSAGE(STATUS "**NOTE: OpenSSL is usually not required.")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
@@ -289,7 +292,7 @@ IF(BUILD_GLEST)
|
||||
INSTALL(FILES
|
||||
"${PROJECT_SOURCE_DIR}/mk/shared/glest.ini"
|
||||
DESTINATION ${INSTALL_DIR_INI})
|
||||
ELSEIF(UNIX AND NOT APPLE AND FLATPAK_INSTALL)
|
||||
ELSEIF(UNIX AND NOT APPLE AND FLATPAK_INSTALL)
|
||||
INSTALL(FILES
|
||||
"${PROJECT_SOURCE_DIR}/mk/flatpak/glest.ini"
|
||||
DESTINATION ${INSTALL_DIR_INI})
|
||||
|
@@ -233,10 +233,12 @@ namespace Game {
|
||||
foundPath = tryCustomPath(cfgType, fileName, custom_path);
|
||||
}
|
||||
|
||||
#ifndef SNAPCRAFT
|
||||
if (foundPath == false) {
|
||||
currentpath = extractDirectoryPathFromFile(Properties::getApplicationPath());
|
||||
foundPath = tryCustomPath(cfgType, fileName, currentpath);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
if (foundPath == false) {
|
||||
@@ -263,6 +265,13 @@ namespace Game {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SNAPCRAFT
|
||||
if (foundPath == false) {
|
||||
foundPath = tryCustomPath(cfgType, fileName, std::getenv("SNAP") +
|
||||
endPathWithSlash(formatPath(TOSTRING(DATADIR))));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DATADIR
|
||||
if (foundPath == false) {
|
||||
foundPath = tryCustomPath(cfgType, fileName, endPathWithSlash(formatPath(TOSTRING(DATADIR))));
|
||||
|
@@ -53,8 +53,13 @@ namespace Shared {
|
||||
namespace Util {
|
||||
|
||||
string Properties::applicationPath = "";
|
||||
#ifdef SNAPCRAFT
|
||||
string Properties::applicationDataPath = std::getenv("SNAP") + formatPath(TOSTRING(DATADIR));
|
||||
#elif FLATPAK
|
||||
string Properties::applicationDataPath = formatPath(TOSTRING(DATADIR));
|
||||
#else
|
||||
string Properties::applicationDataPath = "";
|
||||
|
||||
#endif
|
||||
string Properties::techtreePath = "";
|
||||
string Properties::scenarioPath = "";
|
||||
string Properties::tutorialPath = "";
|
||||
|
Reference in New Issue
Block a user