Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch btw #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 36 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@
This repository contains Bash and PowerShell scripts to generate CMake projects that include SFML library.

## Table of Content
1. [Requirements](#requirement)
- [Linux - Ubuntu](#requirement-ubuntu)
- [macOS](#requirement-macOS)
- [Windows](#requirement-windows)
2. [Installation](#installation)
- [Linux - Ubuntu](#installation-ubuntu)
- [macOS](#installation-macOS)
- [Windows](#installation-windows)
3. [How to generate a new SFML CMake project?](#project)
- [Linux - Ubuntu](#project-ubuntu)
- [macOS](#project-macOS)
- [Windows](#project-windows)
1. [Requirements](#requirement)
- [Linux - Ubuntu](#requirement-ubuntu)
- [macOS](#requirement-macOS)
- [Windows](#requirement-windows)
2. [Installation](#installation)
- [Linux - Ubuntu](#installation-ubuntu)
- [Linux - Arch](#installation-arch)
- [macOS](#installation-macOS)
- [Windows](#installation-windows)
3. [How to generate a new SFML CMake project?](#project)
- [Linux - Ubuntu](#project-ubuntu)
- [macOS](#project-macOS)
- [Windows](#project-windows)

## <img src="./media/font_awesome/check-square-regular.svg" style="vertical-align: middle;" width="18"> </img>Requirements <a name="requirement"/>
#### <img src="./media/font_awesome/linux-brands.svg" width="16"/> <img src="./media/font_awesome/ubuntu-brands.svg" width="16"/> **Linux - Ubuntu 18.04** <a name="requirement-ubuntu"/>
Expand Down Expand Up @@ -52,7 +53,18 @@ Please ensure that following required components have been installed:
```
cd ~/CLionProjects/game/installers/linux
./install_sfml.sh
```
```

#### <img src="./media/font_awesome/linux-brands.svg" width="16"/> <img src="./media/font_awesome/arch-brands.svg" width="16"/> **Linux - Arch Linux** <a name="installation-arch"/>
1. Open a terminal.
2. Ensure CMake has been installed: ``cmake --version`` or install as follow: ``sudo pacman -S cmake``
3. Ensure gcc has been installed: ``g++ --version`` or install as follow: ``sudo pacman -S base-devel``
4. Ensure GNU Debug has been installed: ``gdb --version`` or install as follow: `` sudo pacman -S gdb ``
5. Ensure Git has been installed: ``git --version`` or install as follow: `` sudo pacman -S git ``
6. Install CLion
[from the aur](https://aur.archlinux.org/packages/clion/)
7. Install SFML
``sudo pacman -S sfml``
#### <img src="./media/font_awesome/apple-brands.svg" width="16"/> **MacOS - Mojave 10.14** <a name="installation-macOS"/>
1. Open a terminal: [Command] + [Spacebar] and write in: ``terminal``
2. Ensure CLang has been installed: ``clang --version`` or if it is necessary run follow statement: ``xcode-select --install``
Expand All @@ -62,16 +74,16 @@ Please ensure that following required components have been installed:
6. Install SFML:
* In the terminal go to Home folder: ``cd ~``
* Verify if folder CLionProjects exists: ``ls`` otherwise create that new folder: ``mkdir CLionProjects``
* Go to CLionProjects folder: `` cd CLionProjects``
* Go to CLionProjects folder: `` cd CLionProjects``
* Download game project: `` git clone https://github.com/rrivas-utec/game.git``, and finally
* Execute the following statements:
```
cd ~/CLionProjects/game/installers/macOS
./install_sfml.sh
```
```
#### <img src="./media/font_awesome/windows-brands.svg" width="16"/> **Windows 10** <a name="installation-windows"/>
1. Install Visual Studio Community 2019: [VS Community](https://visualstudio.microsoft.com/vs/community/)
**Minimum Requirement**:
1. Install Visual Studio Community 2019: [VS Community](https://visualstudio.microsoft.com/vs/community/)
**Minimum Requirement**:
<img src="./media/vscommunity_minimum.png" width="750" style="border:2px solid gray"/>
2. Open a PowerShell terminal: [<img src="./media/font_awesome/windows-brands.svg" width="14"/>] + [R] and write in: ``powershell``
3. Install Git 2.20 or greater: [Git](https://git-scm.com/downloads)
Expand All @@ -92,34 +104,34 @@ Please ensure that following required components have been installed:
#### <img src="./media/font_awesome/linux-brands.svg" width="16"/> <img src="./media/font_awesome/ubuntu-brands.svg" width="16"/> **Linux - Ubuntu 18.04** <a name="project-ubuntu"/>
1. Open a terminal: [Ctrl] + [Alt] + [T]
2. Execute the following statement:
```
```
cd ~/CLionProjects/game/generators/linux
```
3. Define the name of your project, for example **pacman** and execute the following statement:<a name="project-ubuntu-step3"/>
```
./gen_project.sh pacman
```
This statement will generate a new folder called **pacman** at same level of **game** folder, in this case both folders will be inside of **CLionProjects** folder and **pacman** folder will contain the following files:
<img src="./media/project_folder.png" width="250"/>
This statement will generate a new folder called **pacman** at same level of **game** folder, in this case both folders will be inside of **CLionProjects** folder and **pacman** folder will contain the following files:
<img src="./media/project_folder.png" width="250"/>
The project could be used by CLion IDE but also can be compiled in command line, in order to help command line programming, it contains 3 additional scripts:
* ``build.sh``, to build a folder called **build** where CMake work stuff is saved.
* ``run.sh``, to compile the program and generate the executable, it verifies if **build** folder is available and if it is not, the script builds it.
* ``clean.sh``, to clean any previous compilation.
#### <img src="./media/font_awesome/apple-brands.svg" width="16"/> **MacOS - Mojave 10.14** <a name="project-macOS"/>
1. Open a terminal: [Command] + [Spacebar] and write in: ``terminal``
2. Execute the following statement:
```
```
cd ~/CLionProjects/game/generators/macOS
```
3. Follow same [Linux instructions](#project-ubuntu-step3) since step 3.
3. Follow same [Linux instructions](#project-ubuntu-step3) since step 3.
#### <img src="./media/font_awesome/windows-brands.svg" width="16"/> **Windows 10** <a name="project-windows"/>
1. Open a PowerShell terminal: [<img src="./media/font_awesome/windows-brands.svg" width="14"/>] + [R] and write in: ``powershell``
2. Execute the following statement:
```
```
cd ~/CLionProjects/game/generators/windows
```
3. Define the name of your project, for example **pacman** and execute the following statement:
```
./gen_project.ps1 pacman
```
This statement will generate a new folder called **pacman** at same level of **game** folder as it was explained in prior cases (linux and macOS) but it will not include any additional script so the recommendation for windows installation is to execute this project from CLion IDE or similar.
This statement will generate a new folder called **pacman** at same level of **game** folder as it was explained in prior cases (linux and macOS) but it will not include any additional script so the recommendation for windows installation is to execute this project from CLion IDE or similar.
67 changes: 67 additions & 0 deletions media/font_awesome/arch-brands.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 3 additions & 8 deletions source/CMakeLists.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.10)
project(PROYECTO)

# Archivos del Projecto
Expand Down Expand Up @@ -26,13 +26,8 @@ include_directories(${SFML_INCLUDE_DIR})
# Instrucciones para generar el ejecutable
add_executable(${PROJECT_NAME} ${PROJECT_SOURCE})

find_package(SFML 2.5.1
COMPONENTS
system
window
graphics
REQUIRED)

include(FindPkgConfig)
pkg_check_modules( SFML sfml-all)
target_link_libraries (${PROJECT_NAME}
sfml-system
sfml-window
Expand Down