merge
authorkoda
Mon, 24 Dec 2012 16:23:55 +0100
changeset 8324 e0dcf5b0e1b1
parent 8323 ab0b618bdf13 (diff)
parent 8321 7f1120a1cea4 (current diff)
child 8325 ecd51650d5d8
merge
--- a/QTfrontend/CMakeLists.txt	Mon Dec 24 09:56:29 2012 -0500
+++ b/QTfrontend/CMakeLists.txt	Mon Dec 24 16:23:55 2012 +0100
@@ -41,8 +41,6 @@
     include_directories("/usr/local/include")
 endif(UNIX)
 
-#directory containing hw executables
-set(HEDGEWARS_BINDIR ${CMAKE_INSTALL_PREFIX}/${target_binary_install_dir})
 #directory for resources, relative to the one above on certain platforms/configurations
 if(DEFINED DATA_INSTALL_DIR OR WIN32 OR APPLE)
     set(HEDGEWARS_DATADIR ${SHAREPATH})
--- a/QTfrontend/hwconsts.cpp.in	Mon Dec 24 09:56:29 2012 -0500
+++ b/QTfrontend/hwconsts.cpp.in	Mon Dec 24 16:23:55 2012 +0100
@@ -22,10 +22,9 @@
 
 QString * cProtoVer = new QString("${HEDGEWARS_PROTO_VER}");
 QString * cDataDir = new QString("${HEDGEWARS_DATADIR}");
-QString * cConfigDir = new QString("");
 QString * cVersionString = new QString("${HEDGEWARS_VERSION}");
 
-QDir * bindir = new QDir("${HEDGEWARS_BINDIR}");
+QDir * bindir = new QDir();
 QDir * cfgdir = new QDir();
 QDir * datadir = new QDir();
 
--- a/QTfrontend/hwconsts.h	Mon Dec 24 09:56:29 2012 -0500
+++ b/QTfrontend/hwconsts.h	Mon Dec 24 16:23:55 2012 +0100
@@ -26,7 +26,6 @@
 extern QString * cProtoVer;
 extern QString * cVersionString;
 extern QString * cDataDir;
-extern QString * cConfigDir;
 
 extern QDir * bindir;
 extern QDir * cfgdir;
--- a/QTfrontend/main.cpp	Mon Dec 24 09:56:29 2012 -0500
+++ b/QTfrontend/main.cpp	Mon Dec 24 16:23:55 2012 +0100
@@ -175,9 +175,14 @@
     if(parsedArgs.contains("config-dir"))
     {
         QFileInfo f(parsedArgs["config-dir"]);
-        *cConfigDir = f.absoluteFilePath();
+        cfgdir->setPath(f.absoluteFilePath());
         custom_config = true;
     }
+    else
+    {
+        cfgdir->setPath(QDir::homePath());
+        custom_config = false;
+    }
 
     app.setStyle(new QPlastiqueStyle());
 
@@ -190,14 +195,10 @@
     qRegisterMetaType<HWTeam>("HWTeam");
 
     // workaround over NSIS installer which modifies the install path
-    bindir->cd("./");
+    //bindir->cd("./");
+    bindir->cd(QCoreApplication::applicationDirPath());
 
-    if(cConfigDir->length() == 0)
-        cfgdir->setPath(cfgdir->homePath());
-    else
-        cfgdir->setPath(*cConfigDir);
-
-    if(cConfigDir->length() == 0)
+    if(custom_config == false)
     {
 #ifdef __APPLE__
         checkForDir(cfgdir->absolutePath() + "/Library/Application Support/Hedgewars");
--- a/hedgewars/CMakeLists.txt	Mon Dec 24 09:56:29 2012 -0500
+++ b/hedgewars/CMakeLists.txt	Mon Dec 24 16:23:55 2012 +0100
@@ -224,6 +224,11 @@
             DEPENDS ${engine_sources}
             )
         add_custom_target(hwengine.${build_arch} ALL DEPENDS "${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}")
+        add_custom_command(TARGET hwengine.${build_arch} POST_BUILD
+            COMMAND "install_name_tool"
+            ARGS -id @executable_path/../Frameworks/${engine_output_name}
+                ${EXECUTABLE_OUTPUT_PATH}/hwengine.${build_arch}
+            )
     endforeach()
 
     add_custom_command(OUTPUT "${EXECUTABLE_OUTPUT_PATH}/${engine_output_name}"
--- a/tools/CMakeLists.txt	Mon Dec 24 09:56:29 2012 -0500
+++ b/tools/CMakeLists.txt	Mon Dec 24 16:23:55 2012 +0100
@@ -37,6 +37,11 @@
     endif()
 
     set(frameworks_dir ${CMAKE_INSTALL_PREFIX}/${target_library_install_dir})
+    if(${BUILD_ENGINE_LIBRARY})
+        set(engine_full_path "${frameworks_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}hwengine${CMAKE_SHARED_LIBRARY_SUFFIX}")
+    else()
+        set(engine_full_path "${CMAKE_INSTALL_PREFIX}/hwengine${CMAKE_EXECUTABLE_SUFFIX}")
+    endif()
 
     #this tool is present in qt 4.5 but only if you compile from sources
     #from qt 4.6 is present also in the binary version
--- a/tools/CreateMacBundle.cmake.in	Mon Dec 24 09:56:29 2012 -0500
+++ b/tools/CreateMacBundle.cmake.in	Mon Dec 24 16:23:55 2012 +0100
@@ -7,15 +7,15 @@
 
 if(NOT ${NOVIDEOREC})
     # but macdeployqt will not work for 'hwengine'; luckily the dylibs were already updated before
-    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVCODEC} @executable_path/../Frameworks/libavcodec.dylib ${CMAKE_INSTALL_PREFIX}/hwengine)
-    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVFORMAT} @executable_path/../Frameworks/libavformat.dylib ${CMAKE_INSTALL_PREFIX}/hwengine)
-    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVUTIL} @executable_path/../Frameworks/libavutil.dylib ${CMAKE_INSTALL_PREFIX}/hwengine)
+    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVCODEC} @executable_path/../Frameworks/libavcodec.dylib ${engine_full_path})
+    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVFORMAT} @executable_path/../Frameworks/libavformat.dylib ${engine_full_path})
+    execute_process(COMMAND install_name_tool -change ${FFMPEG_LIBAVUTIL} @executable_path/../Frameworks/libavutil.dylib ${engine_full_path})
 endif()
 
 if(NOT ${NOPNG})
     #same here, for libpng and hwengine, let's assume the version pulled by macdeployqt is the same
     #(yes libpng is pulled by macdeployqt even when NOVIDEOREC is active)
-    execute_process(COMMAND install_name_tool -change ${PNG_LIBRARY} @executable_path/../Frameworks/${PNG_LIBNAME} ${CMAKE_INSTALL_PREFIX}/hwengine)
+    execute_process(COMMAND install_name_tool -change ${PNG_LIBRARY} @executable_path/../Frameworks/${PNG_LIBNAME} ${engine_full_path})
 endif()
 
 if(doBundle EQUAL 1)