mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-16 16:19:10 +00:00
Fix autorevision target not working on win32 or when disabled.
This commit is contained in:
parent
6794f231e5
commit
4030e572ea
|
@ -113,28 +113,32 @@ if(NOT CMAKE_BUILD_TYPE)
|
|||
endif(NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
if(NOT DEFINED ENABLE_DISPLAY_REVISION)
|
||||
# Test whether the code is used in a repository if not autorevision will
|
||||
# fail and should be disabled by default. If inside a repository enable
|
||||
# the display of revision numbers by default.
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/utils/autorevision.sh -t h > ${CMAKE_CURRENT_BINARY_DIR}/revision.dummy
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE
|
||||
ENABLE_DISPLAY_REVISION_TEST_OUTPUT
|
||||
ERROR_VARIABLE
|
||||
ENABLE_DISPLAY_REVISION_TEST_ERRNO
|
||||
)
|
||||
# can't run the shell script on windows
|
||||
if(NOT WIN32)
|
||||
# Test whether the code is used in a repository if not autorevision will
|
||||
# fail and should be disabled by default. If inside a repository enable
|
||||
# the display of revision numbers by default.
|
||||
execute_process(
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/utils/autorevision.sh -t h > ${CMAKE_CURRENT_BINARY_DIR}/revision.dummy
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE
|
||||
ENABLE_DISPLAY_REVISION_TEST_OUTPUT
|
||||
ERROR_VARIABLE
|
||||
ENABLE_DISPLAY_REVISION_TEST_ERRNO
|
||||
)
|
||||
|
||||
if("${ENABLE_DISPLAY_REVISION_TEST_ERRNO}" STREQUAL "")
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION true)
|
||||
if("${ENABLE_DISPLAY_REVISION_TEST_ERRNO}" STREQUAL "")
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION true)
|
||||
else()
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
|
||||
endif()
|
||||
|
||||
unset(ENABLE_DISPLAY_REVISION_TEST_OUTPUT)
|
||||
unset(ENABLE_DISPLAY_REVISION_TEST_ERRNO)
|
||||
else()
|
||||
set(DEFAULT_ENABLE_DISPLAY_REVISION false)
|
||||
endif()
|
||||
|
||||
unset(ENABLE_DISPLAY_REVISION_TEST_OUTPUT)
|
||||
unset(ENABLE_DISPLAY_REVISION_TEST_ERRNO)
|
||||
|
||||
endif()
|
||||
|
||||
option(
|
||||
|
|
|
@ -192,7 +192,9 @@ if(ENABLE_GAME)
|
|||
Boost::locale
|
||||
Boost::filesystem
|
||||
)
|
||||
add_dependencies(wesnoth wesnoth-revision)
|
||||
if(ENABLE_DISPLAY_REVISION)
|
||||
add_dependencies(wesnoth wesnoth-revision)
|
||||
endif()
|
||||
|
||||
set_target_properties(wesnoth PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}wesnoth${BINARY_SUFFIX})
|
||||
|
||||
|
@ -229,7 +231,9 @@ if(ENABLE_TESTS)
|
|||
Boost::filesystem
|
||||
Boost::unit_test_framework
|
||||
)
|
||||
add_dependencies(boost_unit_tests wesnoth-revision)
|
||||
if(ENABLE_DISPLAY_REVISION)
|
||||
add_dependencies(boost_unit_tests wesnoth-revision)
|
||||
endif()
|
||||
|
||||
set_target_properties(boost_unit_tests PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}boost_unit_tests${BINARY_SUFFIX})
|
||||
endif(ENABLE_TESTS)
|
||||
|
@ -266,7 +270,9 @@ if(ENABLE_SERVER)
|
|||
endif(WIN32)
|
||||
|
||||
set_target_properties(wesnothd PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}wesnothd${BINARY_SUFFIX})
|
||||
add_dependencies(wesnothd wesnoth-revision)
|
||||
if(ENABLE_DISPLAY_REVISION)
|
||||
add_dependencies(wesnothd wesnoth-revision)
|
||||
endif()
|
||||
|
||||
install(TARGETS wesnothd DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif(ENABLE_SERVER)
|
||||
|
@ -304,7 +310,9 @@ if(ENABLE_CAMPAIGN_SERVER)
|
|||
endif(WIN32)
|
||||
|
||||
set_target_properties(campaignd PROPERTIES OUTPUT_NAME ${BINARY_PREFIX}campaignd${BINARY_SUFFIX})
|
||||
add_dependencies(campaignd wesnoth-revision)
|
||||
if(ENABLE_DISPLAY_REVISION)
|
||||
add_dependencies(campaignd wesnoth-revision)
|
||||
endif()
|
||||
|
||||
install(TARGETS campaignd DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
endif(ENABLE_CAMPAIGN_SERVER)
|
||||
|
|
Loading…
Reference in New Issue
Block a user