|
From: Lasse Kärkkäi. <tr...@us...> - 2009-07-03 02:43:13
|
Module: performous
Branch: master
Commit: 4bf3b3ed61a5f51b59f473954828ae59bcde31d5
Author: Lasse Karkkainen <tro...@tr...>
Date: Thu Jul 2 05:42:13 2009 +0200
Compatibility changes and fixes...
---
CMakeLists.txt | 2 +-
cmake/Modules/FindBoost.cmake | 6 ------
data/CMakeLists.txt | 3 ++-
game/CMakeLists.txt | 3 ++-
game/configuration.cc | 4 ++--
game/main.cc | 12 ++++++++++--
6 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1f7d9a..578ee8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,7 +22,7 @@ if(NOT CMAKE_BUILD_TYPE)
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.")
+ 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)
diff --git a/cmake/Modules/FindBoost.cmake b/cmake/Modules/FindBoost.cmake
index b1a5387..9cda27d 100644
--- a/cmake/Modules/FindBoost.cmake
+++ b/cmake/Modules/FindBoost.cmake
@@ -383,12 +383,6 @@ ELSE (_boost_IN_CACHE)
SET(Boost_PROCESS_INCLUDES Boost_INCLUDE_DIR)
FOREACH ( COMPONENT ${Boost_FIND_COMPONENTS} )
- if (CMAKE_BUILD_TYPE MATCHES "Deb" AND Boost_${COMPONENT}_LIBRARY_DEBUG)
- set(Boost_${COMPONENT}_LIBRARY ${Boost_${COMPONENT}_LIBRARY_RELEASE})
- endif (CMAKE_BUILD_TYPE MATCHES "Deb" AND Boost_${COMPONENT}_LIBRARY_DEBUG)
- if (NOT CMAKE_BUILD_TYPE MATCHES "Deb" AND Boost_${COMPONENT}_LIBRARY_RELEASE)
- set(Boost_${COMPONENT}_LIBRARY ${Boost_${COMPONENT}_LIBRARY_RELEASE})
- endif (NOT CMAKE_BUILD_TYPE MATCHES "Deb" AND Boost_${COMPONENT}_LIBRARY_RELEASE)
SET(Boost_PROCESS_LIBS ${Boost_PROCESS_LIBS} Boost_${COMPONENT}_LIBRARY)
ENDFOREACH(COMPONENT)
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index ed4dee7..80942d2 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -5,5 +5,6 @@ set(CONFIG_FILE "performous.xml")
if(UNIX)
install(FILES "${APPLICATION_FILE}" DESTINATION "share/applications/")
install(FILES "${PIXMAP_FILE}" DESTINATION "share/pixmaps")
- install(FILES "${CONFIG_FILE}" DESTINATION "${CMAKE_INSTALL_PREFIX}/${SHARE_INSTALL}/config/")
endif(UNIX)
+
+install(FILES "${CONFIG_FILE}" DESTINATION "${CMAKE_INSTALL_PREFIX}/${SHARE_INSTALL}/config/")
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index bda767d..46ed686 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -18,7 +18,8 @@ include_directories(${Boost_INCLUDE_DIRS})
set(LIBS ${LIBS} ${Boost_LIBRARIES})
# Find all the libs that don't require extra parameters
-foreach(lib SDL LibRSVG PangoCairo LibXML++ Magick++ OpenGL GLEW AVFormat SWScale)
+# LibRSVG
+foreach(lib SDL PangoCairo LibXML++ Magick++ OpenGL GLEW AVFormat SWScale)
find_package(${lib} REQUIRED)
include_directories(${${lib}_INCLUDE_DIRS})
set(LIBS ${LIBS} ${${lib}_LIBRARIES})
diff --git a/game/configuration.cc b/game/configuration.cc
index 4b0a17a..7e8aa2f 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -287,13 +287,13 @@ void readConfig() {
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/
+ config_list.push_back("../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;
oss << "No config schema file found. The following locations were tried:\n";
std::copy(config_list.begin(), config_list.end(), std::ostream_iterator<std::string>(oss, "\n"));
- oss << "Install the file or define environment variable PERFORMOUS_DEFAULT_CONFIG_FILE\n";
+ oss << "Install the file or define environment variable PERFORMOUS_CONFIG_SCHEMA\n";
throw std::runtime_error(oss.str());
}
schemafile = *it;
diff --git a/game/main.cc b/game/main.cc
index 906aeef..34efa15 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -173,8 +173,16 @@ int main(int argc, char** argv) {
std::signal(SIGINT, quit);
std::signal(SIGTERM, quit);
std::ios::sync_with_stdio(false); // We do not use C stdio
- da::initialize libda;
- readConfig();
+ try {
+ da::initialize libda;
+ readConfig();
+ } catch (std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ return EXIT_FAILURE;
+ } catch (...) {
+ std::cerr << "Some b0rked internal error, please report this!" << std::endl;
+ return EXIT_FAILURE;
+ }
std::vector<std::string> mics;
std::vector<std::string> pdevs;
std::vector<std::string> songdirs;
|