feat: CMake
This commit is contained in:
parent
61d1f4075e
commit
8c4930bf1e
21
CMakeLists.txt
Normal file
21
CMakeLists.txt
Normal file
@ -0,0 +1,21 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
project(GameOfLife)
|
||||
|
||||
file(GLOB SOURCES
|
||||
src/*.h
|
||||
src/*.cpp
|
||||
)
|
||||
|
||||
# Packages
|
||||
find_package(SDL2 REQUIRED)
|
||||
include_directories(${SDL2_INCLUDE_DIRS})
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
include_directories(${OPENGL_INCLUDE_DIRS})
|
||||
|
||||
include_directories(include/)
|
||||
|
||||
# Executable
|
||||
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||
target_link_libraries(${PROJECT_NAME} ${SDL2_LIBRARIES})
|
||||
target_link_libraries(${PROJECT_NAME} ${OPENGL_LIBRARIES})
|
11
makefile
11
makefile
@ -1,11 +0,0 @@
|
||||
includeF = -Iinclude
|
||||
libraryF = -Llib -lSDL2
|
||||
|
||||
bin/main: pre-build src/main.cpp obj/GameOfLife.o
|
||||
g++ -std=c++17 -o bin/main src/main.cpp obj/GameOfLife.o $(includeF) $(libraryF)
|
||||
|
||||
obj/GameOfLife.o: src/GameOfLife.cpp
|
||||
g++ -std=c++17 -c -o obj/GameOfLife.o src/GameOfLife.cpp $(includeF) $(libraryF)
|
||||
|
||||
pre-build:
|
||||
mkdir -p obj && mkdir -p bin
|
Loading…
x
Reference in New Issue
Block a user