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