diff --git a/README.md b/README.md index 7db431a..b634231 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,33 @@ The improvements made to these modules are as follows: ## Usage -There is two approaches that can be adopted: A legacy approach and a modern -approach. Both of them are supported. +In order to use the SDL2 CMake modules, we have to clone this repository in a +sud-directory `cmake/sdl2` in our project as follows: + +```sh +cd +git clone https://gitlab.com/aminosbh/sdl2-cmake-modules.git cmake/sdl2 +rm -rf cmake/sdl2/.git +``` + +Or if we are using git for our project, we can add this repository as a +submodule as follows: + +```sh +cd +git submodule add https://gitlab.com/aminosbh/sdl2-cmake-modules.git cmake/sdl2 +git commit -m "Add SDL2 CMake modules" +``` + +Then we should specify the modules path in the main CMakeLists.txt file like +the following: + +```cmake +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2) +``` + +Finally, we can use the SDL2 modules. There is two approaches that can be +adopted: A legacy approach and a modern approach. Both of them are supported. ### Modern CMake