From a627a56babb4e853e730888781dafbdefd7604df Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 24 Apr 2024 15:36:54 +0700 Subject: [PATCH] docs(readme): add integration section --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index f12abd3..54484b8 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,28 @@ The `SetupGo.cmake` is a CMake module containing a `setup_go` function. This function sets up a specific version of Go to be used in a CMake project. It downloads a specific Go build based on the current operating system and architecture from the official Go website and extracts the downloaded result to the CMake build directory. +## Integration + +This module can be integrated into a CMake project in the following ways: + +- Manually download the [`SetupGo.cmake`](./cmake/SetupGo.cmake) file and include it in the CMake project: + ```cmake + include("path/to/SetupGo.cmake") + ``` +- Use [`file(DOWNLOAD)`](https://cmake.org/cmake/help/latest/command/file.html#download) to automatically download the `GitCheckout.cmake` file: + ```cmake + file( + DOWNLOAD "https://threeal.github.io/setup-go-cmake/v1.0.0" + "${CMAKE_BINARY_DIR}/SetupGo.cmake" + ) + include("${CMAKE_BINARY_DIR}/SetupGo.cmake") + ``` +- Use [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to add this package to the CMake project: + ```cmake + cpmaddpackage("gh:threeal/setup-go-cmake@1.0.0") + include("${SetupGo_SOURCE_DIR}/cmake/SetupGo.cmake") + ``` + ## License This project is licensed under the terms of the [MIT License](./LICENSE).