From a9764cf191fe4454d5c5b0e057669689870453cf Mon Sep 17 00:00:00 2001 From: Kornel Benko Date: Wed, 9 Dec 2015 15:37:58 +0100 Subject: [PATCH] Cmake build: Initialize some variables before use. --- development/autotests/ExportTests.cmake | 10 ++++++++++ development/cmake/modules/LyXMacros.cmake | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/development/autotests/ExportTests.cmake b/development/autotests/ExportTests.cmake index 4d3b316bf8..6c5e494641 100644 --- a/development/autotests/ExportTests.cmake +++ b/development/autotests/ExportTests.cmake @@ -36,6 +36,14 @@ else() set(PDF_FORMATS "pdf" "pdf2" "pdf3") endif() +set(potential_languages "ca" "cs" "da" "de" "el" "es" "eu" "fa" "fr" "gl" "he" "hu" "id" "it" "ja" "ko" "nb" "nl" "pl" "pt" "ro" "ru" "sk" "sl" "sr" "sv" "uk" "zh_CN") + +macro(initLangVars varname) + foreach(_l ${potential_languages}) + set(${varname}_${_l}) + endforeach() +endmacro() + macro(getoutputformats filepath varname) file(STRINGS "${filepath}" lines) # What should we test, if default_output_format is not defined? @@ -164,6 +172,8 @@ endmacro() macro(loadTestList filename resList depth) # Create list of strings from a file without comments # ENCODING parameter is a new feature in cmake 3.1 + initLangVars(${resList}) + initLangVars("sublabel") if (CMAKE_VERSION VERSION_GREATER "3.1") file(STRINGS ${filename} tempList ENCODING "UTF-8") else() diff --git a/development/cmake/modules/LyXMacros.cmake b/development/cmake/modules/LyXMacros.cmake index c0dd65e236..11a050cba3 100644 --- a/development/cmake/modules/LyXMacros.cmake +++ b/development/cmake/modules/LyXMacros.cmake @@ -104,7 +104,9 @@ macro(LYX_AUTOMOC) set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) if (WIN32) - set(_def -D_WIN32) + set(_def -D_WIN32) + else() + set(_def) endif() #set(_moc ${_abs_PATH}/${_current_MOC}) add_custom_command(OUTPUT ${_moc} -- 2.39.2