Compile fix for Qt 4.5 and earlier.

Update for cmake build.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38996 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Kornel Benko 2011-06-08 20:22:27 +00:00
parent c29440131a
commit 20d3484075
2 changed files with 6 additions and 1 deletions

View File

@ -616,6 +616,11 @@ endif()
configure_file(${LYX_CMAKE_DIR}/config.h.cmake ${TOP_BINARY_DIR}/config.h)
# Compute qt4-version from ${QTVERSION}
if(QTVERSION MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+).*")
MATH(EXPR QT4_VERSIONNUM "${CMAKE_MATCH_1}*10000+${CMAKE_MATCH_2}*100+${CMAKE_MATCH_3}")
set(QT4_VERSION "0x${QT4_VERSIONNUM}")
endif()
add_subdirectory(src "${TOP_BINARY_DIR}/src")
add_subdirectory(lib/lyx2lyx "${TOP_BINARY_DIR}/lyx2lyx")

View File

@ -108,7 +108,7 @@ macro(LYX_AUTOMOC)
#set(_moc ${_abs_PATH}/${_current_MOC})
add_custom_command(OUTPUT ${_moc}
COMMAND ${QT_MOC_EXECUTABLE}
ARGS ${_def} ${_moc_INCS} ${_header} -o ${_moc}
ARGS "-DQT_VERSION=${QT4_VERSION}" ${_def} ${_moc_INCS} ${_header} -o ${_moc}
MAIN_DEPENDENCY ${_header})
macro_add_file_dependencies(${_abs_FILE} ${_moc})
SET_SOURCE_FILES_PROPERTIES(${_moc} GENERATED)