From d4f04729d59d5a872e948fa9a2bc7f95dda4363c Mon Sep 17 00:00:00 2001 From: Soeren Grunewald Date: Mon, 6 Apr 2020 23:27:14 +0200 Subject: [PATCH] meson: Add basic meson build support [Why] Apparently the CMake support is outdated and if one just wanna build the project, it inconvenient to install CodeBlocks first. [How] Add a very basic meson build file and update the documentation accordingly. Signed-off-by: Soeren Grunewald --- README.md | 16 ++++++--- meson.build | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 4 deletions(-) create mode 100644 meson.build diff --git a/README.md b/README.md index f8dec9d..fcfd9e7 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,23 @@ How to compile under Linux: I did not have time to test the newest version of the tools under Linux. These instructions are for the older versions (v7.3 and below). -Install gcc-c++ (g++) compiler, cmake, git and any wxGTK-devel v.2.9+ package available for your distribution repository. There is one program which requires wxWidgets - DeserializeAll. Everything else should compile perfectly without wxGTK installed. +Install gcc-c++ (g++) compiler, meson, ninja, git and any wxGTK-devel v.2.9+ package available for your distribution repository. +There are some programs which requires wxWidgets: + - DecompressLZO + - DeserializeAll + - ExportTexturesToDDS + - ImportTexturesFromDDS + +Everything else should compile perfectly without wxGTK installed. Clone github repo and compile UPKUtils project: ``` git clone https://github.com/wghost/UPKUtils.git -cd UPKUtils/build -cmake . -make +meson build +cd build +ninja ``` + To compile XComLZO packer/unpacker (deprecated): ``` cd UPKUtils/XComLZO/build diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..77e8ac5 --- /dev/null +++ b/meson.build @@ -0,0 +1,99 @@ +project('UPKUtils', + [ 'cpp', 'c' ], + default_options : [ 'cpp_std=c++14' ], + version : '1.6', + meson_version : '>=0.49') + +# also search in the project base dir +inc = [ include_directories('.') ] + +common_headers = files([ + 'CustomTFC.h', + 'lzoconf.h', + 'lzodefs.h', + 'LzoUtils.h', + 'minilzo.h', + 'UFlags.h', + 'UObjectFactory.h', + 'UObject.h', + 'UPKInfo.h', + 'UPKUtils.h', + 'UToken.h', + 'UTokenFactory.h', +]) +#install_headers(common_headers) + +common_src = [ + 'CustomTFC.cpp', + 'LzoUtils.cpp', + 'minilzo.c', + 'UFlags.cpp', + 'UObject.cpp', + 'UObjectFactory.cpp', + 'UPKInfo.cpp', + 'UPKUtils.cpp', + 'UToken.cpp', + 'UTokenFactory.cpp', +] +libcommon = static_library('common', common_src) + +# required by some of the binaries +wx_dep = dependency('wxwidgets', + version : '>=3.0.0', + required : true, + modules : ['std', 'stc']) + +if wx_dep.found() + executable('DecompressLZO', + ['DecompressLZO.cpp'], + link_with: libcommon, + dependencies : wx_dep) + + executable('DeserializeAll', + ['DeserializeAll.cpp'], + link_with: libcommon, + dependencies : wx_dep) + + executable('ExportTexturesToDDS', + ['ExportTexturesToDDS.cpp', 'dds.cpp'], + link_with: libcommon, + dependencies : wx_dep) + + executable('ImportTexturesFromDDS', + ['ImportTexturesFromDDS.cpp', 'dds.cpp'], + link_with: libcommon, + dependencies : wx_dep) +endif + +executable('CompareUPK', + ['CompareUPK.cpp', 'UPKInfo.cpp', 'UFlags.cpp']) + +executable('ExtractNameLists', + ['ExtractNameLists.cpp'], + link_with: libcommon) + +executable('FindObjectByOffset', + ['FindObjectByOffset.cpp'], + link_with: libcommon) + +executable('FindObjectEntry', + ['FindObjectEntry.cpp'], + link_with: libcommon) + +executable('HexToPseudoCode', + ['HexToPseudoCode.cpp'], + link_with: libcommon) + +executable('MoveExpandFunction', + ['MoveExpandFunction.cpp'], + link_with: libcommon) + +executable('ParseTfc', + ['ParseTfc.cpp', 'dds.cpp'], + link_with: libcommon) + +executable('PatchUPK', + ['PatchUPK.cpp', 'ModParser.cpp', 'ModScript.cpp'], + link_with: libcommon) + +executable('UENativeTablesReader', ['UENativeTablesReader.cpp'])