|
From: Lasse Kärkkäi. <tr...@us...> - 2009-07-02 21:09:34
|
Module: performous
Branch: master
Commit: 16dc0bceaff393027b78ff2f2bce503556ac97bf
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Jul 3 00:08:37 2009 +0300
Improved and cleared path config. Do not build launcher script for WIN32.
---
CMakeLists.txt | 29 +++++++++++++++++------------
cmake/performous.sh.cmake | 2 +-
data/performous.xml | 2 ++
game/configuration.cc | 3 ++-
4 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ea8169..b1f7d9a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Performous CXX)
cmake_minimum_required(VERSION 2.4)
-set(PROJECT_VERSION "0.3.0svn")
+set(PROJECT_VERSION "0.3.0+")
# Avoid source tree pollution
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
@@ -21,8 +21,12 @@ if(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE)
+if(WIN32)
+ set(SHARE_INSTALL "" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
+else(WIN32)
+ set(SHARE_INSTALL "share/games/performous" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
+endif(WIN32)
-set(SHARE_INSTALL "share/games/performous" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
mark_as_advanced(SHARE_INSTALL)
add_subdirectory(libs)
@@ -36,23 +40,24 @@ if (ENABLE_TOOLS)
add_subdirectory(tools)
endif (ENABLE_TOOLS)
-if(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^(/usr|/usr/local)$")
- message(STATUS "Non-standard installation prefix. Configuring performous.sh.")
- set(LAUNCHER_SCRIPT TRUE)
-endif(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^(/usr|/usr/local)$")
+if(NOT WIN32)
+ if(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^(/usr|/usr/local)$")
+ message(STATUS "Non-standard installation prefix. Configuring performous.sh.")
+ set(LAUNCHER_SCRIPT TRUE)
+ endif(NOT "${CMAKE_INSTALL_PREFIX}" MATCHES "^(/usr|/usr/local)$")
-if(NOT "${SHARE_INSTALL}" MATCHES "^(share/performous|share/games/performous)$")
- message(STATUS "Non-standard data file install path. Configuring performous.sh.")
- set(LAUNCHER_SCRIPT TRUE)
-endif(NOT "${SHARE_INSTALL}" MATCHES "^(share/performous|share/games/performous)$")
+ if(NOT "${SHARE_INSTALL}" MATCHES "^(share/performous|share/games/performous)$")
+ message(STATUS "Non-standard data file install path. Configuring performous.sh.")
+ set(LAUNCHER_SCRIPT TRUE)
+ endif(NOT "${SHARE_INSTALL}" MATCHES "^(share/performous|share/games/performous)$")
+endif(NOT WIN32)
if(LAUNCHER_SCRIPT)
set(FULL_PREFIX ${CMAKE_INSTALL_PREFIX})
if(UNIX AND NOT "${FULL_PREFIX}" MATCHES "^/")
set(FULL_PREFIX "${CMAKE_BINARY_DIR}/${FULL_PREFIX}")
endif(UNIX AND NOT "${FULL_PREFIX}" MATCHES "^/")
- set(PERFORMOUS_CONFIG_FILE "${FULL_PREFIX}/${SHARE_INSTALL}/config/performous.xml")
- set(PERFORMOUS_THEME_PATH "${FULL_PREFIX}/${SHARE_INSTALL}/themes")
+ set(PERFORMOUS_CONFIG_SCHEMA "${FULL_PREFIX}/${SHARE_INSTALL}/config/performous.xml")
set(PERFORMOUS_PLUGIN_PATH "${FULL_PREFIX}/lib${LIB_SUFFIX}/libda")
set(PERFORMOUS_EXECUTABLE "${FULL_PREFIX}/bin/performous")
configure_file("${PROJECT_SOURCE_DIR}/cmake/performous.sh.cmake" "${PROJECT_BINARY_DIR}/performous.sh" ESCAPE_QUOTES @ONLY)
diff --git a/cmake/performous.sh.cmake b/cmake/performous.sh.cmake
index d6271d2..f3d30f7 100644
--- a/cmake/performous.sh.cmake
+++ b/cmake/performous.sh.cmake
@@ -1,4 +1,4 @@
#!/bin/sh
-env PERFORMOUS_DEFAULT_CONFIG_FILE=@PERFORMOUS_CONFIG_FILE@ PLUGIN_PATH=@PERFORMOUS_PLUGIN_PATH@ PERFORMOUS_THEME_PATH=@PERFORMOUS_THEME_PATH@ @PERFORMOUS_EXECUTABLE@ "$@"
+env PERFORMOUS_CONFIG_SCHEMA='@PERFORMOUS_CONFIG_SCHEMA@' PLUGIN_PATH='@PERFORMOUS_PLUGIN_PATH@' '@PERFORMOUS_EXECUTABLE@' $@
diff --git a/data/performous.xml b/data/performous.xml
index 59cffc6..c90f84e 100644
--- a/data/performous.xml
+++ b/data/performous.xml
@@ -175,6 +175,7 @@
<entry name="system/path_themes" type="string_list">
<stringvalue>/usr/local/share/games/performous/themes/</stringvalue>
<stringvalue>/usr/share/games/performous/themes/</stringvalue>
+ <stringvalue>../themes/</stringvalue><!-- For Windows where the program is started in bin/ -->
<stringvalue>~/.performous/themes/</stringvalue>
<locale name="C">
<short>Theme folders</short>
@@ -184,6 +185,7 @@
<entry name="system/path_songs" type="string_list">
<stringvalue>/usr/local/share/games/ultrastar/songs/</stringvalue>
<stringvalue>/usr/share/games/ultrastar/songs/</stringvalue>
+ <stringvalue>../songs/</stringvalue><!-- For Windows where the program is started in bin/ -->
<stringvalue>~/.ultrastar/songs/</stringvalue>
<locale name="C">
<short>Song folders</short>
diff --git a/game/configuration.cc b/game/configuration.cc
index 505e98d..4b0a17a 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -281,12 +281,13 @@ void readConfig() {
{
typedef std::vector<std::string> ConfigList;
ConfigList config_list;
- char const* env_config = getenv("PERFORMOUS_DEFAULT_CONFIG_FILE");
+ char const* env_config = getenv("PERFORMOUS_CONFIG_SCHEMA");
if (env_config) config_list.push_back(env_config);
config_list.push_back("/usr/local/share/games/performous/config/performous.xml");
config_list.push_back("/usr/local/share/performous/config/performous.xml");
config_list.push_back("/usr/share/games/performous/config/performous.xml");
config_list.push_back("/usr/share/performous/config/performous.xml");
+ config_list.push_back("../share/performous/config/performous.xml"); // For Windows where program is started in bin/
ConfigList::const_iterator it = std::find_if(config_list.begin(), config_list.end(), static_cast<bool(&)(boost::filesystem::path const&)>(boost::filesystem::exists));
if (it == config_list.end()) {
std::ostringstream oss;
|