Skip to content

Commit

Permalink
Move resource files in subfolders
Browse files Browse the repository at this point in the history
(stop treating Windows as first-class :P)
  • Loading branch information
carstene1ns committed May 1, 2022
1 parent 07f0954 commit 7796bcb
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 20 deletions.
25 changes: 14 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,8 @@ if(${PLAYER_BUILD_EXECUTABLE} AND ${PLAYER_TARGET_PLATFORM} STREQUAL "SDL2")
# Add resources
string(REPLACE "." "," RC_VERSION ${PROJECT_VERSION})
string(TIMESTAMP RC_YEAR "%Y")
configure_file(resources/player.rc.in resources/player.rc @ONLY)
target_sources(${EXE_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/resources/player.rc")
configure_file(resources/windows/player.rc.in resources/windows/player.rc @ONLY)
target_sources(${EXE_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/resources/windows/player.rc")

# Change executable name
set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "Player")
Expand Down Expand Up @@ -1137,17 +1137,20 @@ set(MAN_NAME easyrpg-player.6)
find_program(A2X_EXECUTABLE NAMES a2x a2x.py)
set(MANUAL_STATUS "Unavailable")
if(A2X_EXECUTABLE)
add_custom_command(OUTPUT resources/${MAN_NAME}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/resources
COMMAND ${A2X_EXECUTABLE} -a player_version="${PLAYER_VERSION}" -f manpage -D ${CMAKE_CURRENT_BINARY_DIR}/resources ${CMAKE_CURRENT_SOURCE_DIR}/resources/${MAN_NAME}.adoc
DEPENDS resources/${MAN_NAME}.adoc
add_custom_command(OUTPUT resources/unix/${MAN_NAME}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/resources/unix
COMMAND ${A2X_EXECUTABLE} -a player_version="${PLAYER_VERSION}"
-f manpage -D ${CMAKE_CURRENT_BINARY_DIR}/resources/unix
${CMAKE_CURRENT_SOURCE_DIR}/resources/unix/${MAN_NAME}.adoc
DEPENDS resources/unix/${MAN_NAME}.adoc
COMMENT "(Re-)building manpage ${MAN_NAME}"
VERBATIM)
if(UNIX)
add_custom_target(player_man ALL DEPENDS resources/${MAN_NAME})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/resources/${MAN_NAME} DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
add_custom_target(player_man ALL DEPENDS resources/unix/${MAN_NAME})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/resources/unix/${MAN_NAME}
DESTINATION ${CMAKE_INSTALL_MANDIR}/man6)
else()
add_custom_target(player_man DEPENDS resources/${MAN_NAME})
add_custom_target(player_man DEPENDS resources/unix/${MAN_NAME})
endif()
if(NOT TARGET man)
add_custom_target(man)
Expand All @@ -1156,8 +1159,8 @@ if(A2X_EXECUTABLE)
set(MANUAL_STATUS "Generated")
else()
# no a2x, distribution archive?
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/resources/${MAN_NAME})
install(FILES resources/${MAN_NAME} DESTINATION share/man/man6)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/resources/unix/${MAN_NAME})
install(FILES resources/unix/${MAN_NAME} DESTINATION share/man/man6)
set(MANUAL_STATUS "Bundled")
endif()
endif()
Expand Down
10 changes: 5 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,14 @@ endif

# manual page
if HAVE_A2X
resources/easyrpg-player.6: resources/easyrpg-player.6.adoc
$(AM_V_GEN) $(A2X) -a player_version=$(PACKAGE_VERSION) -f manpage -D $(builddir)/resources $<
resources/unix/easyrpg-player.6: resources/unix/easyrpg-player.6.adoc
$(AM_V_GEN)$(A2X) -a player_version=$(PACKAGE_VERSION) -f manpage -D $(builddir)/resources/unix $<

dist_man6_MANS = resources/easyrpg-player.6
MOSTLYCLEANFILES += resources/easyrpg-player.6
dist_man6_MANS = resources/unix/easyrpg-player.6
MOSTLYCLEANFILES += resources/unix/easyrpg-player.6
else
if HAVE_MANUAL
dist_man6_MANS = resources/easyrpg-player.6
dist_man6_MANS = resources/unix/easyrpg-player.6
endif
endif

Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ git_version=`$srcdir/builds/autoconf/git-version.sh --pretty`
AC_CHECK_PROGS([A2X], [a2x a2x.py], [no])
AM_CONDITIONAL([HAVE_A2X], [test x"$A2X" != "xno"])
AC_SUBST([A2X])
AS_IF([test x"$A2X" = "xno" && test ! -f "${srcdir}/resources/easyrpg-player.6"],
AC_MSG_WARN([a2x is required to create the manual page]))
AM_CONDITIONAL([HAVE_MANUAL], [test -f "${srcdir}/resources/easyrpg-player.6"])
AS_IF([test x"$A2X" = "xno" && test ! -f "${srcdir}/resources/unix/easyrpg-player.6"],
AC_MSG_WARN([a2x is required to create the manual page]))
AM_CONDITIONAL([HAVE_MANUAL], [test -f "${srcdir}/resources/unix/easyrpg-player.6"])
# Doxygen source documentation
DX_DOXYGEN_FEATURE(OFF)
Expand Down Expand Up @@ -241,7 +241,7 @@ if test "yes" != "$silent"; then
echo "Documentation:"
echo -n " manual page: "
if test "$A2X" = "no" -a -f "${srcdir}/resources/easyrpg-player.6"; then
if test "$A2X" = "no" -a -f "${srcdir}/resources/unix/easyrpg-player.6"; then
echo "shipped"
elif test "x$A2X" != "xno"; then
echo "generated"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 7796bcb

Please sign in to comment.