From 40073dde62ad3d8346dfb316e58ab15355d148bf Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 18 Mar 2020 15:02:43 +1100 Subject: [PATCH 1/5] cmake: added crash handler target to install --- app/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 03494d590..99e1e6152 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -148,11 +148,6 @@ else() qt5_add_translation(OLIVE_QM_FILES ${OLIVE_TS_FILES}) endif() -if(UNIX AND NOT APPLE) - install(TARGETS ${OLIVE_TARGET} RUNTIME DESTINATION bin) - install(FILES ${OLIVE_QM_FILES} DESTINATION share/olive-editor/ts) -endif() - add_subdirectory(packaging) if(DOXYGEN_FOUND) @@ -184,6 +179,11 @@ else() ) endif() +if(UNIX AND NOT APPLE) + install(TARGETS ${OLIVE_TARGET} ${OLIVE_CRASH_TARGET} RUNTIME DESTINATION bin) + install(FILES ${OLIVE_QM_FILES} DESTINATION share/olive-editor/ts) +endif() + target_link_libraries( ${OLIVE_CRASH_TARGET} PRIVATE From 04afeee9534fdd587a141bd17229539ce620400d Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 18 Mar 2020 08:17:23 -0700 Subject: [PATCH 2/5] crashhandler: enabled mac support --- app/common/crashhandler.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/common/crashhandler.cpp b/app/common/crashhandler.cpp index 4844c9736..27958f543 100644 --- a/app/common/crashhandler.cpp +++ b/app/common/crashhandler.cpp @@ -13,7 +13,7 @@ #include #include #include -#elif defined(Q_OS_LINUX) +#elif defined(Q_OS_MAC) || defined(Q_OS_LINUX) #include #endif @@ -100,9 +100,7 @@ void crash_handler(int sig) { } SymCleanup(process); -#elif defined(Q_OS_MAC) - // FIXME: No Mac backtrace support yet -#elif defined(Q_OS_LINUX) +#elif defined(Q_OS_MAC) || defined(Q_OS_LINUX) void *array[10]; size_t size; From 479f7efc66673484fa6ce0670e302d8483f9583e Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 18 Mar 2020 08:18:04 -0700 Subject: [PATCH 3/5] stream: commented out never used struct --- app/project/item/footage/stream.cpp | 8 ++++---- app/project/item/footage/stream.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/project/item/footage/stream.cpp b/app/project/item/footage/stream.cpp index 52a402851..4937481b2 100644 --- a/app/project/item/footage/stream.cpp +++ b/app/project/item/footage/stream.cpp @@ -137,10 +137,10 @@ QIcon Stream::IconFromType(const Stream::Type &type) return QIcon(); } -StreamID Stream::ToID() const +/*StreamID Stream::ToID() const { return StreamID(footage_->filename(), index_); -} +}*/ QMutex* Stream::index_process_lock() { @@ -160,8 +160,8 @@ void Stream::SaveCustomParameters(QXmlStreamWriter*) const { } -StreamID::StreamID(const QString &filename, const int &stream_index) : +/*StreamID::StreamID(const QString &filename, const int &stream_index) : filename_(filename), stream_index_(stream_index) { -} +}*/ diff --git a/app/project/item/footage/stream.h b/app/project/item/footage/stream.h index b3c774604..743b9e6c4 100644 --- a/app/project/item/footage/stream.h +++ b/app/project/item/footage/stream.h @@ -31,7 +31,7 @@ class Footage; -class StreamID { +/*class StreamID { public: StreamID(const QString& filename, const int& stream_index); @@ -40,7 +40,7 @@ private: int stream_index_; -}; +};*/ /** * @brief A base class for keeping metadata about a media stream. @@ -101,7 +101,7 @@ public: static QIcon IconFromType(const Type& type); - StreamID ToID() const; + //StreamID ToID() const; QMutex* index_process_lock(); From 215406c15d3928b27378f3f18513c5e63ac163f6 Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 18 Mar 2020 08:18:33 -0700 Subject: [PATCH 4/5] cmake: install icns file inside mac bundle --- app/CMakeLists.txt | 41 ++++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 99e1e6152..0c5b1fa10 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +# Set Olive sources and resources set(OLIVE_SOURCES ${OLIVE_SOURCES} core.h @@ -21,9 +22,12 @@ set(OLIVE_SOURCES main.cpp ) -set(OLIVE_RESOURCES - ${OLIVE_RESOURCES} -) +if (WIN32) + set(OLIVE_RESOURCES + ${OLIVE_RESOURCES} + packaging/windows/resources.rc + ) +endif() add_subdirectory(audio) add_subdirectory(codec) @@ -43,18 +47,20 @@ add_subdirectory(undo) add_subdirectory(widget) add_subdirectory(window) +# Create main application target set(OLIVE_TARGET "olive-editor") if(APPLE) set(OLIVE_TARGET "Olive") -endif() -if (WIN32) + set(OLIVE_ICON packaging/macos/olive.icns) + set(OLIVE_RESOURCES ${OLIVE_RESOURCES} - packaging/windows/resources.rc + ${OLIVE_ICON} ) endif() +# Add executable add_executable(${OLIVE_TARGET} ${OLIVE_SOURCES} ${OLIVE_RESOURCES} @@ -62,14 +68,18 @@ add_executable(${OLIVE_TARGET} ) if(APPLE) - SET_TARGET_PROPERTIES(${OLIVE_TARGET} PROPERTIES + set_target_properties(${OLIVE_TARGET} PROPERTIES MACOSX_BUNDLE TRUE - MACOSX_FRAMEWORK_IDENTIFIER org.olivevideoeditor.Olive + MACOSX_BUNDLE_GUI_IDENTIFIER org.olivevideoeditor.Olive + MACOSX_BUNDLE_ICON_FILE olive.icns + RESOURCE "${OLIVE_ICON}" ) endif() +# Set compiler definitions target_compile_definitions(${OLIVE_TARGET} PRIVATE ${OLIVE_DEFINITIONS}) +# Set compiler options if(MSVC) target_compile_options( ${OLIVE_TARGET} @@ -100,6 +110,7 @@ else() ) endif() +# Set include directories target_include_directories( ${OLIVE_TARGET} PRIVATE @@ -109,6 +120,7 @@ target_include_directories( ${OPENEXR_INCLUDE_DIRS} ) +# Set link libraries target_link_libraries( ${OLIVE_TARGET} PRIVATE @@ -179,11 +191,6 @@ else() ) endif() -if(UNIX AND NOT APPLE) - install(TARGETS ${OLIVE_TARGET} ${OLIVE_CRASH_TARGET} RUNTIME DESTINATION bin) - install(FILES ${OLIVE_QM_FILES} DESTINATION share/olive-editor/ts) -endif() - target_link_libraries( ${OLIVE_CRASH_TARGET} PRIVATE @@ -191,3 +198,11 @@ target_link_libraries( Qt5::Gui Qt5::Widgets ) + +if(UNIX AND NOT APPLE) + install(TARGETS ${OLIVE_TARGET} ${OLIVE_CRASH_TARGET} RUNTIME DESTINATION bin) +endif() + +if(APPLE) + # Move crash handler program inside Mac app bundle +endif() From 30b4ef8f0002c993f433267b22ecc1a8441fa7ce Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Wed, 18 Mar 2020 08:39:05 -0700 Subject: [PATCH 5/5] cmake/travis: add crash handler tool to mac app bundle and handle dependencies --- .travis/script.sh | 3 +++ app/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.travis/script.sh b/.travis/script.sh index 9afa8e615..defeda5b2 100644 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -29,6 +29,9 @@ if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then wget -c -nv https://github.com/arl/macdeployqtfix/raw/master/macdeployqtfix.py python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/Olive /usr/local/Cellar/qt5/5.*/ + # Fix deps on crash handler + python2 macdeployqtfix.py $BUNDLE_NAME/Contents/MacOS/olive-crashhandler /usr/local/Cellar/qt5/5.*/ + # Fix OpenEXR libs that seem to be missed by both macdeployqt _and_ macdeployqtfix cd $BUNDLE_NAME/Contents/Frameworks exrlib=(libImath-*.dylib libHalf-*.dylib libIexMath-*.dylib libIex-*.dylib libIlmThread-*.dylib) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 0c5b1fa10..4cc08827f 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -205,4 +205,7 @@ endif() if(APPLE) # Move crash handler program inside Mac app bundle + add_custom_command(TARGET ${OLIVE_CRASH_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${OLIVE_CRASH_TARGET} $ + ) endif()