Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Update to newest Version #1

Open
wants to merge 10 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
# IntelliJ
.idea/*
cmake-build-debug/*
cute_lib/*
cute/*
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.8) # specifies the minimum version of CMake required
project(clion) # names the project (must match the add_executable instruction below)

include_directories(cute_lib) # includes the CUTE library. without this you will not be able to include CUTE headers
include_directories(cute) # includes the CUTE library. without this you will not be able to include CUTE headers

file(GLOB_RECURSE SOURCE_FILES "src/*.cpp") # sets the SOURCE_FILES variable to contain all .cpp files inside the src/ directory
add_executable(clion ${SOURCE_FILES}) # creates the executable from the project name and the SOURCE_FILES variable
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Be sure to check the [.gitignore](.gitignore) file in order to keep unwanted (an


The following tutorial was made and test with the following software:
* CLion 2017.2.2 #CL-172.3968.17
* CUTE Standalone v2.0.0
* CLion 2020.3.2 (Build 203.7148.70)
* CUTE Standalone v2.2.6 (14 Oct 2019)

If something goes wrong or is hard to understand, be sure to contact us at [[email protected]](mailto:[email protected]), message us on [Facebook](www.facebook.com/niaefeup) or submit a pull request here!
Forked from https://github.com/NIAEFEUP/cute-clion (archive)

## Table of Contents
1. [Requirements](#requirements)
Expand All @@ -26,47 +26,53 @@ If something goes wrong or is hard to understand, be sure to contact us at [ni@a

For this to work, we need to install the following programs:
* [CLion](https://www.jetbrains.com/clion/)
* [CUTE Standalone](http://cute-test.com/projects/cute/wiki/CUTE_Standalone)
* [CUTE Standalone](https://cute-test.com/installation/), which has a link to the [CUTE-Repo on GitHub](https://github.com/PeterSommerlad/CUTE)


## Structure

This step is not needed if you cloned the repository. Otherwise, you need to create the following structure:
This step is not needed if you cloned the repository. Otherwise, you need to create the following structure in your project:

```
cute-clion
|-- CMakeLists.txt # compilation instructions
`-- src # source code directory/folder
`-- Test.cpp
`-- Test.cpp # example with tests
```


## Adding CUTE to the Project

Now, you must add the CUTE library to the project. Just extract the download file to your project directory, alongside the `src/` folder.
The structure should look like this afterwards:
Now, from the downloaded CUTE Standalone, copy the `cute` folder (which includes `cute.h` and the other `cute_...` header files) to the project alongside the `src/` folder.

The structure of your project should look like this afterwards:

```
cute-clion
|-- CMakeLists.txt
|-- cute_lib # added folder
|-- cute # added folder from CUTE-master download
| |-- cute.h
| |-- ... (omitted files)
`-- src
`-- Test.cpp
`-- Test.cpp
```

After having achieved the structure above, we need to tell CLion to use `cute_lib` to add CUTE functions to its suggestions system.
To do that, on 'Project' file explorer, right-click the cute_lib folder and mark the directory as 'Library Files', as seen below.
After having achieved the structure above, we need to tell CLion to use `cute` to add CUTE functions to its suggestions system.
To do that, on 'Project' file explorer, right-click the `cute` folder and mark the directory as 'Library Files', as seen below.

![Mark Directory as Library Files](clion_add_cute_lib.png)


#### Now, everything should work as intended!


## Useful Information

## Useful Information / Troubleshooting

* More folders can be created inside the `src` directory since they are all included automatically.
* The `Test.cpp` file can be deleted and changed, it is just an example. However, it is mandatory that there is a `.cpp` file with a `main` function.
* If you have problems, marking `cute` as library in clion, delete the hidden `.idea` folder and restart clion and retry it
* If you have compilation errors regarding `boost`, make sure cmake is using a version never than c++11, by adding this line `set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")` to the `CMakeLists.txt` file. [More info](https://intellij-support.jetbrains.com/hc/en-us/community/posts/206542459-How-to-enforce-a-specific-C-standard)


## Understanding CMakeLists.txt
Expand All @@ -77,7 +83,7 @@ Let's take a closer look.
```
1 cmake_minimum_required(VERSION 3.8)
2 project(clion)
3 include_directories(cute_lib)
3 include_directories(cute)
4 file(GLOB_RECURSE SOURCE_FILES "src/*.cpp")
5 add_executable(clion ${SOURCE_FILES})
```
Expand All @@ -88,3 +94,7 @@ Explanation:
3. This line includes the CUTE library in the compilation process, allowing us to use its functionality;
4. The `file` instruction will get all filenames that match the `src/*.cpp` pattern and join them all in the `SOURCE_FILES` variable;
5. This function creates the executable from the project name provided in the second line and all the files in the `SOURCE_FILES` variable.

## Not happy?
If this was not what you were looking for, check out this picture of a `cute sea lion` I took. I hope this helps..
![cute sea lion](cute_sea_lion.jpg)
Binary file modified clion_add_cute_lib.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added cute_sea_lion.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.