DATADIR fixed
authordisplacer
Thu, 23 Nov 2006 21:03:11 +0000
changeset 265 bd06dcfa5bff
parent 264 1c50fe872a64
child 266 53f46353d029
DATADIR fixed
CMakeLists.txt
QTfrontend/CMakeLists.txt
--- a/CMakeLists.txt	Thu Nov 23 21:03:05 2006 +0000
+++ b/CMakeLists.txt	Thu Nov 23 21:03:11 2006 +0000
@@ -2,11 +2,11 @@
 
 cmake_minimum_required(VERSION 2.4.0)
 
-if(EXISTS ${DATA_INSTALL_DIR})
+if(DEFINED ${DATA_INSTALL_DIR})
 	set(SHAREPATH ${DATA_INSTALL_DIR}/hedgewars/)
-else(EXISTS ${DATA_INSTALL_DIR})
+else(DEFINED ${DATA_INSTALL_DIR})
 	set(SHAREPATH share/hedgewars/)
-endif(EXISTS ${DATA_INSTALL_DIR})
+endif(DEFINED ${DATA_INSTALL_DIR})
 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
 
 add_subdirectory(bin)
--- a/QTfrontend/CMakeLists.txt	Thu Nov 23 21:03:05 2006 +0000
+++ b/QTfrontend/CMakeLists.txt	Thu Nov 23 21:03:11 2006 +0000
@@ -8,7 +8,11 @@
 	set(HEDGEWARS_BINDIR ".")
 else(WIN32 AND NOT UNIX)
 	set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX})
-	set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR})
+	if(DEFINED ${DATA_INSTALL_DIR})
+		set(HEDGEWARS_DATADIR ${DATA_INSTALL_DIR})
+	else(DEFINED ${DATA_INSTALL_DIR})
+		set(HEDGEWARS_DATADIR ${CMAKE_INSTALL_PREFIX}/share/)
+	endif(DEFINED ${DATA_INSTALL_DIR})
 endif(WIN32 AND NOT UNIX)
 
 configure_file(${hedgewars_SOURCE_DIR}/QTfrontend/main.cpp.in