diff options
| -rw-r--r-- | kde-modules/KDECMakeSettings.cmake | 30 | 
1 files changed, 17 insertions, 13 deletions
| diff --git a/kde-modules/KDECMakeSettings.cmake b/kde-modules/KDECMakeSettings.cmake index 1a694330..c536e34a 100644 --- a/kde-modules/KDECMakeSettings.cmake +++ b/kde-modules/KDECMakeSettings.cmake @@ -284,16 +284,7 @@ endif()  ###################################################################  # Download translations -if(NOT EXISTS ${CMAKE_SOURCE_DIR}/po) -    option(KDE_L10N_AUTO_TRANSLATIONS "Automatically 'make fetch-translations`" OFF) -    set(KDE_L10N_BRANCH "trunk" CACHE STRING "Branch from l10n.kde.org to fetch from: trunk | stable | lts | trunk_kde4 | stable_kde4") - -    if(KDE_L10N_DOWNLOAD_TRANSLATIONS) -        set(_EXTRA_ARGS "ALL") -    else() -        set(_EXTRA_ARGS) -    endif() - +function(_repository_name reponame)      execute_process(COMMAND git config --get remote.origin.url          OUTPUT_VARIABLE giturl          RESULT_VARIABLE exitCode @@ -302,13 +293,26 @@ if(NOT EXISTS ${CMAKE_SOURCE_DIR}/po)      if(exitCode EQUAL 0)          string(REGEX MATCHALL ".+[:\\/]([A-Za-z\\-\\d]+)(.git)?\\s*" "" ${giturl}) -        set(reponame ${CMAKE_MATCH_1}) +        set(${reponame} ${CMAKE_MATCH_1} PARENT_SCOPE) +    endif() + +    if(NOT ${reponame}) +        set(${reponame} ${CMAKE_PROJECT_NAME} PARENT_SCOPE)      endif() +endfunction() + +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/po) +    option(KDE_L10N_AUTO_TRANSLATIONS "Automatically 'make fetch-translations`" OFF) +    set(KDE_L10N_BRANCH "trunk" CACHE STRING "Branch from l10n.kde.org to fetch from: trunk | stable | lts | trunk_kde4 | stable_kde4") -    if(NOT reponame) -        set(reponame ${CMAKE_PROJECT_NAME}) +    if(KDE_L10N_DOWNLOAD_TRANSLATIONS) +        set(_EXTRA_ARGS "ALL") +    else() +        set(_EXTRA_ARGS)      endif() +    _repository_name(reponame) +      add_custom_command(          OUTPUT "${CMAKE_BINARY_DIR}/releaseme"          COMMAND git clone --depth 1 "https://anongit.kde.org/releaseme.git" | 
