From d9641875044ffa6ba9ee98778e04f736562fed41 Mon Sep 17 00:00:00 2001 From: "Bruce B. Lacey" Date: Tue, 28 Feb 2017 22:47:54 -0800 Subject: [PATCH] Install macOS bundle executables into MacOS * Previously, the macOS bundle executables were installed into bin which does not adhere to Apple guidelines and causes issues with certain frameworks like Qt. The install has been refactored to install the executables into MacOS Fixes #2928 --- CMakeLists.txt | 24 ++++++++++++------- .../FreeCAD.app/Contents/MacOS/PySide | 1 - .../FreeCAD.app/Contents/bin/FreeCAD | 1 - src/Main/CMakeLists.txt | 9 +++++-- src/Tools/MakeMacBundleRelocatable.py | 2 +- 5 files changed, 23 insertions(+), 14 deletions(-) delete mode 120000 src/MacAppBundle/FreeCAD.app/Contents/MacOS/PySide delete mode 120000 src/MacAppBundle/FreeCAD.app/Contents/bin/FreeCAD diff --git a/CMakeLists.txt b/CMakeLists.txt index a0d8f5eb4..5b4b2eb01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -880,15 +880,21 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") "from PySide2.QtWidgets import *\n") file(WRITE ${CMAKE_BINARY_DIR}/bin/PySide/QtSvg.py "from PySide2.QtSvg import *\n") - INSTALL( - FILES - ${CMAKE_BINARY_DIR}/bin/PySide/__init__.py - ${CMAKE_BINARY_DIR}/bin/PySide/QtCore.py - ${CMAKE_BINARY_DIR}/bin/PySide/QtGui.py - ${CMAKE_BINARY_DIR}/bin/PySide/QtSvg.py - DESTINATION - bin/PySide - ) + if(APPLE) + INSTALL( + DIRECTORY + ${CMAKE_BINARY_DIR}/bin/PySide + DESTINATION + MacOS + ) + else() + INSTALL( + DIRECTORY + ${CMAKE_BINARY_DIR}/bin/PySide + DESTINATION + bin + ) + endif() else() # set(PYTHON_SUFFIX -python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}) SET(PYTHON_SUFFIX -python2.7) # for shiboken diff --git a/src/MacAppBundle/FreeCAD.app/Contents/MacOS/PySide b/src/MacAppBundle/FreeCAD.app/Contents/MacOS/PySide deleted file mode 120000 index df160d514..000000000 --- a/src/MacAppBundle/FreeCAD.app/Contents/MacOS/PySide +++ /dev/null @@ -1 +0,0 @@ -../bin/PySide \ No newline at end of file diff --git a/src/MacAppBundle/FreeCAD.app/Contents/bin/FreeCAD b/src/MacAppBundle/FreeCAD.app/Contents/bin/FreeCAD deleted file mode 120000 index 41942cc6e..000000000 --- a/src/MacAppBundle/FreeCAD.app/Contents/bin/FreeCAD +++ /dev/null @@ -1 +0,0 @@ -../MacOS/FreeCAD \ No newline at end of file diff --git a/src/Main/CMakeLists.txt b/src/Main/CMakeLists.txt index b783d164d..4948cb262 100644 --- a/src/Main/CMakeLists.txt +++ b/src/Main/CMakeLists.txt @@ -94,11 +94,16 @@ if(WIN32) RUNTIME DESTINATION bin LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -else(WIN32) +elseif(APPLE) + INSTALL(TARGETS FreeCADMainCmd + RUNTIME DESTINATION MacOS + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ) +else() INSTALL(TARGETS FreeCADMainCmd RUNTIME DESTINATION bin ) -endif(WIN32) +endif() ######################## FreeCADMainPy ######################## diff --git a/src/Tools/MakeMacBundleRelocatable.py b/src/Tools/MakeMacBundleRelocatable.py index e12a8e958..801eb1d09 100755 --- a/src/Tools/MakeMacBundleRelocatable.py +++ b/src/Tools/MakeMacBundleRelocatable.py @@ -359,7 +359,7 @@ def main(): path = sys.argv[1] bundle_path = os.path.abspath(os.path.join(path, "Contents")) graph = DepsGraph() - dir_filter = ["bin", "lib", "Mod", "Mod/PartDesign", + dir_filter = ["MacOS", "lib", "Mod", "lib/python2.7/site-packages", "lib/python2.7/lib-dynload"] search_paths = [bundle_path + "/lib"] + sys.argv[2:]