diff options
author | Brad King <brad.king@kitware.com> | 2015-03-02 13:36:29 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-03-02 13:36:29 (GMT) |
commit | b3381c5c79e2b7ef57a1d035e73d37ec2ee0aa45 (patch) | |
tree | 4e8eecf5b08ca4e3b27c9c35965514201ffd470a /Modules/Qt4Macros.cmake | |
parent | e2055b172eb4ed40893bc2e110a5640d078eef22 (diff) | |
parent | a7631fc4e026f2e330b10eae73f473f240c3d0c1 (diff) | |
download | CMake-b3381c5c79e2b7ef57a1d035e73d37ec2ee0aa45.zip CMake-b3381c5c79e2b7ef57a1d035e73d37ec2ee0aa45.tar.gz CMake-b3381c5c79e2b7ef57a1d035e73d37ec2ee0aa45.tar.bz2 |
Merge topic 'modules-check-ARGC'
a7631fc4 Modules: Check for ARGC before using ARGV#
Diffstat (limited to 'Modules/Qt4Macros.cmake')
-rw-r--r-- | Modules/Qt4Macros.cmake | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 6516b0a..3b0a6cc 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -158,7 +158,7 @@ macro (QT4_GENERATE_MOC infile outfile ) set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") endif() - if ("x${ARGV2}" STREQUAL "xTARGET") + if (${ARGC} GREATER 3 AND "x${ARGV2}" STREQUAL "xTARGET") set(moc_target ${ARGV3}) endif() QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "" "${moc_target}") @@ -329,7 +329,10 @@ endmacro() macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename _optionalClassName) get_filename_component(_infile ${_xml_file} ABSOLUTE) - set(_optionalBasename "${ARGV4}") + unset(_optionalBasename) + if(${ARGC} GREATER 4) + set(_optionalBasename "${ARGV4}") + endif() if (_optionalBasename) set(_basename ${_optionalBasename} ) else () @@ -337,7 +340,10 @@ macro(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optional string(TOLOWER ${_basename} _basename) endif () - set(_optionalClassName "${ARGV5}") + unset(_optionalClassName) + if(${ARGC} GREATER 5) + set(_optionalClassName "${ARGV5}") + endif() set(_header "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h") set(_impl "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp") set(_moc "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc") |