diff options
author | Owen Rudge <owen@owenrudge.net> | 2021-01-30 09:36:20 +0000 |
---|---|---|
committer | Owen Rudge <owen@owenrudge.net> | 2021-02-08 23:23:24 +0000 |
commit | 395e015282279e95910128ebcd221879a22f9421 (patch) | |
tree | 6019af6aa1f3ae10b41d96889d3d20bbbe36ad28 /cmake | |
parent | 6c8f2227cdc01c978ec1cbf08a93925e148175b8 (diff) | |
download | openttd-395e015282279e95910128ebcd221879a22f9421.tar.xz |
Change: Convert .md to .rtf for Windows/Mac packages
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindPandoc.cmake | 3 | ||||
-rw-r--r-- | cmake/InstallAndPackage.cmake | 9 |
2 files changed, 11 insertions, 1 deletions
diff --git a/cmake/FindPandoc.cmake b/cmake/FindPandoc.cmake new file mode 100644 index 000000000..3a42851dd --- /dev/null +++ b/cmake/FindPandoc.cmake @@ -0,0 +1,3 @@ +if(NOT EXISTS ${PANDOC_EXECUTABLE}) + find_program(PANDOC_EXECUTABLE pandoc) +endif() diff --git a/cmake/InstallAndPackage.cmake b/cmake/InstallAndPackage.cmake index 5c56d2d6d..5fd17cb03 100644 --- a/cmake/InstallAndPackage.cmake +++ b/cmake/InstallAndPackage.cmake @@ -95,7 +95,14 @@ set(CPACK_PACKAGE_HOMEPAGE_URL "https://www.openttd.org/") set(CPACK_PACKAGE_CONTACT "OpenTTD <info@openttd.org>") set(CPACK_PACKAGE_INSTALL_DIRECTORY "OpenTTD") set(CPACK_PACKAGE_CHECKSUM "SHA256") -set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.md") + +if((APPLE OR WIN32) AND EXISTS ${PANDOC_EXECUTABLE}) + execute_process(COMMAND ${PANDOC_EXECUTABLE} "${CMAKE_SOURCE_DIR}/COPYING.md" -s -o "${CMAKE_BINARY_DIR}/COPYING.rtf") + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/COPYING.rtf") +else() + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.md") +endif() + set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") set(CPACK_MONOLITHIC_INSTALL YES) set(CPACK_PACKAGE_EXECUTABLES "openttd;OpenTTD") |