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 03494d590..4cc08827f 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 @@ -148,11 +160,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) @@ -191,3 +198,14 @@ 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 + add_custom_command(TARGET ${OLIVE_CRASH_TARGET} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${OLIVE_CRASH_TARGET} $ + ) +endif() 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; 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();