CACHEDIR.TAG: use CMake to configure this file

This ensures that IDEs will generate the file during configuration,
rather than relying on the use to run `init.py` (which confuses CLion
for some reason).
This commit is contained in:
Danny Robson 2019-11-25 07:46:35 +11:00
parent 5740025c5a
commit 4dd2a40e75
2 changed files with 5 additions and 1 deletions

5
CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
configure_file (
"${CMAKE_CURRENT_SOURCE_DIR}/build/CACHEDIR.TAG.in"
"${CMAKE_BINARY_DIR}/CACHEDIR.TAG"
@ONLY
)

View File

@ -88,7 +88,6 @@ if __name__ == '__main__':
accumulated += [f'"-D{key}={val}"' for key, val in vars.items()] accumulated += [f'"-D{key}={val}"' for key, val in vars.items()]
accumulated += args accumulated += args
cmds = [ cmds = [
f"cp {os.path.join(self_dir, 'CACHEDIR.TAG.in')} CACHEDIR.TAG",
f"cmake {source_dir} {' '.join(accumulated)}", f"cmake {source_dir} {' '.join(accumulated)}",
' '.join(build) ' '.join(build)
] ]