Skip to content

Commit

Permalink
Add: [CMake] Allow renaming of openttd binary
Browse files Browse the repository at this point in the history
  • Loading branch information
glx22 committed Jun 13, 2020
1 parent 0f4df06 commit 75399a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Expand Up @@ -128,6 +128,9 @@ include(CompileFlags)
compile_flags()

add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES})
if (BINARY_NAME)
set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}")
endif (BINARY_NAME)
# All other files are added via target_sources()

include(AddCustomXXXTimestamp)
Expand Down
7 changes: 6 additions & 1 deletion cmake/InstallAndPackage.cmake
Expand Up @@ -39,7 +39,12 @@ install(FILES
# file with little context to what it is.
if (OPTION_INSTALL_FHS)
set(MAN_SOURCE_FILE ${CMAKE_SOURCE_DIR}/docs/openttd.6)
set(MAN_BINARY_FILE ${CMAKE_BINARY_DIR}/docs/openttd.6)
if (BINARY_NAME)
set(MAN_BINARY_NAME ${BINARY_NAME})
else (BINARY_NAME)
set(MAN_BINARY_NAME openttd)
endif (BINARY_NAME)
set(MAN_BINARY_FILE ${CMAKE_BINARY_DIR}/docs/${MAN_BINARY_NAME}.6)
install(CODE
"
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${MAN_SOURCE_FILE} ${MAN_BINARY_FILE})
Expand Down

0 comments on commit 75399a2

Please sign in to comment.