- string(SUBSTRING ${source} 0 1 init_char)
- string(COMPARE EQUAL ${init_char} "/" is_absolute)
- if (${is_absolute})
- set(file "${source}")
- else()
- set(file "${CMAKE_CURRENT_SOURCE_DIR}/${source}")
- endif()
+ path_join(file "${CMAKE_CURRENT_SOURCE_DIR}" "${source}")
file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR} ${file})
list(APPEND scripts ${relfile})
list(APPEND abs_scripts ${file})
file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR} ${file})
list(APPEND scripts ${relfile})
list(APPEND abs_scripts ${file})
get_target_property(source_dir ${target} SOURCE_DIR)
get_target_property(sources ${target} SOURCES)
foreach(source ${sources})
get_target_property(source_dir ${target} SOURCE_DIR)
get_target_property(sources ${target} SOURCES)
foreach(source ${sources})
file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR} ${file})
set(files ${files} ${relfile})
set(abs_files ${abs_files} ${file})
file(RELATIVE_PATH relfile ${PROJECT_SOURCE_DIR} ${file})
set(files ${files} ${relfile})
set(abs_files ${abs_files} ${file})
# Create the template for this specific sub-domain
add_custom_command (OUTPUT ${sh_pot}
COMMAND xgettext ${xgettext_params} -L Shell
# Create the template for this specific sub-domain
add_custom_command (OUTPUT ${sh_pot}
COMMAND xgettext ${xgettext_params} -L Shell
# build a ${domain.pot}-tmp as a byproduct. The msgfmt command than depend
# on the byproduct while their target depends on the output, so that msgfmt
# does not have to be rerun if nothing in the template changed.
# build a ${domain.pot}-tmp as a byproduct. The msgfmt command than depend
# on the byproduct while their target depends on the output, so that msgfmt
# does not have to be rerun if nothing in the template changed.
- add_custom_command (OUTPUT ${PROJECT_BINARY_DIR}/${domain}.pot
- BYPRODUCTS ${PROJECT_BINARY_DIR}/${domain}.pot-tmp
+ add_custom_command (OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot
+ BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot-tmp
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
# We need a target to depend on otherwise, the msgmerge might not get called
# with the make generator
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
# We need a target to depend on otherwise, the msgmerge might not get called
# with the make generator
file(MAKE_DIRECTORY ${outdir})
# Command to merge and compile the messages. As explained in the custom
# command for msgcomm, this depends on byproduct to avoid reruns
add_custom_command(OUTPUT ${outdir}/${domain}.po
file(MAKE_DIRECTORY ${outdir})
# Command to merge and compile the messages. As explained in the custom
# command for msgcomm, this depends on byproduct to avoid reruns
add_custom_command(OUTPUT ${outdir}/${domain}.po
- COMMAND msgmerge -qo ${outdir}/${domain}.po ${file} ${PROJECT_BINARY_DIR}/${domain}.pot-tmp
- DEPENDS ${file} ${PROJECT_BINARY_DIR}/${domain}.pot-tmp
+ COMMAND msgmerge -qo ${outdir}/${domain}.po ${file} ${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot-tmp
+ DEPENDS ${file} ${CMAKE_CURRENT_BINARY_DIR}/${domain}.pot-tmp
)
add_custom_command(OUTPUT ${outdir}/${domain}.mo
COMMAND msgfmt --statistics -o ${outdir}/${domain}.mo ${outdir}/${domain}.po
)
add_custom_command(OUTPUT ${outdir}/${domain}.mo
COMMAND msgfmt --statistics -o ${outdir}/${domain}.mo ${outdir}/${domain}.po
cmake_parse_arguments(NLS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(output ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_TEMPLATE}.pot)
foreach(domain ${NLS_DOMAINS})
cmake_parse_arguments(NLS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
set(output ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_TEMPLATE}.pot)
foreach(domain ${NLS_DOMAINS})