summaryrefslogtreecommitdiff
blob: 2b3a0554d89c89eea4c288ed982aa9a33abb7499 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From: Julian Ospald <hasufell@gentoo.org>
Date: Wed Jan 29 02:35:52 UTC 2014
Subject: make paths modifiable

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,10 @@
 
 set(quest_name "zsdx")
 
+set(DATAROOTDIR "share" CACHE PATH "dataroot dir")
+set(DATADIR "${DATAROOTDIR}/solarus" CACHE PATH "data dir")
+set(BINDIR "bin" CACHE PATH "bin dir")
+
 # data files list
 file(GLOB_RECURSE data_files
   RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/data
@@ -47,7 +51,7 @@
 add_custom_command(
   OUTPUT ${quest_name}
   COMMAND echo '\#!/bin/sh' > ${quest_name}
-  COMMAND echo 'solarus ${CMAKE_INSTALL_PREFIX}/share/solarus/${quest_name} $*' >> ${quest_name}
+  COMMAND echo 'solarus ${DATADIR}/${quest_name} $*' >> ${quest_name}
 )
 add_custom_target(${quest_name}_command
   ALL
@@ -56,11 +60,11 @@
 
 # install the data archive
 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/data.solarus
-  DESTINATION share/solarus/${quest_name}
+  DESTINATION ${DATADIR}/${quest_name}
 )
 
 # install the script
 install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${quest_name}
-  DESTINATION bin
+	DESTINATION ${BINDIR}
 )