Commit cbcabdad authored by Guillaume Pasero's avatar Guillaume Pasero

BUG: Mantis-1301: add the dependency to source files for lupdate

parent 2cee219d
......@@ -19,20 +19,14 @@ function( add_to_qt4_i18n_files RESULT )
get_filename_component( ABS_FILE ${F} ABSOLUTE )
set( ${RESULT}
"${${RESULT}} ${ABS_FILE}"
CACHE INTERNAL "" FORCE
)
set(${RESULT} ${${RESULT}} ${ABS_FILE} CACHE INTERNAL "")
endforeach()
endfunction()
#
#
macro( add_to_qt4_i18n_include_path DIRECTORY )
set( OTB_I18N_INCLUDE_PATH
"${OTB_I18N_INCLUDE_PATH} ${DIRECTORY}"
CACHE INTERNAL "" FORCE
)
set(OTB_I18N_INCLUDE_PATH ${OTB_I18N_INCLUDE_PATH} ${DIRECTORY} CACHE INTERNAL "")
endmacro()
#
......@@ -41,32 +35,13 @@ macro( add_to_qt4_i18n_headers INCLUDE_DIR )
get_filename_component( ABS_INCLUDE_DIR ${INCLUDE_DIR} ABSOLUTE )
set( OTB_QT_I18N_INCLUDE_PATH
"${OTB_QT_I18N_INCLUDE_PATH} ${ABS_INCLUDE_DIR}"
CACHE INTERNAL "" FORCE
)
set(OTB_QT_I18N_INCLUDE_PATH ${OTB_QT_I18N_INCLUDE_PATH} ${ABS_INCLUDE_DIR} CACHE INTERNAL "")
unset(HEADERS)
foreach( F ${ARGN} )
string( REPLACE ".cxx" ".h" HEADER ${F} )
list( APPEND HEADERS ${HEADER} )
endforeach()
#message( "HEADERS=${HEADERS}" )
foreach( F ${HEADERS} )
#message( "F=${F}" )
set( ABS_FILE "${ABS_INCLUDE_DIR}/${F}" )
if( EXISTS ${ABS_FILE} )
set( OTB_QT_I18N_HEADER_FILES
"${OTB_QT_I18N_HEADER_FILES} ${ABS_FILE}"
CACHE INTERNAL "" FORCE
)
set( ABS_HEADER "${ABS_INCLUDE_DIR}/${HEADER}" )
if(EXISTS ${ABS_HEADER})
set(OTB_QT_I18N_HEADER_FILES ${OTB_QT_I18N_HEADER_FILES} ${ABS_HEADER} CACHE INTERNAL "")
endif()
endforeach()
endmacro()
......@@ -88,18 +63,39 @@ endmacro()
macro( generate_qt4_project FILENAME )
message( STATUS "Generating Qt4 '${FILENAME}' project file for I18N." )
unset(_OTB_QT_I18N_INCLUDE_PATH_PRO)
unset(_OTB_QT_I18N_HEADER_PRO)
unset(_OTB_QT_I18N_SOURCE_PRO)
unset(_OTB_QT_I18N_FORM_PRO)
foreach(_path ${OTB_QT_I18N_INCLUDE_PATH})
set(_OTB_QT_I18N_INCLUDE_PATH_PRO
"${_OTB_QT_I18N_INCLUDE_PATH_PRO} \"${_path}\"")
endforeach()
foreach(_file ${OTB_QT_I18N_HEADER_FILES})
set(_OTB_QT_I18N_HEADER_PRO
"${_OTB_QT_I18N_HEADER_PRO} \"${_file}\"")
endforeach()
foreach(_file ${OTB_QT_I18N_SOURCE_FILES})
set(_OTB_QT_I18N_SOURCE_PRO
"${_OTB_QT_I18N_SOURCE_PRO} \"${_file}\"")
endforeach()
foreach(_file ${OTB_QT_I18N_FORM_FILES})
set(_OTB_QT_I18N_FORM_PRO
"${_OTB_QT_I18N_FORM_PRO} \"${_file}\"")
endforeach()
file( WRITE
${FILENAME}
"# OTB autogenerated .pro file needed to generate Qt I18N translations
INCLUDEPATH = ${OTB_QT_I18N_INCLUDE_PATH}
INCLUDEPATH = ${_OTB_QT_I18N_INCLUDE_PATH_PRO}
HEADERS = ${OTB_QT_I18N_HEADER_FILES}
HEADERS = ${_OTB_QT_I18N_HEADER_PRO}
SOURCES = ${OTB_QT_I18N_SOURCE_FILES}
SOURCES = ${_OTB_QT_I18N_SOURCE_PRO}
FORMS = ${OTB_QT_I18N_FORM_FILES}
FORMS = ${_OTB_QT_I18N_FORM_PRO}
"
)
endmacro()
......@@ -25,7 +25,7 @@ if( OTBQt4_ENABLED )
"WARNING: OTB_I18N_MERGE_TS:BOOL option is set to ON. 'make clean' will delete .ts files from source directory!"
)
message( STATUS "Qt I18N source files: " ${OTB_QT_I18N_SOURCE_FILES} )
message( STATUS "Qt I18N source files: ${OTB_QT_I18N_SOURCE_FILES}")
set( OTB_QT_I18N_PRO "${CMAKE_CURRENT_BINARY_DIR}/i18n.pro" )
......@@ -39,9 +39,9 @@ if( OTBQt4_ENABLED )
COMMAND ${QT_LUPDATE_EXECUTABLE}
ARGS -locations none -pro ${OTB_QT_I18N_PRO} -ts ${_abs_ts}
DEPENDS
#${OTB_QT_I18N_HEADER_FILES}
#${OTB_QT_I18N_SOURCE_FILES}
#${OTB_QT_I18N_FORM_FILES}
${OTB_QT_I18N_HEADER_FILES}
${OTB_QT_I18N_SOURCE_FILES}
${OTB_QT_I18N_FORM_FILES}
${OTB_QT_I18N_PRO}
VERBATIM)
endforeach()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment