Add cmake TRANSLATIONS_ONLY for translations.zip.

Builds translations.zip and nothing else.

This is for the nightly builder when only translations are changed.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2021-12-19 13:57:05 +00:00
parent ea9d95dfa0
commit a5b2d070dc
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
4 changed files with 355 additions and 347 deletions

View File

@ -798,7 +798,9 @@ if(X86_64)
add_definitions(-D__AMD64__ -D__X86_64__)
endif()
if(NOT TRANSLATIONS_ONLY)
add_subdirectory(fex)
endif()
set(
SRC_MAIN
@ -1074,6 +1076,7 @@ if(ENABLE_FFMPEG)
)
endif()
if(NOT TRANSLATIONS_ONLY)
add_library(
vbamcore
STATIC
@ -1095,8 +1098,9 @@ add_library(
add_dependencies(vbamcore generate)
set_property(TARGET vbamcore PROPERTY CXX_STANDARD 11)
set_property(TARGET vbamcore PROPERTY CXX_STANDARD_REQUIRED ON)
endif()
if(ENABLE_SDL)
if((NOT TRANSLATIONS_ONLY) AND ENABLE_SDL)
add_executable(
vbam
WIN32

View File

@ -203,6 +203,7 @@ Here is the complete list:
| SSP_STATIC | Try to link static gcc stack protector library (gcc only) | OFF except Win32 |
| OPENAL_STATIC | Try to link static OpenAL libraries | OFF |
| SSP_STATIC | Link gcc stack protecter libssp statically (gcc, with ENABLE_SSP) | OFF |
| TRANSLATIONS_ONLY | Build only the translations.zip and nothing else | OFF |
Note for distro packagers, we use the CMake module
[GNUInstallDirs](https://cmake.org/cmake/help/v2.8.12/cmake.html#module:GNUInstallDirs)

View File

@ -5,4 +5,4 @@ gettext_create_translations(
${po_files}
)
add_dependencies(visualboyadvance-m translations)
add_dependencies(translations-zip translations)

View File

@ -281,7 +281,8 @@ else()
if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
AND NOT CMAKE_CROSSCOMPILING
AND NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD)
AND NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD
AND NOT TRANSLATIONS_ONLY)
set(ABI_CHECK TRUE)
endif()
@ -865,6 +866,7 @@ if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks")
endif()
if(NOT TRANSLATIONS_ONLY)
add_executable(
visualboyadvance-m
WIN32
@ -1011,21 +1013,20 @@ if(NOT WIN32 AND NOT APPLE)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/visualboyadvance-m.appdata.xml DESTINATION ${CMAKE_INSTALL_PREFIX}/share/appdata)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/icons/sizes/ DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor)
endif()
endif()
option(TRANSLATIONS_ONLY "Build only the translations.zip" OFF)
# Make the translations.zip for windows builds.
if(ENABLE_NLS AND WIN32)
if(ENABLE_NLS)
file(GLOB catalogs ${CMAKE_BINARY_DIR}/po/wxvbam/*.gmo)
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/translations.zip
add_custom_target(
translations-zip ALL
COMMAND ${CMAKE_COMMAND} -D "ZIP_PROGRAM=${ZIP_PROGRAM}" -P ${CMAKE_CURRENT_SOURCE_DIR}/make-translations-zip.cmake
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS translations make-translations-zip.cmake ${catalogs}
)
add_custom_target(translations-zip DEPENDS ${CMAKE_BINARY_DIR}/translations.zip)
add_dependencies(visualboyadvance-m translations-zip)
endif()
# Update the gettext pot source.
@ -1051,15 +1052,16 @@ if(ENABLE_NLS)
add_dependencies(gettext-pot xrc-strings)
add_dependencies(visualboyadvance-m gettext-pot)
add_dependencies(translations-zip gettext-pot)
add_custom_command(
TARGET visualboyadvance-m
TARGET translations-zip
POST_BUILD
COMMAND ${CMAKE_COMMAND} -D SRC_DIR=${CMAKE_SOURCE_DIR}/po/wxvbam -D BIN_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/check-pot-updated.cmake
)
endif()
if(NOT TRANSLATIONS_ONLY)
find_program(GPG_PROGRAM gpg)
if(GPG_PROGRAM)
@ -1277,5 +1279,6 @@ install(
if(BUILD_TESTING AND (NOT CMAKE_CROSSCOMPILING))
add_subdirectory(tests)
endif()
endif()
# vim:sw=4 et tw=0: