summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/release.yml12
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmake/FindPandoc.cmake3
-rw-r--r--cmake/InstallAndPackage.cmake9
4 files changed, 27 insertions, 1 deletions
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 63af9ff87..07feba918 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -461,6 +461,13 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
+ - name: Install dependencies
+ env:
+ HOMEBREW_NO_AUTO_UPDATE: 1
+ HOMEBREW_NO_INSTALL_CLEANUP: 1
+ run: |
+ brew install pandoc
+
# The following step can be removed when the build VM is updated with a revision of
# vcpkg dating from roughly 01/01/2021 or later. At that point, `doNotUpdateVcpkg`
# can be set to `true` and the `vcpkgGitCommitId` can be removed.
@@ -638,6 +645,11 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
+ - name: Install dependencies
+ shell: bash
+ run: |
+ choco install pandoc
+
# "restore-cache" which is done by "run-vcpkg" uses Windows tar.
# A git clone on windows marks a few files as read-only; when Windows tar
# tries to extract the cache over this folder, it fails, despite the files
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8fbf3507d..c5d7ac113 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -337,4 +337,8 @@ endif()
include(CreateRegression)
create_regression()
+if(APPLE OR WIN32)
+ find_package(Pandoc)
+endif()
+
include(InstallAndPackage)
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")