summaryrefslogtreecommitdiffstats
path: root/Modules/Qt4Macros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/Qt4Macros.cmake')
-rw-r--r--Modules/Qt4Macros.cmake12
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")