summaryrefslogtreecommitdiffstats
path: root/Modules/BundleUtilities.cmake
Commit message (Collapse)AuthorAgeFilesLines
* Help: Downcase functions in BundleUtilitiesJoachim Wuttke (o)2018-11-121-16/+16
| | | | Presumably, capitalization was left over from very old times
* Merge topic 'deployqt4-cmp0080-fix'Brad King2018-10-191-3/+7
|\ | | | | | | | | | | | | | | | | | | 31b6825bd2 Merge branch 'master' into deployqt4-cmp0080-fix 15bbff0581 DeployQt4: Do not include BundleUtilities at configure time 65bea5b90b DeployQt4: Convert to 2-space indentation 9bfb63bd42 Help: Convert DeployQt4 to block-style comment Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2494
| * Merge branch 'master' into deployqt4-cmp0080-fixKyle Edwards2018-10-191-5/+2
| |\
| * | DeployQt4: Do not include BundleUtilities at configure timeKyle Edwards2018-10-191-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to CMP0080, BundleUtilities can no longer be included at configure-time. However, DeployQt4 contains some functions which are meant to be used at configure-time, and some which are meant to be used at install-time and use BundleUtilities. This change breaks the file into two sections: common functions and install-time functions. BundleUtilities is now only included at install-time, thus fixing the policy warning. Fixes: #18466
* | | Help: Revise docs of modules AddFileDependencies..CheckFunctionExistsJoachim Wuttke (l)2018-10-181-17/+17
| |/ |/| | | | | | | | | * Replace '::' by '.. code-block:: cmake' wherever it makes sense. * Convert to definition list where appropriate. * Prefer '<placeholder>' over 'placeholder'.
* | cmake_policy: Add undocumented GET_WARNING commandKyle Edwards2018-10-101-5/+2
|/ | | | | | | This command is intended for modules that issue policy warnings so they can get the warning string from CMake in a uniform manner, rather than duplicating the string. Several modules been updated to include an example of the usage of this new command.
* BundleUtilities: Disallow inclusion at configure timeKyle Edwards2018-09-191-0/+14
| | | | | | This commit adds a new CMake policy, CMP0080, which prohibits the inclusion of BundleUtilities at configure time. The old behavior is to allow the inclusion.
* Help: Add note for BundleUtilities usageKyle Edwards2018-09-191-0/+4
| | | | | | The macros defined in BundleUtilities are intended to be used from an install() rule rather than at configure time. Add a note clarifying this.
* Help: Convert BundleUtilities help to block-style commentKyle Edwards2018-09-191-217/+218
|
* BundleUtilities: message(FATAL_ERROR) on otool -l errorHarry Mallon2018-07-201-0/+5
|
* BundleUtilities: Fix bundle verification on Unix by considering rpaths.Florian Apolloner2017-03-101-1/+2
|
* BundleUtilities: Teach `get_item_rpaths` to parse ELF binariesFlorian Apolloner2017-03-101-0/+10
|
* BundleUtilities: Maintain symlink structureMartin Koegler2017-01-101-3/+55
| | | | Closes: #15047
* Simplify CMake per-source license noticesBrad King2016-09-271-13/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* BundleUtilities: Add optional parameter to ignore specified filesRoman Wüger2016-04-191-37/+115
|
* BundleUtilities: Fix regression handling frameworksClinton Stimpson2016-03-071-1/+1
| | | | | Fix logic error introduced in commit e422f738 (BundleUtilities: Fix treatment of .dylib inside .framework folders, 2016-02-11).
* BundleUtilities: Fix treatment of .dylib inside .framework foldersChristian Askeland2016-02-111-1/+1
| | | | | | | | | | The specific cause is when e.g. /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libgio-2.0.0.dylib is detected by fixup_bundle. set_bundle_key_values() interprets this as a framework, thus doing a string replace that creates an embedded_item that is equal to the original path, i.e. it is not embedded.
* BundleUtilities: Fix handling of multiple RPATHs from OS X otoolEmilie Harquel2015-12-171-1/+3
| | | | | | The `otool` command may return multiple RPATH entires, so call `gp_append_unique` for each one. Otherwise we may try to ask `install_name_tool` to deal with the same entry twice.
* Modules: Check for ARGC before using ARGV#Daniele E. Domenichelli2015-02-271-1/+5
| | | | ARGV# could be defined from a parent scope.
* BundleUtilities: Teach fixup_bundle to check install_name_tool resultRuslan Baratov2015-02-101-1/+6
| | | | Fail explicitly if install_name_tool fails to make an update we need.
* BundleUtilities: Ensure framework symlinks and Info.plist existAdam Strzelecki2014-10-211-2/+16
| | | | | | | | | | | | | | | This restores Qt SDK 4.8 and OS X >= 10.6.5 codesign compatibility improving embedding frameworks using correct bundle layout described at: https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html 1. If Versions/VERSION/Resources/Info.plist is missing, well known incorrect locations are checked for Info.plist and Info.plist is copied from there, otherwise codesign will fail. 2. Root framework symlinks to binary and Resources are restored to point inside Versions/Current, otherwise Qt 4.8 looking for Resources/ in framework root will fail.
* BundleUtilities: Framework codesign Resources/Info.plist & CurrentAdam Strzelecki2014-10-101-2/+21
| | | | | | | | | | | | | We need to ensure copied framework has proper layout with Resources/Info.plist present next to versioned binary and Current symlink in Versions: https://developer.apple.com/library/mac/technotes/tn2206 https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html If Resources/ is not present we may try to copy Contents/Info.plist if present to embedded Resources/Info.plist. This is a case of Qt5 that has obsolete/invalid framework layout (see QTBUG-38511).
* BundleUtilities: Resolve & replace @rpath placeholdersAdam Strzelecki2014-10-101-17/+84
| | | | | | | | | | | | | | | This is done by gathering LC_RPATH commands for main bundle executable and using it for @rpath lookup in dependent frameworks. All functions that need to carry rpaths to now take optional <rpaths> argument. This enabled apps using @rpath to be bundled correctly, which will be necessary for upcoming Qt 5.4 that will use @rpath for all frameworks. Check that install_name_tool has -delete_rpath before using it. Otherwise it will fail with Xcode 3.x on 10.5 which has no -delete_rpath option for install_name_tool command, that was first introduced in 10.6 SDK, even that 10.5 supports LC_RPATH and @rpath.
* BundleUtilities: Use find on UNIX for fast executable lookupAdam Strzelecki2014-10-101-1/+19
| | | | | | | | | | | It makes whole executable process quicker on UNIX, especially for large bundles containing many files, since using find narrows results to only files having executable flags then all further tests follow. Since find ... -perm +0111 is not clearly POSIX compliant and some Linux versions refuse it, it is better to use longer but portable: find ... -perm \( -perm -0100 -o -perm -0010 -o -perm -0001 \)
* BundleUtilities: Allow Info.plist files which use CR line endingsTim Blechmann2014-08-071-0/+1
| | | | | | Convert \r to our internal end-of-line character just as we do \n. Signed-off-by: Tim Blechmann <tim@klingt.org>
* Remove .* expressions from beginning and end of MATCHES regexsRolf Eike Beer2014-04-141-2/+2
| | | | | | | | | All these expressions work the same: "foo" ".*foo.*" "^.*foo.*$" This assumes that the "Intel*" expressions were meant to be "Intel.*".
* Replace string(REGEX REPLACE) with string(REPLACE) where possibleRolf Eike Beer2014-04-141-3/+3
| | | | The simple replacement is much faster.
* Convert builtin help to reStructuredText source filesKitware Robot2013-10-151-107/+168
| | | | | | | | Run the convert-help.bash script to convert documentation: ./convert-help.bash "/path/to/CMake-build/bin" Then remove it.
* BundleUtilities: Use a more inclusive REGEX for frameworks (#13600)David Cole2012-10-231-1/+1
| | | | | | | | | | | | | Some frameworks might be built with the library right at the root of the framework rather than down in a versioned sub-folder with a symlink at the root. Make one of the slashes in the REGEX optional so BundleUtilities can still properly work with such frameworks ... even if they are weird. ;-) Thanks to Tobias Hieta for the bug report and for trying out the fix before I pushed this commit.
* Remove CMake-language block-end command argumentsKitware Robot2012-08-131-77/+77
| | | | | | | | | | | | | | | | | Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
* Merge topic 'fix-12034-fixup-bundle-with-non-dotapp-exe'Brad King2011-06-071-26/+25
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 51e16c0 BundleUtilities: Avoid test on Watcom dashboards (#12034) 41f962a Revert "BundleUtilities: Run test on Windows if either MSVC or dumpbin was found." e17135e BundleUtilities: Add rpath to loadable modules in test. 8064044 BundleUtilities: Print reason for not loading module.so f3de459 BundleUtilities: Run test on Windows if either MSVC or dumpbin was found. 900bf98 BundleUtilities: Disable running test on Windows unless using MSVC. fa4dc08 BundleUtilities: Fix issues with custom target DEPENDS in test (#12034) e40b79e BundleUtilities: Fix test when using xcode (#12034) b68d3dc BundleUtilities: Fix regex to extract dependents from ldd (#12034) 7ac7b43 BundleUtilities: Work w/ non .app exes on Mac (#12034)
| * BundleUtilities: Work w/ non .app exes on Mac (#12034)Clinton Stimpson2011-05-271-26/+25
| | | | | | | | | | | | | | | | | | | | | | | | Also add a test of BundleUtilities including an exe, some shared libs, a plugin, and a framework-style lib. This test presently runs (and this functionality works) on Linux, Mac and Windows. For now, the framework-style lib is built as a plain old shared lib because there is another yet-unresolved issue with local frameworks without rpaths on the Mac.
* | BundleUtilities: Avoid a cryptic and unhelpful error messageDavid Cole2011-06-021-3/+15
|/ | | | | | | | | | | | | When the path to "resolved_embedded_item" was shorter than the path to the bundle being fixed up, fixup_bundle would fail with a cmake error like: "string end index: 110 is out of range 0 - 85" Detect when the path of resolved_embedded_item is too short to be embedded in the bundle, and report the proper error message, so the poor developer reading it has a snowball's chance of actually fixing the issue.
* BundleUtilities: error if fixup_bundle_item called on non-embedded itemDavid Cole2010-12-061-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, improve the documentation of the fixup_bundle and fixup_bundle_item functions to clarify that plugin type "libs" need to be copied into the bundle *before* calling fixup_bundle. Commit e93a4b4d3421ced7b8c852b76c0dcb427f798df8 changed the way that the libs parameter to fixup_bundle is interpreted. Before the commit, the libs were copied into the bundle first and then fixed up. After the commit, the copy was skipped, assuming the libs were in the bundle in the first place, and then the fixups occurred as before. However, before the commit, it was possible to name a lib from outside the bundle, and have it copied in and then fixed up. Its resolved embedded name was always inside the bundle before. After, its resolved embedded name was just the same as its resolved name, which is in its original location, and not necessarily inside the bundle. This manifested itself as a problem with the ParaView call to fixup_bundle and its many plugins. Previously, ParaView had simply passed in the list of plugin file names as they existed in the build tree, and left the copying into the bundle up to the fixup_bundle function. When built with CMake 2.8.3 (the first version to contain the above named commit) the fixup_bundle call would inadventently fixup libraries in the build tree, not libraries that were in the bundle. Furthermore, the plugins would not be in the final bundle. This points out the fact that the fix for the bugs made by the above commit was a backwards-incompatible change in behavior. This commit makes it an error to try to fixup an item that is not already inside the bundle to make the change in behavior apparent to folks who were depending on the prior copy-in behavior: now, they should get an error, and hopefully, reading the new and improved documentation, should be able to resolve it in their projects by adding code to install or copy in such libraries prior to calling fixup_bundle. Whew.
* BundleUtilities: only do rpath strip on copied prerequisites.Clinton Stimpson2010-11-231-6/+6
|
* Merge topic 'fix-10417'Brad King2010-09-081-1/+1
|\ | | | | | | | | e93a4b4 Avoid adding self as prerequisite. (#10417)
| * Avoid adding self as prerequisite. (#10417)David Cole2010-09-081-1/+1
| | | | | | | | Thanks to Clinton Stimpson for the patch.
* | Make bundle items writable before fixup (#9284)Mike McQuaid2010-09-081-0/+7
|/ | | | | | | | This ensures that any bundle items are made user writable before any attempt is made to alter them using install_name_tool. This is because MacPorts/Fink/Homebrew don't install libraries as writable. This fix is needed to allow fixup_bundle_item to work correctly when ingesting libraries installed by these package managers.
* Refine formatting for cmake --help-module output.David Cole2010-08-251-3/+2
| | | | Also refer to self as module, not script.
* Merge branch 'patches/docBundleUtilities'David Cole2010-08-251-127/+113
|\ | | | | | | | | | | | | | | | | | | | | of http://github.com/themiwi/CMake into fix-10747 Conflicts: Modules/BundleUtilities.cmake There was one newly added function in BundleUtilities.cmake which also needed the same "documentation at top" treatment.
| * Improve documentation of BundleUtilities.cmakeMichael Wild2010-05-231-116/+103
| | | | | | | | | | | | | | Put the function documentation into the header-comment, improve formatting and list the user-relevant functions first. Signed-off-by: Michael Wild <themiwi@users.sourceforge.net>
* | Modules: Fix spelling 'To distributed' -> 'To distribute'Todd Gamblin2010-08-091-1/+1
| |
* | Copy Resources in Frameworks during fixup_bundle (#10020)David Cole2010-07-271-2/+62
|/ | | | | | | | | By default, if an embedded item is a framework, copy its main dylib file explicitly, and then also its Resources if it has any. Inspect a variable, BU_COPY_FULL_FRAMEWORK_CONTENTS, and if it's ON, copy the entire framework into the bundle.
* Fix issue #9412 - remove RPATH from files copied by BundleUtilities.cmake on ↵David Cole2009-09-281-0/+4
| | | | Linux. Thanks to Clinton Stimpson for the patch.
* Convert CMake non-find modules to BSD LicenseBrad King2009-09-281-0/+12
| | | | | | | This adds copyright/license notification blocks CMake's non-find modules. Most of the modules had no notices at all. Some had notices referring to the BSD license already. This commit normalizes existing notices and adds missing notices.
* Overhaul GetPrerequisites and BundleUtilities: make fixup_bundle do ↵David Cole2009-08-051-21/+53
| | | | | | something useful on Windows and Linux. Formerly, fixup_bundle was useful only on the Mac for making standalone bundle applications that could be drag-n-drop moved to anyplace in the file system. fixup_bundle is not just for the Mac any more. It will now analyze executable files on Windows and Linux, too, and copy necessary non-system dlls to the same folder that the executable is in. This should work with dlls that you build as part of your build and also with 3rd-party dlls as long as you give fixup_bundle the right list of directories to search for those dlls. Many thanks to Clinton Stimpson for his help in ironing out the details involved in making this work.
* ENH: Add BundleUtilities.cmake and supporting changes to ↵David Cole2008-09-061-0/+645
GetPrerequisites.cmake. Function copy_and_fixup_bundle in BundleUtilities helps to make standalone bundle applications on the Mac by pulling in prerequisite non-system libraries and frameworks as needed. Uses otool and install_name_tool to do analysis and fixups. Project-specific hooks for deciding where to embed libraries and for resolving item names into full path file names are also provided.