forked from mirror/openmw-tes3mp
Switch to a more reliable method of passing the git-version targt the data it needs
This commit is contained in:
parent
e3142b9643
commit
daf7d8451c
2 changed files with 12 additions and 7 deletions
|
@ -166,11 +166,15 @@ macro (openmw_add_executable target)
|
||||||
endmacro (openmw_add_executable)
|
endmacro (openmw_add_executable)
|
||||||
|
|
||||||
macro (get_generator_is_multi_config VALUE)
|
macro (get_generator_is_multi_config VALUE)
|
||||||
|
if (DEFINED generator_is_multi_config_var)
|
||||||
|
set(${VALUE} ${generator_is_multi_config_var})
|
||||||
|
else (DEFINED generator_is_multi_config_var)
|
||||||
if (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
|
if (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
|
||||||
get_cmake_property(${VALUE} GENERATOR_IS_MULTI_CONFIG)
|
get_cmake_property(${VALUE} GENERATOR_IS_MULTI_CONFIG)
|
||||||
else (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
|
else (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
|
||||||
list(LENGTH "${CMAKE_CONFIGURATION_TYPES}" ${VALUE})
|
list(LENGTH "${CMAKE_CONFIGURATION_TYPES}" ${VALUE})
|
||||||
endif (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
|
endif (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
|
||||||
|
endif (DEFINED generator_is_multi_config_var)
|
||||||
endmacro (get_generator_is_multi_config)
|
endmacro (get_generator_is_multi_config)
|
||||||
|
|
||||||
macro (copy_resource_file source_path destination_dir_base dest_path_relative)
|
macro (copy_resource_file source_path destination_dir_base dest_path_relative)
|
||||||
|
|
|
@ -5,6 +5,7 @@ set (VERSION_IN_FILE "${OpenMW_SOURCE_DIR}/files/version.in")
|
||||||
set (VERSION_FILE_PATH_BASE "${OpenMW_BINARY_DIR}")
|
set (VERSION_FILE_PATH_BASE "${OpenMW_BINARY_DIR}")
|
||||||
set (VERSION_FILE_PATH_RELATIVE resources/version)
|
set (VERSION_FILE_PATH_RELATIVE resources/version)
|
||||||
if (GIT_CHECKOUT)
|
if (GIT_CHECKOUT)
|
||||||
|
get_generator_is_multi_config(multi_config)
|
||||||
add_custom_target (git-version
|
add_custom_target (git-version
|
||||||
COMMAND ${CMAKE_COMMAND}
|
COMMAND ${CMAKE_COMMAND}
|
||||||
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
|
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
|
||||||
|
@ -18,7 +19,7 @@ if (GIT_CHECKOUT)
|
||||||
-DOPENMW_VERSION=${OPENMW_VERSION}
|
-DOPENMW_VERSION=${OPENMW_VERSION}
|
||||||
-DMACROSFILE=${CMAKE_SOURCE_DIR}/cmake/OpenMWMacros.cmake
|
-DMACROSFILE=${CMAKE_SOURCE_DIR}/cmake/OpenMWMacros.cmake
|
||||||
"-DCMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES}"
|
"-DCMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES}"
|
||||||
"-DCMAKE_GENERATOR=${CMAKE_GENERATOR}"
|
-Dgenerator_is_multi_config_var=${multi_config}
|
||||||
-P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GitVersion.cmake
|
-P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GitVersion.cmake
|
||||||
VERBATIM)
|
VERBATIM)
|
||||||
else (GIT_CHECKOUT)
|
else (GIT_CHECKOUT)
|
||||||
|
|
Loading…
Reference in a new issue