From 2c7474af02a16627398ed9b23293ced86fd7b8fa Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 12 Jan 2015 22:48:06 +0100 Subject: [PATCH] adding the possibility to override STK_INSTALL_DATA_DIR_ABSOLUTE; This was necessary to create a ppa --- CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fbf277093..3482a4c7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -250,11 +250,15 @@ else() mark_as_advanced(PTHREAD_LIBRARY) # Set data dir (absolute or relative to CMAKE_INSTALL_PREFIX) - get_filename_component(STK_INSTALL_DATA_DIR_ABSOLUTE ${STK_INSTALL_DATA_DIR} ABSOLUTE) - if(${STK_INSTALL_DATA_DIR_ABSOLUTE} STREQUAL ${STK_INSTALL_DATA_DIR}) - add_definitions(-DSUPERTUXKART_DATADIR=\"${STK_INSTALL_DATA_DIR_ABSOLUTE}\") + if(NOT STK_INSTALL_DATA_DIR_ABSOLUTE) + get_filename_component(STK_INSTALL_DATA_DIR_ABSOLUTE ${STK_INSTALL_DATA_DIR} ABSOLUTE) + if(${STK_INSTALL_DATA_DIR_ABSOLUTE} STREQUAL ${STK_INSTALL_DATA_DIR}) + add_definitions(-DSUPERTUXKART_DATADIR=\"${STK_INSTALL_DATA_DIR_ABSOLUTE}\") + else() + add_definitions(-DSUPERTUXKART_DATADIR=\"${CMAKE_INSTALL_PREFIX}/${STK_INSTALL_DATA_DIR}\") + endif() else() - add_definitions(-DSUPERTUXKART_DATADIR=\"${CMAKE_INSTALL_PREFIX}/${STK_INSTALL_DATA_DIR}\") + add_definitions(-DSUPERTUXKART_DATADIR=\"${STK_INSTALL_DATA_DIR_ABSOLUTE}\") endif() # Build the final executable