diff --git a/COMPILE.md b/COMPILE.md index de1e5fe..a3cf1d4 100644 --- a/COMPILE.md +++ b/COMPILE.md @@ -73,25 +73,9 @@ So before compiling, you must make sure `doxygen` are presented in your environm ## Build and Install -There are 2 different ways to build this project. -If you are the user of this project (just want this project to make something works), please choose "User Build". -If you are a developer (developer of this project, or use this project as dependency to develop your project), please choose "Developer Build". +Using CMake is the only viable way to build and install this repository. -### User Build - -"User Build" is basically how GitHub Action build this project. - -Under **the root directory** of this project, execute: - -- `Script/windows_build.bat` on Windows -- or `Script/linux_build.sh` on Linux -- or `Script/macos_build.sh` on macOS - -The final built artifact is under `Bin/install` directory. - -### Developer Build - -#### Configurable Variables +### Configurable Variables First, there is a list listing all variables you may configure during compiling. @@ -109,7 +93,7 @@ Please note that generated documentation is different in different platforms. * `ZLIB_ROOT`: Set to the install path of zlib. If you are using zlib which is not build by your own, you usually do not need specify this variable. -#### Configure CMake +### Configure CMake When configure CMake, you may use different options on different platforms. Following list may help you. @@ -124,7 +108,7 @@ Additionally, you can attach any variables introduced above with `-D` option dur > [!NOTE] > Position independent code flag is automatically added if you enable `BMap` so you don't need manually specify it. You just need to make sure that all dependencies enable this. -#### Build with CMake +### Build with CMake After configuration, you can use `cmake --build .` to build project, with additional options on different platforms. @@ -135,7 +119,7 @@ Following list may help you. - On Linux or other POSIX systems: * None -#### Install with CMake +### Install with CMake After building, you can use `cmake --install . --prefix ` to install project into given path, with additional options on different platforms. diff --git a/DISTRIBUTION.md b/DISTRIBUTION.md deleted file mode 100644 index a99855c..0000000 --- a/DISTRIBUTION.md +++ /dev/null @@ -1,43 +0,0 @@ -# LibCmo21 Redist - -This folder is served for LibCmo21 distribution and this page will introduce how to distribute a LibCmo21. - -In this article, I assume: -* This distribution is served for Windows user. -* All Linux will use this project by compiling it on themselves. -* You are using Visual Studio under Windows, not CMake. -* User will only need x64 architecture, not Win32 (x86). - -## Common - -1. Copy project `LICENSE` into folder. - -## Unvirt - -1. Compile project with `x64 | Release` profile. -1. Create folder `Unvirt` and enter it. -1. Copy generated `Unvirt.exe` and `Unvirt.pdb` into folder. -1. Copy zlib binary `zlibwapi.dll` into folder. - -## BMap - -1. Compile project with `x64 | Release` profile. -1. Create folder `BMap` and enter it. -1. Copy generated `BMap.dll` and `BMap.pdb` into folder. -1. Copy zlib binary `zlibwapi.dll` into folder. - -## PyBMap - -1. Compile project with `x64 | Release` profile. -1. Create folder `PyBMap` and enter it. -1. Copy all files ending with `.py` and located in folder `BMapBindings/PyBMap/PyBMap` into folder. -1. Copy generated `BMap.dll` and `BMap.pdb` into folder. -1. Copy zlib binary `zlibwapi.dll` into folder. - -## BMapSharp - -This project is not ready for release. - -## Ending - -1. Pack all files and folders except `.gitignore` and `README.md` in this folder. diff --git a/LICENSE b/LICENSE index c2bf56b..0988fe5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022-2024 yyc12345 +Copyright (c) 2022-2026 yyc12345 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Scripts/.gitignore b/Scripts/.gitignore deleted file mode 100644 index d5c5094..0000000 --- a/Scripts/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Disable output -win_build.bat -linux_build.sh diff --git a/Scripts/gen_build_script.py b/Scripts/gen_build_script.py deleted file mode 100644 index 21f506d..0000000 --- a/Scripts/gen_build_script.py +++ /dev/null @@ -1,67 +0,0 @@ -import os -import argparse -import jinja2 - -def get_root_directory() -> str: - return os.path.dirname(os.path.dirname(__file__)) - -class ScriptSettings: - m_BuildDoc: bool - - def __init__(self, build_doc: bool): - self.m_BuildDoc = build_doc - -class TemplateRender: - m_Loader: jinja2.BaseLoader - m_Environment: jinja2.Environment - - m_WinTemplate: jinja2.Template - m_LinuxTemplate: jinja2.Template - - m_Settings: ScriptSettings - - def __init__(self, settings: ScriptSettings) -> None: - self.m_Loader = jinja2.FileSystemLoader(self.__get_dir()) - self.m_Environment = jinja2.Environment(loader=self.m_Loader) - - self.m_WinTemplate = self.m_Environment.get_template('win_build.template.bat') - self.m_LinuxTemplate = self.m_Environment.get_template('linux_build.template.sh') - - self.m_Settings = settings - - def __get_dir(self) -> str: - return os.path.dirname(__file__) - - def __render(self, template: jinja2.Template, dest_file: str, is_win: bool) -> None: - with open(os.path.join(self.__get_dir(), dest_file), 'w', encoding='utf-8') as f: - f.write(template.render( - repo_root_dir = os.path.dirname(self.__get_dir()), - build_doc = self.m_Settings.m_BuildDoc - )) - - def render_win_script(self) -> None: - self.__render(self.m_WinTemplate, 'win_build.bat', True) - - def render_linux_script(self) -> None: - self.__render(self.m_LinuxTemplate, 'linux_build.sh', False) - -if __name__ == '__main__': - # parse argument - parser = argparse.ArgumentParser( - prog='LibCmo Windows Build Script', - description='LibCmo Windows Build Script' - ) - parser.add_argument( - '-d', '--build-doc', - action='store_true', dest='build_doc', - help='Build LibCmo without documentation.' - ) - args = parser.parse_args() - - # build settings - settings = ScriptSettings(args.build_doc) - # build template render and render result - render = TemplateRender(settings) - render.render_win_script() - render.render_linux_script() - \ No newline at end of file diff --git a/Scripts/linux_build.template.sh b/Scripts/linux_build.template.sh deleted file mode 100644 index e69de29..0000000 diff --git a/Scripts/win_build.template.bat b/Scripts/win_build.template.bat deleted file mode 100644 index 5112afb..0000000 --- a/Scripts/win_build.template.bat +++ /dev/null @@ -1,24 +0,0 @@ -@ECHO OFF -:: Navigate to root directory -CD /d {{ repo_root_dir }} - -:: Create main binary directory -MKDIR bin -CD bin -:: Create build and install folder -MKDIR build -MKDIR install - -:: Build project -CD build -cmake -A x64 -DNEMO_BUILD_UNVIRT=ON -DNEMO_BUILD_BMAP=ON {{ '-DNEMO_BUILD_DOC=ON' if build_doc }} -DSTB_IMAGE_PATH="D:\CppLib\stb" -DYYCC_PATH="J:\YYCCommonplace\bin\cpp20\install\x64_Release" -DZLIB_HEADER_PATH="D:\zlib" -DZLIB_BINARY_PATH="D:\zlib\contrib\vstudio\vc14\x64\ZlibDllRelease" ../.. -cmake --build . --config RelWithDebInfo -{% if build_doc %} -cmake --build . --target NeMoDocuments -{% endif %} -cmake --install . --prefix=../install --config RelWithDebInfo -CD .. - -:: Exit to original path -CD .. -ECHO Windows CMake Build Done