Commit 11ea00ca authored by guillaume's avatar guillaume
parents 952e5af5 0263791d
...@@ -4,15 +4,22 @@ project(networld LANGUAGES C) ...@@ -4,15 +4,22 @@ project(networld LANGUAGES C)
# Activate C99 standard: # Activate C99 standard:
SET(CMAKE_C_FLAGS "-g -std=c99 -Wall -Wextra" ) SET(CMAKE_C_FLAGS "-g -std=c99 -Wall -Wextra" )
# RayLib:
find_package(raylib 2.0 REQUIRED)
#set(raylib_VERBOSE 1)
# project configuration : # project configuration :
include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/src) include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/src)
# RayLib:
find_package(raylib 3.0 REQUIRED)
#set(raylib_VERBOSE 1)
add_executable(nw-hello src/hello.c) add_executable(nw-hello src/hello.c)
target_link_libraries(nw-hello raylib) target_link_libraries(nw-hello raylib)
add_executable(nw-viewer src/main-viewer.c src/networld.c) add_executable(nw-viewer src/main-viewer.c src/networld.c)
target_link_libraries(nw-viewer raylib) target_link_libraries(nw-viewer raylib)
\ No newline at end of file
#without cmake package...
#include_directories(${PROJECT_SOURCE_DIR}/raylib/src)
#link_directories(${PROJECT_SOURCE_DIR}/raylib)
#target_link_libraries(nw-viewer raylib GL m pthread dl rt X11)
...@@ -15,34 +15,30 @@ sudo apt update ...@@ -15,34 +15,30 @@ sudo apt update
sudo apt install gcc CMake sudo apt install gcc CMake
``` ```
Installer Raylib sous linux [[cf. raylib-wiki](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)] en suivant le 'Build raylib using CMake': Installer Raylib sur la version 3.0.0 sous linux [[cf. raylib-wiki](https://github.com/raysan5/raylib/wiki/Working-on-GNU-Linux)] en suivant le 'Build raylib using CMake' un peut modifie suivant:
```bash ```bash
git clone https://github.com/raysan5/raylib.git raylib git clone https://github.com/raysan5/raylib.git raylib
cd raylib cd raylib
git checkout 3.0.0
mkdir build && cd build mkdir build && cd build
cmake -DSHARED=ON -DSTATIC=ON .. cmake -DSHARED=ON -DSTATIC=ON ..
make make
make install sudo make install
cd .. cd ..
``` ```
First test of RayLib: First test of RayLib:
```bash ```bash
gcc -o nw-test src/test.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11 gcc -o nw-hello src/hello.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
./nw-test ./nw-hello
``` ```
With CMake: Compiling NetWorld using a little home made script:
```bash ```bash
mkdir build bin/make.sh
cd build
cmake ..
make
./nw-test
``` ```
## Idée de jeux induit: ## Idée de jeux induit:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment