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:
parent
ea9d95dfa0
commit
a5b2d070dc
|
@ -798,7 +798,9 @@ if(X86_64)
|
|||
add_definitions(-D__AMD64__ -D__X86_64__)
|
||||
endif()
|
||||
|
||||
add_subdirectory (fex)
|
||||
if(NOT TRANSLATIONS_ONLY)
|
||||
add_subdirectory(fex)
|
||||
endif()
|
||||
|
||||
set(
|
||||
SRC_MAIN
|
||||
|
@ -1074,7 +1076,8 @@ if(ENABLE_FFMPEG)
|
|||
)
|
||||
endif()
|
||||
|
||||
add_library(
|
||||
if(NOT TRANSLATIONS_ONLY)
|
||||
add_library(
|
||||
vbamcore
|
||||
STATIC
|
||||
${PROJECT_SRCS}
|
||||
|
@ -1091,12 +1094,13 @@ add_library(
|
|||
${SRC_DEBUGGER}
|
||||
${HDR_DEBUGGER}
|
||||
${HDR_STB_IMAGE}
|
||||
)
|
||||
add_dependencies(vbamcore generate)
|
||||
set_property(TARGET vbamcore PROPERTY CXX_STANDARD 11)
|
||||
set_property(TARGET vbamcore PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||
)
|
||||
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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -5,4 +5,4 @@ gettext_create_translations(
|
|||
${po_files}
|
||||
)
|
||||
|
||||
add_dependencies(visualboyadvance-m translations)
|
||||
add_dependencies(translations-zip translations)
|
||||
|
|
|
@ -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,7 +866,8 @@ if(APPLE)
|
|||
set(CMAKE_INSTALL_RPATH "@loader_path/../Frameworks")
|
||||
endif()
|
||||
|
||||
add_executable(
|
||||
if(NOT TRANSLATIONS_ONLY)
|
||||
add_executable(
|
||||
visualboyadvance-m
|
||||
WIN32
|
||||
MACOSX_BUNDLE
|
||||
|
@ -874,9 +876,9 @@ add_executable(
|
|||
${RES_WX}
|
||||
${VBAM_ICON_PATH}
|
||||
${CM_STUFF}
|
||||
)
|
||||
)
|
||||
|
||||
if(WIN32 AND (X86_64 OR X86_32) AND ENABLE_ONLINEUPDATES)
|
||||
if(WIN32 AND (X86_64 OR X86_32) AND ENABLE_ONLINEUPDATES)
|
||||
if(NOT DEFINED WINSPARKLE_BIN_RELEASE_DIR)
|
||||
set(WINSPARKLE_BIN_RELEASE_DIR ${CMAKE_SOURCE_DIR}/dependencies/WinSparkle-0.6.0)
|
||||
endif()
|
||||
|
@ -893,9 +895,9 @@ if(WIN32 AND (X86_64 OR X86_32) AND ENABLE_ONLINEUPDATES)
|
|||
endif()
|
||||
|
||||
configure_file(autoupdater/wxmsw/winsparkle-path.h.in ${CMAKE_BINARY_DIR}/winsparkle-path.h)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE AND ENABLE_ONLINEUPDATES)
|
||||
if(APPLE AND ENABLE_ONLINEUPDATES)
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(Sparkle
|
||||
|
@ -935,17 +937,17 @@ if(APPLE AND ENABLE_ONLINEUPDATES)
|
|||
)
|
||||
|
||||
TARGET_LINK_LIBRARIES(visualboyadvance-m ${SPARKLE_FRAMEWORK})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_link_libraries(
|
||||
target_link_libraries(
|
||||
visualboyadvance-m
|
||||
${wxWidgets_LIBRARIES}
|
||||
${VBAM_LIBS}
|
||||
)
|
||||
)
|
||||
|
||||
set(WIN32_MEDIA_FOUNDATION_LIBS dxva2 evr mf mfplat mfplay mfreadwrite mfuuid amstrmid)
|
||||
set(WIN32_MEDIA_FOUNDATION_LIBS dxva2 evr mf mfplat mfplay mfreadwrite mfuuid amstrmid)
|
||||
|
||||
if(ENABLE_FFMPEG)
|
||||
if(ENABLE_FFMPEG)
|
||||
if(WIN32)
|
||||
list(APPEND FFMPEG_LIBRARIES secur32 bcrypt ${WIN32_MEDIA_FOUNDATION_LIBS})
|
||||
endif()
|
||||
|
@ -963,11 +965,11 @@ if(ENABLE_FFMPEG)
|
|||
PROPERTIES LINK_FLAGS ${FFMPEG_LDFLAGS_STR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# link libgcc/libstdc++ statically on mingw
|
||||
# and adjust link command when making a static binary
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
# link libgcc/libstdc++ statically on mingw
|
||||
# and adjust link command when making a static binary
|
||||
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||
if(WIN32)
|
||||
# Build a console app in debug mode on Windows
|
||||
if(CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
|
@ -995,37 +997,36 @@ if(CMAKE_COMPILER_IS_GNUCXX)
|
|||
)
|
||||
endif()
|
||||
endif()
|
||||
elseif(MSVC)
|
||||
elseif(MSVC)
|
||||
# the debug lib libcmtd is linked in debug mode, so don't link the normal version
|
||||
set_target_properties(visualboyadvance-m PROPERTIES LINK_FLAGS_DEBUG "/nodefaultlib:libcmt /subsystem:console")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Make the app a console app in debug mode to get log messages.
|
||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
# Make the app a console app in debug mode to get log messages.
|
||||
if(WIN32 AND CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
target_compile_definitions(visualboyadvance-m PRIVATE -DWIN32_CONSOLE_APP)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
if(NOT WIN32 AND NOT APPLE)
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/visualboyadvance-m.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)
|
||||
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,33 +1052,34 @@ 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()
|
||||
|
||||
find_program(GPG_PROGRAM gpg)
|
||||
if(NOT TRANSLATIONS_ONLY)
|
||||
find_program(GPG_PROGRAM gpg)
|
||||
|
||||
if(GPG_PROGRAM)
|
||||
if(GPG_PROGRAM)
|
||||
execute_process(
|
||||
COMMAND ${GPG_PROGRAM} -k
|
||||
OUTPUT_VARIABLE GPG_KEYS
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
ERROR_QUIET
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
option(ZIP_SUFFIX [=[suffix for release zip files, e.g. "-somebranch".zip]=] OFF)
|
||||
option(ZIP_SUFFIX [=[suffix for release zip files, e.g. "-somebranch".zip]=] OFF)
|
||||
|
||||
if(NOT ZIP_SUFFIX)
|
||||
if(NOT ZIP_SUFFIX)
|
||||
set(ZIP_SUFFIX "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UPSTREAM_RELEASE AND WIN32)
|
||||
if(UPSTREAM_RELEASE AND WIN32)
|
||||
set(home "$ENV{HOME}")
|
||||
|
||||
if(NOT CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{MSYSTEM_PREFIX})
|
||||
|
@ -1135,7 +1137,7 @@ if(UPSTREAM_RELEASE AND WIN32)
|
|||
add_custom_command(
|
||||
OUTPUT ${CMAKE_BINARY_DIR}/translations.zip.asc
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_BINARY_DIR}/translations.zip.asc
|
||||
# COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/interactive-pause.cmake
|
||||
# COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/interactive-pause.cmake
|
||||
COMMAND ${GPG_PROGRAM} --detach-sign -a ${CMAKE_BINARY_DIR}/translations.zip
|
||||
DEPENDS translations-zip
|
||||
)
|
||||
|
@ -1148,7 +1150,7 @@ if(UPSTREAM_RELEASE AND WIN32)
|
|||
TARGET visualboyadvance-m
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${exezip}.asc
|
||||
# COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/interactive-pause.cmake
|
||||
# COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/interactive-pause.cmake
|
||||
COMMAND ${GPG_PROGRAM} --detach-sign -a ${exezip}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
|
@ -1166,9 +1168,9 @@ if(UPSTREAM_RELEASE AND WIN32)
|
|||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
if(APPLE)
|
||||
# this should set ROM file types correctly
|
||||
set_property(TARGET visualboyadvance-m APPEND PROPERTY MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/wxplist.in)
|
||||
set(MACOSX_BUNDLE_ICON_FILE ${VBAM_ICON})
|
||||
|
@ -1190,9 +1192,9 @@ if(APPLE)
|
|||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(APPLE AND (UPSTREAM_RELEASE OR ENABLE_ONLINEUPDATES))
|
||||
if(APPLE AND (UPSTREAM_RELEASE OR ENABLE_ONLINEUPDATES))
|
||||
if(NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
find_program(STRIP_PROGRAM strip)
|
||||
|
||||
|
@ -1247,15 +1249,15 @@ if(APPLE AND (UPSTREAM_RELEASE OR ENABLE_ONLINEUPDATES))
|
|||
TARGET visualboyadvance-m
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E remove ${appzip}.asc
|
||||
# COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/interactive-pause.cmake
|
||||
# COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/interactive-pause.cmake
|
||||
COMMAND ${GPG_PROGRAM} --detach-sign -a ${appzip}
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UPSTREAM_RELEASE AND NOT WIN32 AND NOT APPLE AND NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
if(UPSTREAM_RELEASE AND NOT WIN32 AND NOT APPLE AND NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
find_program(STRIP_PROGRAM strip)
|
||||
|
||||
if(STRIP_PROGRAM)
|
||||
|
@ -1266,16 +1268,17 @@ if(UPSTREAM_RELEASE AND NOT WIN32 AND NOT APPLE AND NOT CMAKE_BUILD_TYPE MATCHES
|
|||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(
|
||||
install(
|
||||
TARGETS visualboyadvance-m
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
)
|
||||
|
||||
if(BUILD_TESTING AND (NOT CMAKE_CROSSCOMPILING))
|
||||
if(BUILD_TESTING AND (NOT CMAKE_CROSSCOMPILING))
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# vim:sw=4 et tw=0:
|
||||
|
|
Loading…
Reference in New Issue