--- /dev/null
+
+IF(WIN32)
+ STRING(REGEX REPLACE "\\\\" "/" QT_DIR "$ENV{QTDIR}")
+ SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
+ SET(QT_INCLUDE_DIR "${QT_DIR}/include")
+ SET(QT_QT_INCLUDE_DIR "${QT_INCLUDE_DIR}/Qt")
+ SET(QT_QT3SUPPORT_INCLUDE_DIR "${QT_INCLUDE_DIR}/Qt3Support")
+ SET(QT_QTASSISTANT_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtAssistant")
+ SET(QT_QTCORE_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtCore")
+ SET(QT_QTDESIGNER_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtDesigner")
+ SET(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtDesigner")
+ SET(QT_QTDBUS_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtDBus")
+ SET(QT_QTGUI_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtGui")
+ SET(QT_QTMOTIF_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtMotif")
+ SET(QT_QTNETWORK_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtNetwork")
+ SET(QT_QTNSPLUGIN_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtNsPlugin")
+ SET(QT_QTOPENGL_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtOpenGL")
+ SET(QT_QTSQL_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtSql")
+ SET(QT_QTXML_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtXml")
+ SET(QT_QTSCRIPT_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtScript")
+ SET(QT_QTASSISTANTCLIENT_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtAssistant")
+ SET(QT_QTWEBKIT_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtHelp")
+ SET(QT_QTHELP_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtWebKit")
+ SET(QT_QTXMLPATTERNS_INCLUDE_DIR "${QT_INCLUDE_DIR}/QtXmlPatterns")
+ SET(QT_PHONON_INCLUDE_DIR "${QT_INCLUDE_DIR}/phonon")
+ SET(QT_FOUND "YES" )
+ SET(QT_DEFINITIONS -DQT_DLL)
+ # True if QtCore was found.
+ SET(QT_QTCORE_FOUND "YES" )
+ # QT_QTGUI_FOUND True if QtGui was found.
+ SET(QT_QTGUI_FOUND "YES" )
+ # QT_QT3SUPPORT_FOUND True if Qt3Support was found.
+ SET(QT_QT3SUPPORT_FOUND "YES" )
+ # QT_QTASSISTANT_FOUND True if QtAssistant was found.
+ SET(QT_QTASSISTANT_FOUND "YES" )
+ # QT_QTDBUS_FOUND True if QtDBus was found.
+ SET(QT_QTDBUS_FOUND "YES" )
+ # QT_QTDESIGNER_FOUND True if QtDesigner was found.
+ SET(QT_QTDESIGNER_FOUND "YES" )
+ # QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found.
+ SET(QT_QTDESIGNERCOMPONENTS "YES" )
+ # QT_QTMOTIF_FOUND True if QtMotif was found.
+ SET(QT_QTMOTIF_FOUND "YES" )
+ # QT_QTNETWORK_FOUND True if QtNetwork was found.
+ SET(QT_QTNETWORK_FOUND "YES" )
+ # QT_QTNSPLUGIN_FOUND True if QtNsPlugin was found.
+ SET(QT_QTNSPLUGIN_FOUND "YES" )
+ # QT_QTOPENGL_FOUND True if QtOpenGL was found.
+ SET(QT_QTOPENGL_FOUND "YES" )
+ # QT_QTSQL_FOUND True if QtSql was found.
+ SET(QT_QTSQL_FOUND "YES" )
+ # QT_QTXML_FOUND True if QtXml was found.
+ SET(QT_QTXML_FOUND "YES" )
+ # QT_QTSVG_FOUND True if QtSvg was found.
+ SET(QT_QTSVG_FOUND "YES" )
+ # QT_QTSCRIPT_FOUND True if QtScript was found.
+ SET(QT_QTSCRIPT_FOUND "YES" )
+ # QT_QTTEST_FOUND True if QtTest was found.
+ SET(QT_QTTEST_FOUND "YES" )
+ # QT_QTUITOOLS_FOUND True if QtUiTools was found.
+ SET(QT_QTUITOOLS_FOUND "YES" )
+ # QT_QTASSISTANTCLIENT_FOUND True if QtAssistantClient was found.
+ SET(QT_QTASSISTANTCLIENT_FOUND "YES" )
+ # QT_QTHELP_FOUND True if QtHelp was found.
+ SET(QT_QTHELP_FOUND "YES" )
+ # QT_QTWEBKIT_FOUND True if QtWebKit was found.
+ SET(QT_QTWEBKIT_FOUND "YES" )
+ # QT_QTXMLPATTERNS_FOUND True if QtXmlPatterns was found.
+ SET(QT_QTXMLPATTERNS_FOUND "YES" )
+ # QT_PHONON_FOUND True if phonon was found.
+ SET(QT_PHONON_FOUND "YES" )
+
+ SET(QT_MKSPECS_DIR "${QT_DIR}/mkspecs")
+ SET(QT_INCLUDES ${QT_QT_INCLUDE_DIR} ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} )
+ SET(QT_LIBRARY_DIR "${QT_DIR}/lib")
+
+ SET(QT_MOC_EXECUTABLE "${QT_DIR}/bin/moc.exe")
+ SET(QT_WRAP_CPP "YES")
+ SET(QT_UIC_EXECUTABLE "${QT_DIR}/bin/uic.exe")
+ SET(QT_WRAP_UI "YES")
+
+ #SET(QT_UIC3_EXECUTABLE "${QT_DIR}/bin/uic3.exe")
+ #SET(QT_RCC_EXECUTABLE "${QT_DIR}/bin/rcc.exe")
+ #SET(QT_LUPDATE_EXECUTABLE "${QT_DIR}/bin/lupdate.exe")
+ #SET(QT_LRELEASE_EXECUTABLE "${QT_DIR}/bin/lrelease.exe")
+
+ #SET(QT_DBUSCPP2XML_EXECUTABLE "${QT_DIR}/bin/moc.exe")
+ #SET(QT_DBUSXML2CPP_EXECUTABLE "${QT_DIR}/bin/moc.exe")
+
+
+ SET(QT_FOUND "YES" )
+
+ MACRO (QT4_EXTRACT_OPTIONS _qt4_files _qt4_options)
+ SET(${_qt4_files})
+ SET(${_qt4_options})
+ SET(_QT4_DOING_OPTIONS FALSE)
+ FOREACH(_currentArg ${ARGN})
+ IF ("${_currentArg}" STREQUAL "OPTIONS")
+ SET(_QT4_DOING_OPTIONS TRUE)
+ ELSE ("${_currentArg}" STREQUAL "OPTIONS")
+ IF(_QT4_DOING_OPTIONS)
+ LIST(APPEND ${_qt4_options} "${_currentArg}")
+ ELSE(_QT4_DOING_OPTIONS)
+ LIST(APPEND ${_qt4_files} "${_currentArg}")
+ ENDIF(_QT4_DOING_OPTIONS)
+ ENDIF ("${_currentArg}" STREQUAL "OPTIONS")
+ ENDFOREACH(_currentArg)
+ ENDMACRO (QT4_EXTRACT_OPTIONS)
+
+ # macro used to create the names of output files preserving relative dirs
+ MACRO (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile )
+ STRING(LENGTH ${CMAKE_CURRENT_BINARY_DIR} _binlength)
+ STRING(LENGTH ${infile} _infileLength)
+ SET(_checkinfile ${CMAKE_CURRENT_SOURCE_DIR})
+ IF(_infileLength GREATER _binlength)
+ STRING(SUBSTRING "${infile}" 0 ${_binlength} _checkinfile)
+ ENDIF(_infileLength GREATER _binlength)
+ IF(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}")
+ FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_BINARY_DIR} ${infile})
+ ELSE(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}")
+ FILE(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile})
+ ENDIF(CMAKE_CURRENT_BINARY_DIR MATCHES "${_checkinfile}")
+ SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}")
+ STRING(REPLACE ".." "__" _outfile ${_outfile})
+ GET_FILENAME_COMPONENT(outpath ${_outfile} PATH)
+ GET_FILENAME_COMPONENT(_outfile ${_outfile} NAME_WE)
+ FILE(MAKE_DIRECTORY ${outpath})
+ SET(${outfile} ${outpath}/${prefix}${_outfile}.${ext})
+ ENDMACRO (QT4_MAKE_OUTPUT_FILE )
+
+ MACRO (QT4_GET_MOC_FLAGS _moc_flags)
+ SET(${_moc_flags})
+ GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
+
+ FOREACH(_current ${_inc_DIRS})
+ SET(${_moc_flags} ${${_moc_flags}} "-I${_current}")
+ ENDFOREACH(_current ${_inc_DIRS})
+
+ GET_DIRECTORY_PROPERTY(_defines COMPILE_DEFINITIONS)
+ FOREACH(_current ${_defines})
+ SET(${_moc_flags} ${${_moc_flags}} "-D${_current}")
+ ENDFOREACH(_current ${_defines})
+
+ IF(Q_WS_WIN)
+ SET(${_moc_flags} ${${_moc_flags}} -DWIN32)
+ ENDIF(Q_WS_WIN)
+
+ ENDMACRO(QT4_GET_MOC_FLAGS)
+
+ # helper macro to set up a moc rule
+ MACRO (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options)
+ # For Windows, create a parameters file to work around command line length limit
+ IF (WIN32)
+ # Pass the parameters in a file. Set the working directory to
+ # be that containing the parameters file and reference it by
+ # just the file name. This is necessary because the moc tool on
+ # MinGW builds does not seem to handle spaces in the path to the
+ # file given with the @ syntax.
+ GET_FILENAME_COMPONENT(_moc_outfile_name "${outfile}" NAME)
+ GET_FILENAME_COMPONENT(_moc_outfile_dir "${outfile}" PATH)
+ IF(_moc_outfile_dir)
+ SET(_moc_working_dir WORKING_DIRECTORY ${_moc_outfile_dir})
+ ENDIF(_moc_outfile_dir)
+ SET (_moc_parameters_file ${outfile}_parameters)
+ SET (_moc_parameters ${moc_flags} ${moc_options} -o "${outfile}" "${infile}")
+ FILE (REMOVE ${_moc_parameters_file})
+ FOREACH(arg ${_moc_parameters})
+ FILE (APPEND ${_moc_parameters_file} "${arg}\n")
+ ENDFOREACH(arg)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_MOC_EXECUTABLE} @${_moc_outfile_name}_parameters
+ DEPENDS ${infile}
+ ${_moc_working_dir}
+ VERBATIM)
+ ELSE (WIN32)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_MOC_EXECUTABLE}
+ ARGS ${moc_flags} ${moc_options} -o ${outfile} ${infile}
+ DEPENDS ${infile})
+ ENDIF (WIN32)
+ ENDMACRO (QT4_CREATE_MOC_COMMAND)
+
+
+ MACRO (QT4_GENERATE_MOC infile outfile )
+ QT4_GET_MOC_FLAGS(moc_flags)
+ GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE)
+ QT4_CREATE_MOC_COMMAND(${abs_infile} ${outfile} "${moc_flags}" "")
+ SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file
+ ENDMACRO (QT4_GENERATE_MOC)
+
+
+ # QT4_WRAP_CPP(outfiles inputfile ... )
+
+ MACRO (QT4_WRAP_CPP outfiles )
+ # get include dirs
+ QT4_GET_MOC_FLAGS(moc_flags)
+ QT4_EXTRACT_OPTIONS(moc_files moc_options ${ARGN})
+
+ FOREACH (it ${moc_files})
+ GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
+ QT4_MAKE_OUTPUT_FILE(${it} moc_ cxx outfile)
+ QT4_CREATE_MOC_COMMAND(${it} ${outfile} "${moc_flags}" "${moc_options}")
+ SET(${outfiles} ${${outfiles}} ${outfile})
+ ENDFOREACH(it)
+
+ ENDMACRO (QT4_WRAP_CPP)
+
+
+ # QT4_WRAP_UI(outfiles inputfile ... )
+
+ MACRO (QT4_WRAP_UI outfiles )
+ QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
+
+ FOREACH (it ${ui_files})
+ GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+ GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+ SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_UIC_EXECUTABLE}
+ ARGS ${ui_options} -o ${outfile} ${infile}
+ MAIN_DEPENDENCY ${infile})
+ SET(${outfiles} ${${outfiles}} ${outfile})
+ ENDFOREACH (it)
+
+ ENDMACRO (QT4_WRAP_UI)
+
+
+ # QT4_ADD_RESOURCES(outfiles inputfile ... )
+
+ MACRO (QT4_ADD_RESOURCES outfiles )
+ QT4_EXTRACT_OPTIONS(rcc_files rcc_options ${ARGN})
+
+ FOREACH (it ${rcc_files})
+ GET_FILENAME_COMPONENT(outfilename ${it} NAME_WE)
+ GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
+ GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
+ SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/qrc_${outfilename}.cxx)
+ # parse file for dependencies
+ # all files are absolute paths or relative to the location of the qrc file
+ FILE(READ "${infile}" _RC_FILE_CONTENTS)
+ STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+ SET(_RC_DEPENDS)
+ FOREACH(_RC_FILE ${_RC_FILES})
+ STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
+ STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
+ IF(NOT _ABS_PATH_INDICATOR)
+ SET(_RC_FILE "${rc_path}/${_RC_FILE}")
+ ENDIF(NOT _ABS_PATH_INDICATOR)
+ SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
+ ENDFOREACH(_RC_FILE)
+ ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+ COMMAND ${QT_RCC_EXECUTABLE}
+ ARGS ${rcc_options} -name ${outfilename} -o ${outfile} ${infile}
+ MAIN_DEPENDENCY ${infile}
+ DEPENDS ${_RC_DEPENDS})
+ SET(${outfiles} ${${outfiles}} ${outfile})
+ ENDFOREACH (it)
+
+ ENDMACRO (QT4_ADD_RESOURCES)
+
+ MACRO(QT4_ADD_DBUS_INTERFACE _sources _interface _basename)
+ GET_FILENAME_COMPONENT(_infile ${_interface} ABSOLUTE)
+ SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+ COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -p ${_basename} ${_infile}
+ DEPENDS ${_infile})
+
+ SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
+
+ QT4_GENERATE_MOC(${_header} ${_moc})
+
+ SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
+ MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
+
+ ENDMACRO(QT4_ADD_DBUS_INTERFACE)
+
+
+ MACRO(QT4_ADD_DBUS_INTERFACES _sources)
+ FOREACH (_current_FILE ${ARGN})
+ GET_FILENAME_COMPONENT(_infile ${_current_FILE} ABSOLUTE)
+ # get the part before the ".xml" suffix
+ STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2" _basename ${_current_FILE})
+ STRING(TOLOWER ${_basename} _basename)
+ QT4_ADD_DBUS_INTERFACE(${_sources} ${_infile} ${_basename}interface)
+ ENDFOREACH (_current_FILE)
+ ENDMACRO(QT4_ADD_DBUS_INTERFACES)
+
+
+ MACRO(QT4_GENERATE_DBUS_INTERFACE _header) # _customName )
+ SET(_customName "${ARGV1}")
+ GET_FILENAME_COMPONENT(_in_file ${_header} ABSOLUTE)
+ GET_FILENAME_COMPONENT(_basename ${_header} NAME_WE)
+
+ IF (_customName)
+ SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_customName})
+ ELSE (_customName)
+ SET(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
+ ENDIF (_customName)
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${_target}
+ COMMAND ${QT_DBUSCPP2XML_EXECUTABLE} ${_in_file} > ${_target}
+ DEPENDS ${_in_file}
+ )
+ ENDMACRO(QT4_GENERATE_DBUS_INTERFACE)
+
+
+ MACRO(QT4_ADD_DBUS_ADAPTOR _sources _xml_file _include _parentClass) # _optionalBasename )
+ GET_FILENAME_COMPONENT(_infile ${_xml_file} ABSOLUTE)
+
+ SET(_optionalBasename "${ARGV4}")
+ IF (_optionalBasename)
+ SET(_basename ${_optionalBasename} )
+ ELSE (_optionalBasename)
+ STRING(REGEX REPLACE "(.*[/\\.])?([^\\.]+)\\.xml" "\\2adaptor" _basename ${_infile})
+ STRING(TOLOWER ${_basename} _basename)
+ ENDIF (_optionalBasename)
+
+ SET(_optionalClassName "${ARGV5}")
+ SET(_header ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)
+ SET(_impl ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
+ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.moc)
+
+ IF(_optionalClassName)
+ ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+ COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -c ${_optionalClassName} -i ${_include} -l ${_parentClass} ${_infile}
+ DEPENDS ${_infile}
+ )
+ ELSE(_optionalClassName)
+ ADD_CUSTOM_COMMAND(OUTPUT ${_impl} ${_header}
+ COMMAND ${QT_DBUSXML2CPP_EXECUTABLE} -m -a ${_basename} -i ${_include} -l ${_parentClass} ${_infile}
+ DEPENDS ${_infile}
+ )
+ ENDIF(_optionalClassName)
+
+ QT4_GENERATE_MOC(${_header} ${_moc})
+ SET_SOURCE_FILES_PROPERTIES(${_impl} PROPERTIES SKIP_AUTOMOC TRUE)
+ MACRO_ADD_FILE_DEPENDENCIES(${_impl} ${_moc})
+
+ SET(${_sources} ${${_sources}} ${_impl} ${_header} ${_moc})
+ ENDMACRO(QT4_ADD_DBUS_ADAPTOR)
+
+ MACRO(QT4_AUTOMOC)
+ QT4_GET_MOC_FLAGS(_moc_INCS)
+
+ SET(_matching_FILES )
+ FOREACH (_current_FILE ${ARGN})
+
+ GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+ # if "SKIP_AUTOMOC" is set to true, we will not handle this file here.
+ # This is required to make uic work correctly:
+ # we need to add generated .cpp files to the sources (to compile them),
+ # but we cannot let automoc handle them, as the .cpp files don't exist yet when
+ # cmake is run for the very first time on them -> however the .cpp files might
+ # exist at a later run. at that time we need to skip them, so that we don't add two
+ # different rules for the same moc file
+ GET_SOURCE_FILE_PROPERTY(_skip ${_abs_FILE} SKIP_AUTOMOC)
+
+ IF ( NOT _skip AND EXISTS ${_abs_FILE} )
+
+ FILE(READ ${_abs_FILE} _contents)
+
+ GET_FILENAME_COMPONENT(_abs_PATH ${_abs_FILE} PATH)
+
+ STRING(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
+ IF(_match)
+ FOREACH (_current_MOC_INC ${_match})
+ STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
+ GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE)
+ SET(_header ${_abs_PATH}/${_basename}.h)
+ SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
+ QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "")
+ MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+ ENDFOREACH (_current_MOC_INC)
+ ENDIF(_match)
+ ENDIF ( NOT _skip AND EXISTS ${_abs_FILE} )
+ ENDFOREACH (_current_FILE)
+ ENDMACRO(QT4_AUTOMOC)
+
+ MACRO(QT4_CREATE_TRANSLATION _qm_files)
+ QT4_EXTRACT_OPTIONS(_lupdate_files _lupdate_options ${ARGN})
+ MESSAGE("lupdate_files ${_lupdate_files}")
+ MESSAGE("lupdate_options ${_lupdate_options}")
+ SET(_my_sources)
+ SET(_my_tsfiles)
+ FOREACH (_file ${_lupdate_files})
+ GET_FILENAME_COMPONENT(_ext ${_file} EXT)
+ GET_FILENAME_COMPONENT(_abs_FILE ${_file} ABSOLUTE)
+ IF(_ext MATCHES "ts")
+ LIST(APPEND _my_tsfiles ${_abs_FILE})
+ ELSE(_ext MATCHES "ts")
+ LIST(APPEND _my_sources ${_abs_FILE})
+ ENDIF(_ext MATCHES "ts")
+ ENDFOREACH(_file)
+ FOREACH(_ts_file ${_my_tsfiles})
+ ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file}
+ COMMAND ${QT_LUPDATE_EXECUTABLE}
+ ARGS ${_lupdate_options} ${_my_sources} -ts ${_ts_file}
+ DEPENDS ${_my_sources})
+ ENDFOREACH(_ts_file)
+ QT4_ADD_TRANSLATION(${_qm_files} ${_my_tsfiles})
+ ENDMACRO(QT4_CREATE_TRANSLATION)
+
+ MACRO(QT4_ADD_TRANSLATION _qm_files)
+ FOREACH (_current_FILE ${ARGN})
+ GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
+ GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE)
+ SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
+
+ ADD_CUSTOM_COMMAND(OUTPUT ${qm}
+ COMMAND ${QT_LRELEASE_EXECUTABLE}
+ ARGS ${_abs_FILE} -qm ${qm}
+ DEPENDS ${_abs_FILE}
+ )
+ SET(${_qm_files} ${${_qm_files}} ${qm})
+ ENDFOREACH (_current_FILE)
+ ENDMACRO(QT4_ADD_TRANSLATION)
+
+
+ # Set QT_QTCORE_LIBRARY by searching for a lib with "QtCore." as part of the filename
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore QtCore4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH )
+ FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG NAMES QtCore_debug QtCored QtCored4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QT3SUPPORT_LIBRARY
+ FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_RELEASE NAMES Qt3Support Qt3Support4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QT3SUPPORT_LIBRARY_DEBUG NAMES Qt3Support_debug Qt3Supportd Qt3Supportd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTGUI_LIBRARY
+ FIND_LIBRARY(QT_QTGUI_LIBRARY_RELEASE NAMES QtGui QtGui4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTGUI_LIBRARY_DEBUG NAMES QtGui_debug QtGuid QtGuid4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTMOTIF_LIBRARY
+ IF(Q_WS_X11)
+ FIND_LIBRARY(QT_QTMOTIF_LIBRARY_RELEASE NAMES QtMotif PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTMOTIF_LIBRARY_DEBUG NAMES QtMotif_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ ENDIF(Q_WS_X11)
+
+ # Set QT_QTNETWORK_LIBRARY
+ FIND_LIBRARY(QT_QTNETWORK_LIBRARY_RELEASE NAMES QtNetwork QtNetwork4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTNETWORK_LIBRARY_DEBUG NAMES QtNetwork_debug QtNetworkd QtNetworkd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTNSPLUGIN_LIBRARY
+ FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY_RELEASE NAMES QtNsPlugin PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTNSPLUGIN_LIBRARY_DEBUG NAMES QtNsPlugin_debug PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTOPENGL_LIBRARY
+ FIND_LIBRARY(QT_QTOPENGL_LIBRARY_RELEASE NAMES QtOpenGL QtOpenGL4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTOPENGL_LIBRARY_DEBUG NAMES QtOpenGL_debug QtOpenGLd QtOpenGLd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTSQL_LIBRARY
+ FIND_LIBRARY(QT_QTSQL_LIBRARY_RELEASE NAMES QtSql QtSql4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTSQL_LIBRARY_DEBUG NAMES QtSql_debug QtSqld QtSqld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTXML_LIBRARY
+ FIND_LIBRARY(QT_QTXML_LIBRARY_RELEASE NAMES QtXml QtXml4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTXML_LIBRARY_DEBUG NAMES QtXml_debug QtXmld QtXmld4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTSVG_LIBRARY
+ FIND_LIBRARY(QT_QTSVG_LIBRARY_RELEASE NAMES QtSvg QtSvg4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTSVG_LIBRARY_DEBUG NAMES QtSvg_debug QtSvgd QtSvgd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTUITOOLS_LIBRARY
+ FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools QtUiTools4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_DEBUG NAMES QtUiTools_debug QtUiToolsd QtUiToolsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTTEST_LIBRARY
+ FIND_LIBRARY(QT_QTTEST_LIBRARY_RELEASE NAMES QtTest QtTest4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTTEST_LIBRARY_DEBUG NAMES QtTest_debug QtTestd QtTestd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTDBUS_LIBRARY
+ # This was introduced with Qt 4.2, where also the naming scheme for debug libs was changed
+ # So does any of the debug lib names listed here actually exist ?
+ FIND_LIBRARY(QT_QTDBUS_LIBRARY_RELEASE NAMES QtDBus QtDBus4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTDBUS_LIBRARY_DEBUG NAMES QtDBus_debug QtDBusd QtDBusd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTSCRIPT_LIBRARY
+ FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_RELEASE NAMES QtScript QtScript4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTSCRIPT_LIBRARY_DEBUG NAMES QtScript_debug QtScriptd QtScriptd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTASSISTANTCLIENT_LIBRARY
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient QtAssistantClient4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient_debug QtAssistantClientd QtAssistantClientd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTHELP_LIBRARY
+ FIND_LIBRARY(QT_QTHELP_LIBRARY_RELEASE NAMES QtHelp QtHelp4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTHELP_LIBRARY_DEBUG NAMES QtHelp_debug QtHelpd QtHelpd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene QtCLucene4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene_debug QtCLucened QtCLucened4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTWEBKIT_LIBRARY
+ FIND_LIBRARY(QT_QTWEBKIT_LIBRARY_RELEASE NAMES QtWebKit QtWebKit4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTWEBKIT_LIBRARY_DEBUG NAMES QtWebKit_debug QtWebKitd QtWebKitd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_QTXMLPATTERNS_LIBRARY
+ FIND_LIBRARY(QT_QTXMLPATTERNS_LIBRARY_RELEASE NAMES QtXmlPatterns QtXmlPatterns4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTXMLPATTERNS_LIBRARY_DEBUG NAMES QtXmlPatterns_debug QtXmlPatternsd QtXmlPatternsd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ # Set QT_PHONON_LIBRARY
+ FIND_LIBRARY(QT_PHONON_LIBRARY_RELEASE NAMES phonon phonon4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_PHONON_LIBRARY_DEBUG NAMES phonon_debug phonond phonond4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+
+ MACRO (_QT4_ADJUST_LIB_VARS basename)
+ IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ # if only the release version was found, set the debug variable also to the release version
+ IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+ SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE})
+ ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG)
+
+ # if only the debug version was found, set the release variable also to the debug version
+ IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+ SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG})
+ SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE)
+
+ IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+ # if the generator supports configuration types then set
+ # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
+ IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ # if there are no configuration types and CMAKE_BUILD_TYPE has no value
+ # then just use the release libraries
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} )
+ ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
+ SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG})
+ ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
+
+ SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE FILEPATH "The Qt ${basename} library")
+
+ IF (QT_${basename}_LIBRARY)
+ SET(QT_${basename}_FOUND 1)
+ ENDIF (QT_${basename}_LIBRARY)
+
+ ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG)
+
+ IF (QT_${basename}_INCLUDE_DIR)
+ #add the include directory to QT_INCLUDES
+ SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES})
+ ENDIF (QT_${basename}_INCLUDE_DIR)
+
+ # Make variables changeble to the advanced user
+ MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
+ ENDMACRO (_QT4_ADJUST_LIB_VARS)
+ # Set QT_xyz_LIBRARY variable and add
+ # library include path to QT_INCLUDES
+ _QT4_ADJUST_LIB_VARS(QTCORE)
+ _QT4_ADJUST_LIB_VARS(QTGUI)
+ _QT4_ADJUST_LIB_VARS(QT3SUPPORT)
+ _QT4_ADJUST_LIB_VARS(QTASSISTANT)
+ _QT4_ADJUST_LIB_VARS(QTDESIGNER)
+ _QT4_ADJUST_LIB_VARS(QTDESIGNERCOMPONENTS)
+ _QT4_ADJUST_LIB_VARS(QTNETWORK)
+ _QT4_ADJUST_LIB_VARS(QTNSPLUGIN)
+ _QT4_ADJUST_LIB_VARS(QTOPENGL)
+ _QT4_ADJUST_LIB_VARS(QTSQL)
+ _QT4_ADJUST_LIB_VARS(QTXML)
+ _QT4_ADJUST_LIB_VARS(QTSVG)
+ _QT4_ADJUST_LIB_VARS(QTSCRIPT)
+ _QT4_ADJUST_LIB_VARS(QTUITOOLS)
+ _QT4_ADJUST_LIB_VARS(QTTEST)
+ _QT4_ADJUST_LIB_VARS(QTDBUS)
+ _QT4_ADJUST_LIB_VARS(QTASSISTANTCLIENT)
+ _QT4_ADJUST_LIB_VARS(QTHELP)
+ _QT4_ADJUST_LIB_VARS(QTWEBKIT)
+ _QT4_ADJUST_LIB_VARS(QTXMLPATTERNS)
+ _QT4_ADJUST_LIB_VARS(PHONON)
+ _QT4_ADJUST_LIB_VARS(QTCLUCENE)
+ELSEIF(WIN32)
+ FIND_PACKAGE(Qt4 REQUIRED)
+ENDIF(WIN32)
\ No newline at end of file