use /usr/lib/x86_64-linux-gnu/netradiant path
authorWalter Doekes <walter+github@wjd.nu>
Wed, 13 Apr 2022 19:51:52 +0000 (21:51 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 18 Jun 2022 21:25:47 +0000 (23:25 +0200)
CMakeLists.txt
radiant/environment.cpp

index d865faf5ab091ade78031e66c28a187fdb6f2b09..187accfe43f271ea43dde8bc7b09b7c1eb22dfe5 100644 (file)
@@ -119,21 +119,22 @@ set(RADIANT_BASENAME "netradiant" CACHE INTERNAL "...")
 add_definitions(-DRADIANT_BASENAME="${RADIANT_BASENAME}")
 
 set(RADIANT_BIN_DIR ${FINAL_INSTALL_PREFIX} CACHE INTERNAL "...")
-set(RADIANT_LIB_DIR ${FINAL_INSTALL_PREFIX}/lib CACHE INTERNAL "...")
+set(RADIANT_LIB_DIR ${FINAL_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE} CACHE INTERNAL "...")
 set(RADIANT_ADDONS_DIR ${FINAL_INSTALL_PREFIX} CACHE INTERNAL "...")
-set(RADIANT_ETC_DIR ${FINAL_INSTALL_PREFIX}/etc CACHE INTERNAL "...")
 set(RADIANT_SHARE_DIR ${FINAL_INSTALL_PREFIX}/share CACHE INTERNAL "...")
 set(RADIANT_DATA_DIR ${FINAL_INSTALL_PREFIX} CACHE INTERNAL "...")
 
 if (FHS_INSTALL AND NOT BUNDLE_LIBRARIES)
     set(RADIANT_BIN_DIR ${FINAL_INSTALL_PREFIX}/bin)
-    set(RADIANT_LIB_DIR ${FINAL_INSTALL_PREFIX}/lib)
+    set(RADIANT_LIB_DIR ${FINAL_INSTALL_PREFIX}/lib/${CMAKE_LIBRARY_ARCHITECTURE})
     set(RADIANT_ADDONS_DIR ${RADIANT_LIB_DIR}/${RADIANT_BASENAME})
-    set(RADIANT_ETC_DIR ${FINAL_INSTALL_PREFIX}/etc)
     set(RADIANT_SHARE_DIR ${FINAL_INSTALL_PREFIX}/share)
     set(RADIANT_DATA_DIR ${RADIANT_SHARE_DIR}/${RADIANT_BASENAME})
 endif ()
 
+add_definitions(-DRADIANT_ADDONS_DIR="${RADIANT_ADDONS_DIR}")
+add_definitions(-DRADIANT_DATA_DIR="${RADIANT_DATA_DIR}")
+
 set(GAMEPACKS_DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/download CACHE PATH "Where to store downloaded game packs")
 
 #-----------------------------------------------------------------------
index f79755183bb7682456369cd7fb38c26013328542..f9c6c55debff2bab8530078bb901f2fc43e94a71 100644 (file)
@@ -281,7 +281,11 @@ void environment_init( int argc, char const* argv[] ){
 
        {
                StringOutputStream buffer;
+#ifdef RADIANT_ADDONS_DIR
+               buffer << RADIANT_ADDONS_DIR << "/";
+#else
                buffer << app_path.c_str() << "../lib/" << RADIANT_BASENAME << "/";
+#endif
                if ( file_is_directory( buffer.c_str() ) ) {
                        lib_path = buffer.c_str();
                }
@@ -292,7 +296,11 @@ void environment_init( int argc, char const* argv[] ){
 
        {
                StringOutputStream buffer;
+#ifdef RADIANT_DATA_DIR
+               buffer << RADIANT_DATA_DIR << "/";
+#else
                buffer << app_path.c_str() << "../share/" << RADIANT_BASENAME << "/";
+#endif
                if ( file_is_directory( buffer.c_str() ) ) {
                        data_path = buffer.c_str();
                }