summaryrefslogtreecommitdiffstats
path: root/Modules/GetPrerequisites.cmake
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2013-02-28 14:28:30 (GMT)
committerBrad King <brad.king@kitware.com>2013-02-28 14:49:32 (GMT)
commit33c94c82ba7d525e3435248c98132d87415e95a3 (patch)
treea6cd6fa9e486516040e2cc341dac2080d94124dc /Modules/GetPrerequisites.cmake
parent5260a864f5571eeb5697fb2e3b2dda0407de0a7b (diff)
downloadCMake-33c94c82ba7d525e3435248c98132d87415e95a3.zip
CMake-33c94c82ba7d525e3435248c98132d87415e95a3.tar.gz
CMake-33c94c82ba7d525e3435248c98132d87415e95a3.tar.bz2
GetPrerequisites: Add support for objdump
Make it usable on MinGW without Visual Studio installed. Signed-off-by: Michael Tänzer <neo@nhng.de>
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r--Modules/GetPrerequisites.cmake20
1 files changed, 18 insertions, 2 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index c37417c..3bd3fdf 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -585,11 +585,18 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
if("${gp_tool}" STREQUAL "")
set(gp_tool "ldd")
+
if(APPLE)
set(gp_tool "otool")
endif()
+
if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har!
- set(gp_tool "dumpbin")
+ find_program(gp_dumpbin "dumpbin" PATHS ${gp_cmd_paths})
+ if(gp_dumpbin)
+ set(gp_tool "dumpbin")
+ else() # Try harder. Maybe we're on MinGW
+ set(gp_tool "objdump")
+ endif()
endif()
endif()
@@ -630,10 +637,19 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
set(ENV{VS_UNICODE_OUTPUT} "") # Block extra output from inside VS IDE.
endif()
+ if("${gp_tool}" STREQUAL "objdump")
+ set(gp_cmd_args "-p")
+ set(gp_regex "^\t*DLL Name: (.*\\.[Dd][Ll][Ll])${eol_char}$")
+ set(gp_regex_error "")
+ set(gp_regex_fallback "")
+ set(gp_regex_cmp_count 1)
+ set(gp_tool_known 1)
+ endif()
+
if(NOT gp_tool_known)
message(STATUS "warning: gp_tool='${gp_tool}' is an unknown tool...")
message(STATUS "CMake function get_prerequisites needs more code to handle '${gp_tool}'")
- message(STATUS "Valid gp_tool values are dumpbin, ldd and otool.")
+ message(STATUS "Valid gp_tool values are dumpbin, ldd, objdump and otool.")
return()
endif()