git repos / blockattack-game

commit 53646537

sago007 · 2020-05-10 10:18
5364653756c15a4517dcac65311b5d0d7e0a6d1f patch · browse files
parent c5cd33e7f72ef8bf0b12f0aca355a081c49b930f

Updated CMake to respect absolute paths

Changed files

M CMakeLists.txt before
diff --git a/CMakeLists.txt b/CMakeLists.txt index 324e178..57ff44a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -40,9 +40,17 @@ if (WIN32)
endif()
if (NOT WIN32 AND NOT STANDALONE)
-#The path to the data dir must be compiled into the binary
-add_definitions(-DSHAREDIR=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_DATA_DIR}\")
-add_definitions(-DLOCALEDIR=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_LOCALE_DIR}\")
+ #The path to the data dir must be compiled into the binary
+ if (IS_ABSOLUTE ${INSTALL_DATA_DIR})
+ add_definitions(-DSHAREDIR=\"${INSTALL_DATA_DIR}\")
+ else()
+ add_definitions(-DSHAREDIR=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_DATA_DIR}\")
+ endif()
+ if (IS_ABSOLUTE ${INSTALL_DATA_DIR})
+ add_definitions(-DLOCALEDIR=\"${INSTALL_LOCALE_DIR}\")
+ else()
+ add_definitions(-DLOCALEDIR=\"${CMAKE_INSTALL_PREFIX}/${INSTALL_LOCALE_DIR}\")
+ endif()
endif()
#Compiler options