CMake: Changed version.h generation dir

This commit is contained in:
Lukas Cone 2020-01-11 19:14:13 +01:00
parent 087ed737ca
commit 9887406b84
5 changed files with 6 additions and 7 deletions

View File

@ -60,12 +60,12 @@ if(WIN32)
# Update the version
set(CMAKE_EXECUTABLE_SUFFIX .exe)
if(MSVC)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/version.h" VERSION_H_PATH)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/version.h
file(TO_NATIVE_PATH "${VGM_BINARY_DIR}/version.h" VERSION_H_PATH)
add_custom_command(OUTPUT ${VGM_BINARY_DIR}/version.h
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/version.bat"
ARGS ${VERSION_H_PATH} VERSION
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/version.bat)
add_custom_target(version_h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/version.h)
add_custom_target(version_h DEPENDS ${VGM_BINARY_DIR}/version.h)
else()
find_package(Git)
if(GIT_FOUND)

View File

@ -17,7 +17,7 @@ if(WIN32)
# Make sure that the binary directory is included (for version.h), as well as the getopt library include directory
target_include_directories(vgmstream_cli PRIVATE
${VGM_SOURCE_DIR}
${VGM_BINARY_DIR}
${VGM_SOURCE_DIR}/ext_libs/Getopt)
# Include the version string

View File

@ -41,7 +41,6 @@ setup_target(libvgmstream)
# Set up the proper include directories
target_include_directories(libvgmstream PRIVATE
${VGM_SOURCE_DIR}
${VGM_SOURCE_DIR}/ext_includes
coding
layout

View File

@ -29,7 +29,7 @@ target_compile_definitions(in_vgmstream PRIVATE
_UNICODE)
# Make sure that the binary directory is included (for version.h)
target_include_directories(in_vgmstream PRIVATE ${VGM_SOURCE_DIR})
target_include_directories(in_vgmstream PRIVATE ${VGM_BINARY_DIR})
# Include the version string
if(MSVC)

View File

@ -15,7 +15,7 @@ set_target_properties(xmp-vgmstream PROPERTIES
SUFFIX ".dll")
# Make sure that the binary directory is included (for version.h)
target_include_directories(xmp-vgmstream PRIVATE ${VGM_SOURCE_DIR})
target_include_directories(xmp-vgmstream PRIVATE ${VGM_BINARY_DIR})
# Include the version string
if(MSVC)