git-svn-id: svn://db.shs.com.ru/libs@256 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -127,6 +127,51 @@ macro(find_qt)
|
||||
endmacro()
|
||||
|
||||
|
||||
# usage: qt_sources(<src_out_var> [NO_DEFAULT] [DIR <dir>] [<regexp> ...])
|
||||
# collect all sources, optionally in directory <dir> and
|
||||
# additional filters <regexp>. By default filter files with regexps
|
||||
# "*.h", "*.hpp", "*.c", "*.cpp", "*.ui", "*.qrc", "*.rc", "*.ts" and "lang/*.ts".
|
||||
# Default filters disabled with option NO_DEFAULT
|
||||
macro(qt_sources OUT)
|
||||
set(${OUT})
|
||||
set(_DIR "")
|
||||
set(_IS_DIR 0)
|
||||
set(_NO_DEFAULT 0)
|
||||
set(_DEFAULT)
|
||||
set(_REGEXP)
|
||||
set(_REGEXP_WD)
|
||||
foreach(_i ${ARGN})
|
||||
if (_IS_DIR)
|
||||
set(_DIR "${_i}")
|
||||
set(_IS_DIR 0)
|
||||
else()
|
||||
if ("x${_i}" STREQUAL "xDIR")
|
||||
set(_IS_DIR 1)
|
||||
else()
|
||||
if ("x${_i}" STREQUAL "xNO_DEFAULT")
|
||||
set(_NO_DEFAULT 1)
|
||||
else()
|
||||
list(APPEND _REGEXP ${_i})
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
if (NOT "x${_DIR}" STREQUAL "x")
|
||||
#file(TO_CMAKE_PATH "${_DIR}//" _DIR)
|
||||
string(REPLACE "\\" "/" _DIR "${_DIR}/")
|
||||
string(REPLACE "//" "/" _DIR "${_DIR}")
|
||||
endif()
|
||||
foreach(_i ${_REGEXP})
|
||||
list(APPEND _REGEXP_WD "${_DIR}${_i}")
|
||||
endforeach()
|
||||
if (NOT _NO_DEFAULT)
|
||||
set(_DEFAULT "${_DIR}*.h" "${_DIR}*.hpp" "${_DIR}*.c" "${_DIR}*.cpp" "${_DIR}*.ui" "${_DIR}*.qrc" "${_DIR}*.rc" "${_DIR}*.ts" "${_DIR}lang/*.ts")
|
||||
endif()
|
||||
#message("${_DEFAULT}, ${_REGEXP_WD}")
|
||||
file(GLOB ${OUT} ${_DEFAULT} ${_REGEXP_WD})
|
||||
endmacro()
|
||||
|
||||
|
||||
# usage: qt_wrap(<file0> <file1> ... [HDRS <hrd_var>] [CPPS <cpp_var>] [QMS <qm_var>])
|
||||
# prepare sources for compile
|
||||
# store headers to <hrd_var>, all wrapped Qt4 files to <cpp_var>_Qt4 and Qt5 files to <cpp_var>_Qt5
|
||||
@@ -196,6 +241,7 @@ macro(qt_wrap)
|
||||
set(CPP_LIST)
|
||||
set(UI_LIST)
|
||||
set(RES_LIST)
|
||||
set(RC_LIST)
|
||||
set(TS_LIST)
|
||||
foreach(_i ${FILE_LIST})
|
||||
get_filename_component(_EXT "${_i}" EXT)
|
||||
@@ -215,6 +261,9 @@ macro(qt_wrap)
|
||||
if ("x${_EXT}" STREQUAL "x.qrc")
|
||||
list(APPEND RES_LIST "${_i}")
|
||||
endif()
|
||||
if ("x${_EXT}" STREQUAL "x.rc")
|
||||
list(APPEND RC_LIST "${_i}")
|
||||
endif()
|
||||
if ("x${_EXT}" STREQUAL "x.ts")
|
||||
list(APPEND TS_LIST "${_i}")
|
||||
endif()
|
||||
@@ -253,7 +302,9 @@ macro(qt_wrap)
|
||||
else()
|
||||
endif()
|
||||
endif()
|
||||
#message("${${QM${_v}_VAR}}")
|
||||
list(APPEND ${CPP${_v}_VAR} ${CPP_LIST})
|
||||
list(APPEND ${CPP${_v}_VAR} ${RC_LIST})
|
||||
list(APPEND ${CPP${_v}_VAR} ${MOCS${_v}})
|
||||
list(APPEND ${CPP${_v}_VAR} ${CUIS${_v}})
|
||||
list(APPEND ${CPP${_v}_VAR} ${CRES${_v}})
|
||||
|
||||
Reference in New Issue
Block a user