Skip to content
This repository was archived by the owner on Mar 28, 2025. It is now read-only.

Commit 4847e6b

Browse files
authored
Define paths earlier in CMakeLists.txt
At the very least, paths should be defined before Configure_File(), otherwise empty DATAROOTDIR is substituted in config.h
1 parent 5f2c065 commit 4847e6b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

CMakeLists.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ Project (meandmyshadow)
22
CMake_Minimum_Required (VERSION 3.1)
33
Set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
44

5+
#Path options
6+
Set (BINDIR "bin" CACHE STRING "Where to install binaries")
7+
Set (DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of data directories to a non-default location")
8+
Set (ICONDIR "${DATAROOTDIR}/icons" CACHE STRING "Sets the icon directory for desktop entry to a non-default location.")
9+
Set (DESKTOPDIR "${DATAROOTDIR}/applications" CACHE STRING "Sets the desktop file directory for desktop entry to a non-default location.")
10+
11+
#Options
512
Option (DEBUG_MODE "Compile the game with debug mode enabled" OFF)
613
Option (DISABLED_DEBUG_STUFF "Enable this you'll see a lot of annoying script debug messages which will lag the game." OFF)
714

@@ -164,12 +171,6 @@ Target_Link_Libraries (
164171
${LUA_LIBRARIES}
165172
)
166173

167-
#Path options
168-
Set (BINDIR "bin" CACHE STRING "Where to install binaries")
169-
Set (DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of data directories to a non-default location")
170-
Set (ICONDIR "${DATAROOTDIR}/icons" CACHE STRING "Sets the icon directory for desktop entry to a non-default location.")
171-
Set (DESKTOPDIR "${DATAROOTDIR}/applications" CACHE STRING "Sets the desktop file directory for desktop entry to a non-default location.")
172-
173174
#Install locations
174175
Install (DIRECTORY ${PROJECT_SOURCE_DIR}/data DESTINATION ${DATAROOTDIR}/meandmyshadow/)
175176
Install (FILES AUTHORS DESTINATION ${DATAROOTDIR}/meandmyshadow/)

0 commit comments

Comments
 (0)