From 9407cda1579e5746ca18a579752162d933f02813 Mon Sep 17 00:00:00 2001 From: bnnm Date: Thu, 12 Aug 2021 20:02:32 +0200 Subject: [PATCH] cmake: tweak to avoid permission failure on linux --- CMakeLists.txt | 10 +++++++--- doc/BUILD.md | 3 ++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 47262bdc..a41d0988 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,12 +85,16 @@ endif() # Set autogenerated version if(MSVC) set(VGM_VERSION_GENERATOR version-make.bat) + add_custom_command(OUTPUT ${VGM_SOURCE_DIR}/version_auto.h + COMMAND "${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}" + DEPENDS ${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}) else() + # linux uses 'sh' so git-less (src zip) builds can run without chmod -x (script) set(VGM_VERSION_GENERATOR version-make.sh) + add_custom_command(OUTPUT ${VGM_SOURCE_DIR}/version_auto.h + COMMAND sh "${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}" + DEPENDS ${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}) endif() -add_custom_command(OUTPUT ${VGM_SOURCE_DIR}/version_auto.h - COMMAND "${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}" - DEPENDS ${VGM_SOURCE_DIR}/${VGM_VERSION_GENERATOR}) add_custom_target(version_h ALL DEPENDS ${VGM_SOURCE_DIR}/version_auto.h) # FFmpeg detection diff --git a/doc/BUILD.md b/doc/BUILD.md index db91ad67..8fc8c301 100644 --- a/doc/BUILD.md +++ b/doc/BUILD.md @@ -80,6 +80,7 @@ sudo apt-get install -y git git clone https://github.com/vgmstream/vgmstream cd vgmstream +# in case they weren't set chmod +x version-get.sh version-make.sh make-build.sh # warning: installs stuff, check all "apt install" @@ -92,7 +93,7 @@ Tool used to generate common build files (for *make*, *VS/MSBuild*, etc), that i If you wish to use CMake see [CMAKE.md](CMAKE.md). Some extra info is only mentioned in this doc though. -Note that doing in-source builds of CMake (`cmake .` / selecting `./vgmstream` as output dir) is not recommended and may clobber default build files. +Note that doing in-source builds of CMake (`cmake .` / selecting `./vgmstream` as output dir) is not recommended and may clobber default build files (try `cmake -S . -B build` / using some `./build` subfolder). ### autotools (builds) Autogenerated *make* scripts, used by some modules (mainly Audacious for Linux, and external libs).