From 9887406b84ec08847c61d6c060cfea80940c1bfa Mon Sep 17 00:00:00 2001 From: Lukas Cone Date: Sat, 11 Jan 2020 19:14:13 +0100 Subject: [PATCH] CMake: Changed version.h generation dir --- CMakeLists.txt | 6 +++--- cli/CMakeLists.txt | 2 +- src/CMakeLists.txt | 1 - winamp/CMakeLists.txt | 2 +- xmplay/CMakeLists.txt | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7cbc5ae..f9f37aee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 918e47b6..c3683096 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -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 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cc5068a9..48f39aba 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 diff --git a/winamp/CMakeLists.txt b/winamp/CMakeLists.txt index fd26ffc5..f95e6cc2 100644 --- a/winamp/CMakeLists.txt +++ b/winamp/CMakeLists.txt @@ -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) diff --git a/xmplay/CMakeLists.txt b/xmplay/CMakeLists.txt index e37c8765..7f523fe0 100644 --- a/xmplay/CMakeLists.txt +++ b/xmplay/CMakeLists.txt @@ -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)