summaryrefslogtreecommitdiff
path: root/Modules/GetPrerequisites.cmake
diff options
context:
space:
mode:
authorDaniele E. Domenichelli <daniele.domenichelli@iit.it>2015-02-26 17:26:12 +0100
committerBrad King <brad.king@kitware.com>2015-02-27 10:59:23 -0500
commita7631fc4e026f2e330b10eae73f473f240c3d0c1 (patch)
treed51c0ee64c296bedf59e18db82821457f93f3b66 /Modules/GetPrerequisites.cmake
parent4efef3f775e78bdcb4591dc37aa974bc28e8fd84 (diff)
downloadcmake-a7631fc4e026f2e330b10eae73f473f240c3d0c1.tar.gz
Modules: Check for ARGC before using ARGV#
ARGV# could be defined from a parent scope.
Diffstat (limited to 'Modules/GetPrerequisites.cmake')
-rw-r--r--Modules/GetPrerequisites.cmake36
1 files changed, 24 insertions, 12 deletions
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 9fb85feb12..23d486eadf 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -330,7 +330,11 @@ endfunction()
function(gp_resolve_item context item exepath dirs resolved_item_var)
set(resolved 0)
set(resolved_item "${item}")
- set(rpaths "${ARGV5}")
+ if(ARGC GREATER 5)
+ set(rpaths "${ARGV5}")
+ else()
+ set(rpaths "")
+ endif()
# Is it already resolved?
#
@@ -481,7 +485,11 @@ endfunction()
function(gp_resolved_file_type original_file file exepath dirs type_var)
- set(rpaths "${ARGV5}")
+ if(ARGC GREATER 5)
+ set(rpaths "${ARGV5}")
+ else()
+ set(rpaths "")
+ endif()
#message(STATUS "**")
if(NOT IS_ABSOLUTE "${original_file}")
@@ -623,7 +631,11 @@ endfunction()
function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs)
set(verbose 0)
set(eol_char "E")
- set(rpaths "${ARGV6}")
+ if(ARGC GREATER 6)
+ set(rpaths "${ARGV6}")
+ else()
+ set(rpaths "")
+ endif()
if(NOT IS_ABSOLUTE "${target}")
message("warning: target '${target}' is not absolute...")
@@ -881,22 +893,22 @@ endfunction()
function(list_prerequisites target)
- if("${ARGV1}" STREQUAL "")
- set(all 1)
- else()
+ if(ARGC GREATER 1 AND NOT "${ARGV1}" STREQUAL "")
set(all "${ARGV1}")
+ else()
+ set(all 1)
endif()
- if("${ARGV2}" STREQUAL "")
- set(exclude_system 0)
- else()
+ if(ARGC GREATER 2 AND NOT "${ARGV2}" STREQUAL "")
set(exclude_system "${ARGV2}")
+ else()
+ set(exclude_system 0)
endif()
- if("${ARGV3}" STREQUAL "")
- set(verbose 0)
- else()
+ if(ARGC GREATER 3 AND NOT "${ARGV3}" STREQUAL "")
set(verbose "${ARGV3}")
+ else()
+ set(verbose 0)
endif()
set(count 0)