Skip to content

Commit

Permalink
Fixing Mac build
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Schimmelmann committed Dec 27, 2017
1 parent 7446b76 commit df5e9fb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ ELSE()
SET(QTIOCOMPRESSOR_SRC_DIR ${CMAKE_BINARY_DIR}/QtIOCompressor-src/src)
SET(QTIOCOMPRESSOR_INCLUDE_DIRS ${QTIOCOMPRESSOR_SRC_DIR} ${CMAKE_BINARY_DIR}/QtIOCompressor-build)

# Linux needs an additional relative path for bundling the library
IF(UNIX AND NOT APPLE)
SET(QTIOCOMPRESSOR_LIBRARIES -Wl,-rpath,../lib ${QTIOCOMPRESSOR_LIBRARY})
# Linux/Apple needs an additional relative path for bundling the library
IF(UNIX)
IF(APPLE)
SET(QTIOCOMPRESSOR_LIBRARIES -Wl,-install_name,@rpath/ ${QTIOCOMPRESSOR_LIBRARY})
ELSE()
SET(QTIOCOMPRESSOR_LIBRARIES -Wl,-rpath,../lib ${QTIOCOMPRESSOR_LIBRARY})
ENDIF()
ENDIF()
ENDIF()

Expand Down
12 changes: 12 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,18 @@ IF(APPLE)
SET_TARGET_PROPERTIES(mmapper PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in )

# Bundle the libraries with the binary
ADD_CUSTOM_COMMAND(
TARGET mmapper
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory
${CMAKE_CURRENT_BINARY_DIR}/mmapper.app/Contents/Frameworks/)
ADD_CUSTOM_COMMAND(
TARGET mmapper
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${QTIOCOMPRESSOR_LIBRARY}
${CMAKE_CURRENT_BINARY_DIR}/mmapper.app/Contents/Frameworks/
)
FIND_PROGRAM(MACDEPLOYQT_APP macdeployqt)
MESSAGE(" - macdeployqt path: ${MACDEPLOYQT_APP}")
ADD_CUSTOM_COMMAND(
Expand Down

0 comments on commit df5e9fb

Please sign in to comment.