diff --git a/cmake/GitVersion.cmake b/cmake/GitVersion.cmake index 786ac23ed..ff719d72a 100644 --- a/cmake/GitVersion.cmake +++ b/cmake/GitVersion.cmake @@ -26,16 +26,6 @@ else () message(WARNING "Failed to get valid version information from Git") endif () -# duplicated from OpenMWMacros.cmake -macro (configure_resource_file source_path destination_dir_base dest_path_relative) - if (MSVC) - configure_file(${source_path} "${destination_dir_base}/Debug/${dest_path_relative}") - configure_file(${source_path} "${destination_dir_base}/Release/${dest_path_relative}") - configure_file(${source_path} "${destination_dir_base}/RelWithDebInfo/${dest_path_relative}") - configure_file(${source_path} "${destination_dir_base}/MinSizeRel/${dest_path_relative}") - else (MSVC) - configure_file(${source_path} "${destination_dir_base}/${dest_path_relative}") - endif (MSVC) -endmacro (configure_resource_file) +include(${MACROSFILE}) configure_resource_file(${VERSION_IN_FILE} ${VERSION_FILE_PATH_BASE} ${VERSION_FILE_PATH_RELATIVE}) diff --git a/cmake/OpenMWMacros.cmake b/cmake/OpenMWMacros.cmake index 08b36017b..aac38a7f6 100644 --- a/cmake/OpenMWMacros.cmake +++ b/cmake/OpenMWMacros.cmake @@ -199,4 +199,4 @@ macro (copy_all_resource_files source_dir destination_dir_base destination_dir_r get_filename_component(filename ${f} NAME) copy_resource_file("${source_dir}/${f}" "${destination_dir_base}" "${destination_dir_relative}/${filename}") endforeach (f) -endmacro (copy_all_files) \ No newline at end of file +endmacro (copy_all_resource_files) \ No newline at end of file diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index a8b7f1fd2..b8ade0a67 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -17,6 +17,7 @@ if (GIT_CHECKOUT) -DOPENMW_VERSION_RELEASE=${OPENMW_VERSION_RELEASE} -DOPENMW_VERSION=${OPENMW_VERSION} -DMSVC=${MSVC} + -DMACROSFILE=${CMAKE_SOURCE_DIR}/cmake/OpenMWMacros.cmake -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GitVersion.cmake VERBATIM) else (GIT_CHECKOUT)