Set a default datadir, in sync with the data installation path.

dev-ui
Didier Raboud 2012-12-16 21:29:13 +01:00
parent 0b78ebd0f7
commit c190c3efae
3 changed files with 8 additions and 4 deletions

View File

@ -162,5 +162,6 @@ endif()
# Subdirectory with sources # Subdirectory with sources
add_subdirectory(src bin) add_subdirectory(src bin)
# TODO: provide data files as git submodule and setup correct data path # TODO: provide data files as git submodule
install_files(/share/games/colobot ../data) set(COLOBOT_DATA_DIR ${CMAKE_INSTALL_PREFIX}/share/games/colobot CACHE PATH "Colobot shared data directory")
install(DIRECTORY ../data DESTINATION ${COLOBOT_DATA_DIR})

View File

@ -15,6 +15,7 @@
// * You should have received a copy of the GNU General Public License // * You should have received a copy of the GNU General Public License
// * along with this program. If not, see http://www.gnu.org/licenses/. // * along with this program. If not, see http://www.gnu.org/licenses/.
#include "common/config.h"
#include "app/app.h" #include "app/app.h"
@ -130,7 +131,7 @@ CApplication::CApplication()
m_mouseButtonsState = 0; m_mouseButtonsState = 0;
m_trackedKeys = 0; m_trackedKeys = 0;
m_dataPath = "./data"; m_dataPath = CBOT_DEFAULT_DATADIR;
m_language = LANGUAGE_ENV; m_language = LANGUAGE_ENV;

View File

@ -7,3 +7,5 @@
#cmakedefine USE_GLEW @USE_GLEW@ #cmakedefine USE_GLEW @USE_GLEW@
#cmakedefine GLEW_STATIC #cmakedefine GLEW_STATIC
#define CBOT_DEFAULT_DATADIR "@COLOBOT_DATA_DIR@"