# HG changeset patch
# User Andre Heinecke <andre.heinecke@intevation.de>
# Date 1475837090 -7200
# Node ID dd322a4b90d96e1828afedb7c0f2e2bc9b944530
# Parent  ccd1dbea253641d19700377b6ea272b3eb2a1a30
Fix resource finding and installation

diff -r ccd1dbea2536 -r dd322a4b90d9 src/CMakeLists.txt
--- a/src/CMakeLists.txt	Fri Oct 07 12:31:51 2016 +0200
+++ b/src/CMakeLists.txt	Fri Oct 07 12:44:50 2016 +0200
@@ -81,10 +81,11 @@
    SET(APPS "\${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}.app")
    SET(MACOSX_BUNDLE_ICON_FILE icon.icns)
    SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
+   SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/replacements.ini PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
    SET(APPLICATION_SRC ${APPLICATION_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/icons/icon.icns)
 
    SET(MACOS_INFO_STRING "Tool to convert EduApp questionaires.")
-   SET(MACOS__BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in)
+   SET(MACOS_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/cmake/MacOSXBundleInfo.plist.in)
    SET(MACOSX_BUNDLE_NAME "EduExportConvert")
    SET(MACOSX_BUNDLE_GUI_IDENTIFIER "EduExportConvert")
    SET(MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION})
@@ -125,10 +126,9 @@
 endif(WIN32)
 
 install(TARGETS ${PROJECT_NAME} DESTINATION bin BUNDLE DESTINATION .)
-install(FILES replacements.ini DESTINATION share/apps/${PROJECT_NAME})
 
 if(APPLE)
-   file(COPY replacements.ini DESTINATION "${PROJECT_NAME}.app/Contents/MacOS/" )
+   SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE TRUE)
    install(CODE "
        include(BundleUtilities)
        fixup_bundle(\"${APPS}\" \"\${QTPLUGINS}\" \"${DIRS}\")
diff -r ccd1dbea2536 -r dd322a4b90d9 src/converter.cpp
--- a/src/converter.cpp	Fri Oct 07 12:31:51 2016 +0200
+++ b/src/converter.cpp	Fri Oct 07 12:44:50 2016 +0200
@@ -191,7 +191,7 @@
 #ifndef Q_OS_MAC
     ourDir.cd(QStringLiteral("../share/apps/" APPNAME).toLower());
 #else
-    ourDir.cd(QStringLiteral("../../Resources"));
+    ourDir.cd(QStringLiteral("../Resources"));
 #endif
     if (ourDir.exists(filename)) {
         regexs = loadExpressionsFromFile(ourDir.filePath(filename), errors);