summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLoïc Guilloux <glx22@users.noreply.github.com>2021-04-20 21:38:46 +0200
committerGitHub <noreply@github.com>2021-04-20 21:38:46 +0200
commitd4f0b6f434911840e2762f89ca0de460f38133f9 (patch)
tree2cedadbe1e0a9ad7d8f9b1d0004dac4feb1f16a0 /CMakeLists.txt
parentfe3cd185d7a00d116e0ff06d24b3ac369b297a0e (diff)
downloadopenttd-d4f0b6f434911840e2762f89ca0de460f38133f9.tar.xz
Fix: [CMake] Auto-fill version details in rev.cpp and ottres.rc (#9066)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63a0ce2fe..87d055047 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,7 +4,9 @@ if(NOT BINARY_NAME)
set(BINARY_NAME openttd)
endif()
-project(${BINARY_NAME})
+project(${BINARY_NAME}
+ VERSION 1.12.0
+)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds not allowed. Please run \"cmake ..\" from the build directory. You may need to delete \"${CMAKE_SOURCE_DIR}/CMakeCache.txt\" first.")
@@ -72,6 +74,9 @@ add_custom_target(find_version
${CMAKE_COMMAND}
-DFIND_VERSION_BINARY_DIR=${CMAKE_BINARY_DIR}/generated
-DCPACK_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -DREV_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR}
+ -DREV_MINOR=${CMAKE_PROJECT_VERSION_MINOR}
+ -DREV_BUILD=${CMAKE_PROJECT_VERSION_PATCH}
-P "${CMAKE_SOURCE_DIR}/cmake/scripts/FindVersion.cmake"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
BYPRODUCTS ${GENERATED_SOURCE_FILES}