diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2014-11-18 19:37:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-11-25 15:13:20 (GMT) |
commit | d1903de8c5bac7b134d5f77359be48aa4386afa9 (patch) | |
tree | fa68b908111148b4d171b54285006fcb2bc80b85 /Modules/GetPrerequisites.cmake | |
parent | c9e32b0b122cb8d051c90bcc872244614ec40a39 (diff) | |
download | CMake-d1903de8c5bac7b134d5f77359be48aa4386afa9.zip CMake-d1903de8c5bac7b134d5f77359be48aa4386afa9.tar.gz CMake-d1903de8c5bac7b134d5f77359be48aa4386afa9.tar.bz2 |
GetPrerequisites: join if() clauses
These all test the same variable for different values, so only one of them can
ever be true. This also allows to completely remove one variable that only
flagged if one of the conditions matched.
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r-- | Modules/GetPrerequisites.cmake | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 9813275..712a41c 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -666,45 +666,31 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa return() endif() - set(gp_tool_known 0) - if(gp_tool STREQUAL "ldd") set(gp_cmd_args "") set(gp_regex "^[\t ]*[^\t ]+ => ([^\t\(]+) .*${eol_char}$") set(gp_regex_error "not found${eol_char}$") set(gp_regex_fallback "^[\t ]*([^\t ]+) => ([^\t ]+).*${eol_char}$") set(gp_regex_cmp_count 1) - set(gp_tool_known 1) - endif() - - if(gp_tool STREQUAL "otool") + elseif(gp_tool STREQUAL "otool") set(gp_cmd_args "-L") set(gp_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$") set(gp_regex_error "") set(gp_regex_fallback "") set(gp_regex_cmp_count 3) - set(gp_tool_known 1) - endif() - - if(gp_tool STREQUAL "dumpbin") + elseif(gp_tool STREQUAL "dumpbin") set(gp_cmd_args "/dependents") set(gp_regex "^ ([^ ].*[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(gp_tool STREQUAL "objdump") + elseif(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) + else() 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, objdump and otool.") |