CubeWorldMods/InfiniteStackMod/GenerateProjectCMake.py

20 lines
424 B
Python
Raw Permalink Normal View History

2020-12-23 10:03:54 +08:00
import os
path = os.path.dirname(os.path.realpath(__file__))
_, folderName = os.path.split(path)
lines = [
'cmake_minimum_required (VERSION 3.8)',
'project(project_%s)' % folderName,
'add_subdirectory(CWSDK)',
'add_library (%s SHARED "main.cpp")' % folderName,
'target_link_libraries (%s LINK_PUBLIC CWSDK)' % folderName,
]
with open(os.path.join(path, 'CMakeLists.txt'), 'w') as f:
f.write('\n'.join(lines))