summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2019-04-07 12:01:32 +0200
committerglx22 <glx22@users.noreply.github.com>2020-06-05 19:36:05 +0200
commit4218ebc932950a8751146784ea5dad127bc27b10 (patch)
tree6483a0aad91205fed7c2adfec21699e1e55847b3 /cmake
parentb7643b1d36cb41eb6712042761c13b9819fcbe74 (diff)
downloadopenttd-4218ebc932950a8751146784ea5dad127bc27b10.tar.xz
Fix: [AzurePipelines] switch the CI / CD to CMake too
This also means dropping Debian/jessie, as it has a CMake that is too old (3.0), with no real path to upgrade.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/scripts/FindVersion.cmake31
1 files changed, 18 insertions, 13 deletions
diff --git a/cmake/scripts/FindVersion.cmake b/cmake/scripts/FindVersion.cmake
index 5edabeb19..00afa15ca 100644
--- a/cmake/scripts/FindVersion.cmake
+++ b/cmake/scripts/FindVersion.cmake
@@ -119,16 +119,21 @@ endif ()
message(STATUS "Version string: ${REV_VERSION}")
-message(STATUS "Generating rev.cpp")
-configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"
- "${FIND_VERSION_BINARY_DIR}/rev.cpp")
-
-if (WIN32)
- message(STATUS "Generating ottdres.rc")
- configure_file("${CMAKE_SOURCE_DIR}/src/os/windows/ottdres.rc.in"
- "${FIND_VERSION_BINARY_DIR}/ottdres.rc")
-endif (WIN32)
-
-message(STATUS "Generating CPackProperties.cmake")
-configure_file("${CMAKE_SOURCE_DIR}/CPackProperties.cmake.in"
- "${CPACK_BINARY_DIR}/CPackProperties.cmake" @ONLY)
+if (GENERATE_OTTDREV)
+ message(STATUS "Generating .ottdrev")
+ file(WRITE ${CMAKE_SOURCE_DIR}/.ottdrev "${REV_VERSION}\t${REV_ISODATE}\t${REV_MODIFIED}\t${REV_HASH}\t${REV_ISTAG}\t${REV_ISSTABLETAG}\t${REV_YEAR}\n")
+else (GENERATE_OTTDREV)
+ message(STATUS "Generating rev.cpp")
+ configure_file("${CMAKE_SOURCE_DIR}/src/rev.cpp.in"
+ "${FIND_VERSION_BINARY_DIR}/rev.cpp")
+
+ if (WIN32)
+ message(STATUS "Generating ottdres.rc")
+ configure_file("${CMAKE_SOURCE_DIR}/src/os/windows/ottdres.rc.in"
+ "${FIND_VERSION_BINARY_DIR}/ottdres.rc")
+ endif (WIN32)
+
+ message(STATUS "Generating CPackProperties.cmake")
+ configure_file("${CMAKE_SOURCE_DIR}/CPackProperties.cmake.in"
+ "${CPACK_BINARY_DIR}/CPackProperties.cmake" @ONLY)
+endif (GENERATE_OTTDREV)