bundled documentation touch-ups, minor install fixes

This commit is contained in:
Andrei "Akari" Alexeyev 2017-09-22 14:46:51 +03:00
parent e01c0d91f2
commit 313f55e72c
No known key found for this signature in database
GPG key ID: 048C3D2A5648B785
5 changed files with 50 additions and 7 deletions

View file

@ -108,23 +108,36 @@ add_subdirectory(src)
if(RELATIVE)
add_definitions(-DRELATIVE)
set(DOC_DIR .)
if(APPLE)
set(RES_DIR "Taisei.app/Contents/Resources")
set(DATA_DIR "${RES_DIR}/data")
install(FILES "OSX-iconset.icns" DESTINATION "${RES_DIR}" RENAME "Taisei.icns")
else()
set(DATA_DIR "data")
set(DATA_DIR "data")
endif()
install(FILES "story.txt" DESTINATION .)
install(FILES "COPYING" DESTINATION . RENAME "COPYING.txt")
else()
set(DATA_DIR "share/taisei")
set(DOC_DIR "share/doc/taisei")
install(FILES "taisei.desktop" DESTINATION "share/applications")
install(FILES "taisei.png" DESTINATION "share/icons/hicolor/128x128/apps")
install(FILES "story.txt" DESTINATION ${DATA_DIR})
endif()
install(FILES "STORY.txt" DESTINATION "${DOC_DIR}")
install(FILES "COPYING" DESTINATION "${DOC_DIR}" RENAME "COPYING.txt")
install(FILES "README_installed.txt" DESTINATION "${DOC_DIR}" RENAME "README.txt")
if(WIN32)
set(DOC_FILES "STORY.txt" "COPYING.txt" "README.txt")
configure_file(
"${BUILDSCRIPTS_DIR}/Win32FixDocs.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/Win32FixDocs.cmake"
@ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/Win32FixDocs.cmake")
endif()
set(GAME_RESOURCES_DIRS
@ -143,7 +156,7 @@ if(PACKAGE_DATA)
"${CMAKE_CURRENT_BINARY_DIR}/package_data.cmake"
@ONLY)
install(SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/package_data.cmake)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/package_data.cmake")
if(PACKAGE_DATA_LEANIFY)
find_program(LEANIFY_COMMAND "leanify")

7
README_installed.txt Normal file
View file

@ -0,0 +1,7 @@
Taisei Project
https://taisei-project.org/
For more information and troubleshooting, visit:
https://github.com/laochailan/taisei/blob/master/README.md

View file

@ -15,7 +15,7 @@ execute_process(
"@OSX_LIB_PATH@"
"@OSX_TOOL_PATH@"
"@OSX_TOOL_PREFIX@"
WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@"
WORKING_DIRECTORY "$ENV{DESTDIR}@CMAKE_INSTALL_PREFIX@"
RESULT_VARIABLE ERRCODE
)

View file

@ -0,0 +1,23 @@
find_program(UNIX2DOS unix2dos)
if(NOT UNIX2DOS)
message(FATAL_ERROR "unix2dos not found, please install it (probably comes with dos2unix)")
endif()
set(DOC_PREFIX "$ENV{DESTDIR}@CMAKE_INSTALL_PREFIX@/@DOC_DIR@")
set(DOC_FILES "@DOC_FILES@")
message(STATUS "Fixing line breaks in documentation")
foreach(FILE IN LISTS DOC_FILES)
execute_process(
COMMAND "${UNIX2DOS}" "${DOC_PREFIX}/${FILE}"
WORKING_DIRECTORY "@CMAKE_INSTALL_PREFIX@"
RESULT_VARIABLE ERRCODE
)
if(NOT ERRCODE EQUAL 0)
message(FATAL_ERROR "${UNIX2DOS} exited with error ${ERRCODE}")
endif()
endforeach()