Hack to allow OS X to find timeline icons when running from the source tree.
authorCarl Hetherington <cth@carlh.net>
Thu, 25 Jul 2019 15:22:02 +0000 (16:22 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 25 Jul 2019 15:22:02 +0000 (16:22 +0100)
run/dcpomatic
src/wx/timeline_dialog.cc

index 5f40a2d80c54a5a2502150e06e28b92f53b0ad0d..ee509fcbd24293d22968d1696456b73b1bea8271 100755 (executable)
@@ -1,7 +1,9 @@
 #!/bin/bash
 
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
 export LD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:/home/c.hetherington/lib:$LD_LIBRARY_PATH
 export DYLD_LIBRARY_PATH=build/src/lib:build/src/wx:build/src/asdcplib/src:/Users/c.hetherington/osx-environment/64/lib
+export DCPOMATIC_GRAPHICS=$DIR/../graphics
 if [ "$1" == "--debug" ]; then
     shift
     gdb --args build/src/tools/dcpomatic2 $*
index 80686dc1749b552431d038a19866f9880574b56a..3a720cfecff8ec958d336c139c920bb64bcc6144 100644 (file)
@@ -96,7 +96,21 @@ TimelineDialog::TimelineDialog (ContentPanel* cp, shared_ptr<Film> film, weak_pt
 wxString
 TimelineDialog::bitmap_path (string name)
 {
-       boost::filesystem::path p = shared_path() / String::compose("%1.png", name);
+       boost::filesystem::path base;
+
+#ifdef DCPOMATIC_DEBUG
+       /* Hack to allow OS X to find icons when running from the source tree */
+       char* path = getenv ("DCPOMATIC_GRAPHICS");
+       if (path) {
+               base = path;
+       } else {
+               base = shared_path();
+       }
+#else
+       base = shared_path();
+#endif
+
+       boost::filesystem::path p = base / String::compose("%1.png", name);
        return std_to_wx (p.string());
 }