Commit Graph

31 Commits

Author SHA1 Message Date
Brad King d269984e53 GetPrerequisites: Mark file_cmd as advanced cache entry
This internal implementation detail should not pollute the main
cache view of projects that include GetPrerequisites.
2012-08-14 09:02:08 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
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
2012-08-13 14:19:16 -04:00
Clinton Stimpson ac7a193951 GetPrerequisites.cmake: detect executables built with the -pie linker flag. 2012-07-05 12:49:40 -06:00
Clinton Stimpson 880139a642 GetPrerequisites: Add support for @rpath on Mac OS X.
Change to consider a library embedded if it is found in a subdirectory relative to the
using executable/library.  Previous commit considered them local.
This case is encountered when @rpath is used with framework libraries, which are inside a directory tree.
2012-01-19 18:10:01 -07:00
Clinton Stimpson 9a6b102205 GetPrerequisites: Add support for @rpath on Mac OS X.
Handle @rpath much like other Unixes, by doing a find_file with the given directories.

Also, consider a library to be local if it is found in the same directory or a subdirectory relative to the user
executable/library.  Previously, it was local only if found in the same directory.
This case is encountered when @rpath is used with framework libraries, which are inside a directory tree.
2011-11-21 16:45:49 -07:00
Nicolas Despres bfb0ed4293 Usage: Add missing exepath argument in get_prerequisites documentation. 2011-10-23 22:18:14 +02:00
Clinton Stimpson b68d3dc1b5 BundleUtilities: Fix regex to extract dependents from ldd (#12034)
This regex works with spaces in the path.
2011-05-31 13:12:28 -04:00
Clinton Stimpson 7ac7b437b8 BundleUtilities: Work w/ non .app exes on Mac (#12034)
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.
2011-05-27 16:11:43 -04:00
David Partyka 48e80eb724 Fixes to GetPrerequisites for cygwin
Fix IF(WIN32) guards check for cygwin. Fix checking if the depenency is in a system location to use cygwin style paths on cygwin. Also change GetPrerequisites to switch gp_tool to tools that are very unlikely to be found, ie. dumpbin on Apple and otool on Windows/Unix.
2010-10-27 17:23:00 -04:00
David Partyka bee4802840 Append the gp_tool path to the system PATH using native slashes. 2010-10-26 11:12:12 -04:00
David Partyka 8e550ba31e Remove unecessary TO_CMAKE_PATH for gp_cmd_dir.
It is already using CMAKE style paths.
2010-10-26 10:28:42 -04:00
David Partyka 1684198706 Switch to CMAKE_PATH when doing PATH comparisons on Windows.
Users PATH may contain elements that end with backslash. This will escape the semicolon when iterating resulting in mismatches.

Fix indentation.

Fix whitespace
2010-10-26 10:28:38 -04:00
David Partyka be94c494ed Fixed appending PATH to dumpbin tool from growing without bounds.
IF(... MATCHES ...) used for comparing directories chokes especially in the case of C:\Program Files (x86)\<blah> because of regex pattern matching. Switched this to use STREQUAL in a loop instead.
2010-10-25 13:40:35 -04:00
David Cole e93a4b4d34 Avoid adding self as prerequisite. (#10417)
Thanks to Clinton Stimpson for the patch.
2010-09-07 21:29:43 -04:00
David Cole 90add6b504 Refine formatting for cmake --help-module output.
Also refer to self as module, not script.
2010-08-25 14:58:31 -04:00
David Cole af0c719b9a Merge branch 'patches/docBundleUtilities'
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.
2010-08-25 14:54:14 -04:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Clinton Stimpson 9306f1beee Fix regression in 5e6634fd77969433a87c150a2fb3f2079131484f for Windows. 2010-06-24 11:15:00 -06:00
Clinton Stimpson e6f8a86368 Fix bug 10418 - GetPrerequisites returning "not" as a dependency.
ldd can return "not found" and we need to handle it correctly.
In that case, we extract only the name of the library instead of trying for its full path.
2010-06-24 11:15:00 -06:00
Michael Wild 51cc86167b Improve documentation of GetPrerequisites.cmake
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>
2010-05-23 14:38:21 +02:00
Michael Wild beda5eab39 ENH: Hook in GetPrerequisites to override item type
The hook is called gp_resolved_file_type_override.

Signed-off-by: Michael Wild <themiwi@users.sourceforge.net>
2010-03-17 11:32:14 -04:00
David Cole e28941b6d7 Consider a windows directory named syswow* a 'system' directory for GetPrerequisites.cmake purposes. 2009-12-11 14:42:26 -05:00
David Cole b5265c2475 Fix issue #9395 - only return true for .exe files on Windows from the is_file_executable function. Makes behavior of this function conceptually consistent with Mac and Linux behavior. Thanks to Clinton Stimpson for the patch. 2009-09-28 17:35:40 -04:00
Brad King 3a666595c9 Convert CMake non-find modules to BSD License
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.
2009-09-28 11:46:51 -04:00
David Cole fe0b121da9 Overhaul GetPrerequisites and BundleUtilities: make fixup_bundle do 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.
2009-08-05 14:59:14 -04:00
Bill Hoffman 24bff45d1b BUG: make sure list is not size 0 before sort 2008-12-04 09:12:31 -05:00
David Cole 86ded1ba58 ENH: Activate GetPrerequisites code on Linux. Thanks to Mike Arthur for finishing it off. 2008-10-24 11:39:10 -04:00
Bill Hoffman 43837fb3e1 ENH: do not add the same thing to the PATH again and again 2008-09-08 11:23:01 -04:00
David Cole 6f8bdd276c ENH: Add BundleUtilities.cmake and supporting changes to 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. 2008-09-06 12:20:07 -04:00
Brad King 80d045b01e ENH: When GetPrerequisites.cmake runs dumpbin while running inside the VS IDE environment make sure the tool does not produce extra output. 2008-05-01 18:49:31 -04:00
David Cole 31efe9e9f6 ENH: Add script GetPrerequisites.cmake to help analyze what shared libraries executable files depend on. Primary uses are to determine what shared libraries should be copied into Mac OSX bundle applications to create standalone bundles apps and to determine what shared library files need to be installed for an executable to run on any platform. Requires native platform tools dumpbin, otool and ldd to generate results. 2008-03-04 08:18:40 -05:00